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


C++ CLIENTMAP类代码示例

本文整理汇总了C++中CLIENTMAP的典型用法代码示例。如果您正苦于以下问题:C++ CLIENTMAP类的具体用法?C++ CLIENTMAP怎么用?C++ CLIENTMAP使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DeleteFromClient

bool CPVRTimerInfoTag::DeleteFromClient(bool force) const
{
    try
    {
        CLIENTMAP *clients = CPVRManager::Get()->Clients();

        /* and write it to the backend */
        PVR_ERROR err = clients->find(m_iClientID)->second->DeleteTimer(*this, force);

        if (err == PVR_ERROR_RECORDING_RUNNING)
        {
            if (CGUIDialogYesNo::ShowAndGetInput(122,0,19122,0))
                err = clients->find(m_iClientID)->second->DeleteTimer(*this, true);
        }

        if (err != PVR_ERROR_NO_ERROR)
            throw err;

        return true;
    }
    catch (PVR_ERROR err)
    {
        DisplayError(err);
    }
    return false;
}
开发者ID:rdaoc,项目名称:xbmc,代码行数:26,代码来源:PVRTimerInfoTag.cpp

示例2: GetActiveClients

int CPVRClients::GetChannelGroupMembers(CPVRChannelGroup *group, PVR_ERROR *error)
{
  *error = PVR_ERROR_NO_ERROR;
  int iCurSize = group->GetNumChannels();
  CLIENTMAP clients;
  GetActiveClients(&clients);

  /* get the member list from each client */
  CLIENTMAPITR itrClients = clients.begin();
  while (itrClients != clients.end())
  {
    if (HasChannelGroupSupport((*itrClients).first))
    {
      PVR_ERROR currentError;
      currentError = (*itrClients).second->GetChannelGroupMembers(group);

      if (currentError != PVR_ERROR_NO_ERROR)
        *error = currentError;
    }

    itrClients++;
  }

  return group->GetNumChannels() - iCurSize;
}
开发者ID:chris-magic,项目名称:xbmc_dualaudio_pvr,代码行数:25,代码来源:PVRClients.cpp

示例3: Delete

bool CPVRRecording::Delete(void) const
{
  try
  {
    CLIENTMAP *clients = CPVRManager::Get()->Clients();

    /* and write it to the backend */
    PVR_ERROR err = clients->find(m_clientID)->second->DeleteRecording(*this);

    if (err != PVR_ERROR_NO_ERROR)
      throw err;

    return true;
  }
  catch (PVR_ERROR err)
  {
    DisplayError(err);
  }
  return false;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:20,代码来源:PVRRecording.cpp

示例4: size

int CPVRChannelGroupInternal::GetFromClients(void)
{
  CLIENTMAP *clients = CPVRManager::Get()->Clients();
  if (!clients)
    return 0;

  int iCurSize = size();

  /* get the channel list from each client */
  CLIENTMAPITR itrClients = clients->begin();
  while (itrClients != clients->end())
  {
    if ((*itrClients).second->ReadyToUse() && (*itrClients).second->GetNumChannels() > 0)
      (*itrClients).second->GetChannelList(*this, m_bRadio);

    itrClients++;
  }

  return size() - iCurSize;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:20,代码来源:PVRChannelGroupInternal.cpp

示例5: Rename

bool CPVRRecording::Rename(const CStdString &strNewName) const
{
  try
  {
    CLIENTMAP *clients = CPVRManager::Get()->Clients();

    /* and write it to the backend */
    PVR_ERROR err = clients->find(m_clientID)->second->RenameRecording(*this, strNewName);

    if (err != PVR_ERROR_NO_ERROR)
      throw err;

    CPVRManager::GetRecordings()->Update(true); // async update
    return true;
  }
  catch (PVR_ERROR err)
  {
    DisplayError(err);
  }
  return false;
}
开发者ID:vanegithub,项目名称:xbmc,代码行数:21,代码来源:PVRRecording.cpp

示例6: UpdateOnClient

bool CPVRTimerInfoTag::UpdateOnClient() const
{
    try
    {
        CLIENTMAP *clients = CPVRManager::Get()->Clients();

        /* and write it to the backend */
        PVR_ERROR err = clients->find(m_iClientID)->second->UpdateTimer(*this);
        if (err != PVR_ERROR_NO_ERROR)
            throw err;

        if (m_StartTime < CDateTime::GetCurrentDateTime() && m_StopTime > CDateTime::GetCurrentDateTime())
            CPVRManager::Get()->TriggerRecordingsUpdate();

        return true;
    }
    catch (PVR_ERROR err)
    {
        DisplayError(err);
    }
    return false;
}
开发者ID:rdaoc,项目名称:xbmc,代码行数:22,代码来源:PVRTimerInfoTag.cpp

示例7: RenameOnClient

bool CPVRTimerInfoTag::RenameOnClient(const CStdString &newname) const
{
    try
    {
        CLIENTMAP *clients = CPVRManager::Get()->Clients();

        /* and write it to the backend */
        PVR_ERROR err = clients->find(m_iClientID)->second->RenameTimer(*this, newname);

        if (err == PVR_ERROR_NOT_IMPLEMENTED)
            err = clients->find(m_iClientID)->second->UpdateTimer(*this);

        if (err != PVR_ERROR_NO_ERROR)
            throw err;

        return true;
    }
    catch (PVR_ERROR err)
    {
        DisplayError(err);
    }

    return false;
}
开发者ID:rdaoc,项目名称:xbmc,代码行数:24,代码来源:PVRTimerInfoTag.cpp

示例8: iActiveClients

void CPVRGUIInfo::UpdateBackendCache(void)
{
  CStdString strBackendName;
  CStdString strBackendVersion;
  CStdString strBackendHost;
  CStdString strBackendDiskspace;
  CStdString strBackendTimers;
  CStdString strBackendRecordings;
  CStdString strBackendChannels;
  int        iActiveClients(0);

  if (!AddonInfoToggle())
    return;

  CPVRClients *clients = g_PVRClients;
  CLIENTMAP activeClients;
  iActiveClients = clients->GetConnectedClients(&activeClients);
  if (iActiveClients > 0)
  {
    CLIENTMAPITR activeClient = activeClients.begin();
    /* safe to read unlocked */
    for (unsigned int i = 0; i < m_iAddonInfoToggleCurrent; i++)
      activeClient++;

    long long kBTotal = 0;
    long long kBUsed  = 0;

    if (activeClient->second->GetDriveSpace(&kBTotal, &kBUsed) == PVR_ERROR_NO_ERROR)
    {
      kBTotal /= 1024; // Convert to MBytes
      kBUsed /= 1024;  // Convert to MBytes
      strBackendDiskspace.Format("%s %.1f GByte - %s: %.1f GByte",
          g_localizeStrings.Get(20161), (float) kBTotal / 1024, g_localizeStrings.Get(20162), (float) kBUsed / 1024);
    }
    else
    {
      strBackendDiskspace = g_localizeStrings.Get(19055);
    }

    int NumChannels = activeClient->second->GetChannelsAmount();
    if (NumChannels >= 0)
      strBackendChannels.Format("%i", NumChannels);
    else
      strBackendChannels = g_localizeStrings.Get(161);

    int NumTimers = activeClient->second->GetTimersAmount();
    if (NumTimers >= 0)
      strBackendTimers.Format("%i", NumTimers);
    else
      strBackendTimers = g_localizeStrings.Get(161);

    int NumRecordings = activeClient->second->GetRecordingsAmount();
    if (NumRecordings >= 0)
      strBackendRecordings.Format("%i", NumRecordings);
    else
      strBackendRecordings = g_localizeStrings.Get(161);

    strBackendName    = activeClient->second->GetBackendName();
    strBackendVersion = activeClient->second->GetBackendVersion();
    strBackendHost    = activeClient->second->GetConnectionString();
  }

  CSingleLock lock(m_critSection);
  m_strBackendName         = strBackendName;
  m_strBackendVersion      = strBackendVersion;
  m_strBackendHost         = strBackendHost;
  m_strBackendDiskspace    = strBackendDiskspace;
  m_strBackendTimers       = strBackendTimers;
  m_strBackendRecordings   = strBackendRecordings;
  m_strBackendChannels     = strBackendChannels;
  m_iActiveClients         = iActiveClients;
}
开发者ID:Kr0nZ,项目名称:xbmc,代码行数:72,代码来源:PVRGUIInfo.cpp

示例9: lock

int CPVRTimers::Update()
{
  CSingleLock lock(m_critSection);

  CLog::Log(LOGDEBUG, "PVRTimers - %s - updating timers",
      __FUNCTION__);

  int iCurSize = size();

  /* clear channel timers */
  for (unsigned int iTimerPtr = 0; iTimerPtr < size(); iTimerPtr++)
  {
    CPVRTimerInfoTag *timerTag = &at(iTimerPtr);
    if (!timerTag || !timerTag->Active())
      continue;

    CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *)timerTag->EpgInfoTag();
    if (!epgTag)
      continue;

    epgTag->SetTimer(NULL);
  }

  /* clear timers */
  clear();

  /* get all timers from the clients */
  CLIENTMAP *clients = g_PVRManager.Clients();
  CLIENTMAPITR itr = clients->begin();
  while (itr != clients->end())
  {
    if (g_PVRManager.GetClientProps((*itr).second->GetID())->SupportTimers)
    {
      if ((*itr).second->GetNumTimers() > 0)
      {
        (*itr).second->GetAllTimers(this);
      }
    }
    itr++;
  }

  //XXX
  g_PVRManager.UpdateRecordingsCache();

  /* set channel timers */
  for (unsigned int ptr = 0; ptr < size(); ptr++)
  {
    /* get the timer tag */
    CPVRTimerInfoTag *timerTag = &at(ptr);
    if (!timerTag || !timerTag->Active())
      continue;

    /* try to get the channel */
    CPVRChannel *channel = CPVRChannels::GetByClientFromAll(timerTag->Number(), timerTag->ClientID());
    if (!channel)
      continue;

    /* try to get the EPG */
    CPVREpg *epg = channel->GetEPG();
    if (!epg)
      continue;

    /* try to set the timer on the epg tag that matches */
    CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) epg->InfoTagBetween(timerTag->Start(), timerTag->Stop());
    if (epgTag)
      epgTag->SetTimer(timerTag);
  }

  return size() - iCurSize;
}
开发者ID:margro,项目名称:xbmc-antiquated,代码行数:70,代码来源:PVRTimers.cpp


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