Navigation Menu

Skip to content

Commit

Permalink
[pvr] added CPVRClients::IsInUse()
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Dec 19, 2012
1 parent bd28b83 commit 7983d0d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbmc/pvr/addons/PVRClients.cpp
Expand Up @@ -62,6 +62,16 @@ CPVRClients::~CPVRClients(void)
Unload();
}

bool CPVRClients::IsInUse(const std::string& strAddonId) const
{
CSingleLock lock(m_critSection);

for (PVR_CLIENTMAP_CITR itr = m_clientMap.begin(); itr != m_clientMap.end(); itr++)
if (itr->second->Enabled() && itr->second->ID().Equals(strAddonId.c_str()))
return true;
return false;
}

void CPVRClients::Start(void)
{
Stop();
Expand Down
7 changes: 7 additions & 0 deletions xbmc/pvr/addons/PVRClients.h
Expand Up @@ -55,6 +55,13 @@ namespace PVR
CPVRClients(void);
virtual ~CPVRClients(void);

/*!
* @brief Checks whether an add-on is loaded by the pvr manager
* @param strAddonId The add-on id to check
* @return True when in use, false otherwise
*/
bool IsInUse(const std::string& strAddonId) const;

/*!
* @brief Start the backend info updater thread.
*/
Expand Down

0 comments on commit 7983d0d

Please sign in to comment.