Skip to content

Commit

Permalink
[PVR] Cleanup: Remove a bunch of unused member functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksooo committed Jun 19, 2016
1 parent 5e1328d commit e38907f
Show file tree
Hide file tree
Showing 24 changed files with 0 additions and 560 deletions.
32 changes: 0 additions & 32 deletions xbmc/pvr/PVRDatabase.cpp
Expand Up @@ -154,23 +154,6 @@ bool CPVRDatabase::DeleteChannels(void)
return DeleteValues("channels");
}

bool CPVRDatabase::DeleteClientChannels(const CPVRClient &client)
{
/* invalid client Id */
if (client.GetID() <= 0)
{
CLog::Log(LOGERROR, "PVR - %s - invalid client id: %i", __FUNCTION__, client.GetID());
return false;
}

CLog::Log(LOGDEBUG, "PVR - %s - deleting all channels from client '%i' from the database", __FUNCTION__, client.GetID());

Filter filter;
filter.AppendWhere(PrepareSQL("iClientId = %u", client.GetID()));

return DeleteValues("channels", filter);
}

bool CPVRDatabase::Delete(const CPVRChannel &channel)
{
/* invalid channel */
Expand Down Expand Up @@ -295,21 +278,6 @@ bool CPVRDatabase::GetCurrentGroupMembers(const CPVRChannelGroup &group, std::ve
return bReturn;
}

bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group)
{
/* invalid group id */
if (group.GroupID() <= 0)
{
CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID());
return false;
}

Filter filter;
filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID()));

return DeleteValues("map_channelgroups_channels", filter);
}

bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group, const std::vector<int> &channelsToDelete)
{
bool bDelete(true);
Expand Down
8 changes: 0 additions & 8 deletions xbmc/pvr/PVRDatabase.h
Expand Up @@ -75,13 +75,6 @@ namespace PVR
*/
bool DeleteChannels(void);

/*!
* @brief Remove all channels from a client from the database.
* @param client The client to delete the channels for.
* @return True if the channels were deleted, false otherwise.
*/
bool DeleteClientChannels(const CPVRClient &client);

/*!
* @brief Add or update a channel entry in the database
* @param channel The channel to persist.
Expand Down Expand Up @@ -175,7 +168,6 @@ namespace PVR
void CreateTables();
void CreateAnalytics();

bool DeleteChannelsFromGroup(const CPVRChannelGroup &group);
bool DeleteChannelsFromGroup(const CPVRChannelGroup &group, const std::vector<int> &channelsToDelete);

bool GetCurrentGroupMembers(const CPVRChannelGroup &group, std::vector<int> &members);
Expand Down
28 changes: 0 additions & 28 deletions xbmc/pvr/PVRManager.cpp
Expand Up @@ -235,16 +235,6 @@ void CPVRManager::OnSettingAction(const CSetting *setting)
}
}

bool CPVRManager::IsPVRWindowActive(void) const
{
return (IsPVRWindow(g_windowManager.GetActiveWindow() & WINDOW_ID_MASK)) ? true : false;
}

bool CPVRManager::IsPVRWindow(int windowId)
{
return (windowId >= WINDOW_PVR_ID_START && windowId <= WINDOW_PVR_ID_END) ? true : false;
}

void CPVRManager::Cleanup(void)
{
CSingleLock lock(m_critSection);
Expand Down Expand Up @@ -1506,29 +1496,11 @@ int CPVRManager::TranslateIntInfo(DWORD dwInfo) const
return IsStarted() && m_guiInfo ? m_guiInfo->TranslateIntInfo(dwInfo) : 0;
}

bool CPVRManager::HasTimers(void) const
{
return IsStarted() && m_timers ? m_timers->HasActiveTimers() : false;
}

bool CPVRManager::IsRecording(void) const
{
return IsStarted() && m_timers ? m_timers->IsRecording() : false;
}

bool CPVRManager::IsIdle(void) const
{
bool bReturn(true);
if (IsStarted())
{
if (IsRecording() || IsPlaying()) // pvr recording or playing?
bReturn = false;
else
bReturn = !IsNextEventWithinBackendIdleTime();
}
return bReturn;
}

bool CPVRManager::CanSystemPowerdown(bool bAskUser /*= true*/) const
{
bool bReturn(true);
Expand Down
28 changes: 0 additions & 28 deletions xbmc/pvr/PVRManager.h
Expand Up @@ -172,16 +172,6 @@ namespace PVR
*/
void Cleanup(void);

/*!
* @return True when a PVR window is active, false otherwise.
*/
bool IsPVRWindowActive(void) const;

/*!
* @return True when the given window id is an PVR window, false otherwise.
*/
static bool IsPVRWindow(int windowId);

/*!
* @brief Get the TV database.
* @return The TV database.
Expand Down Expand Up @@ -353,24 +343,12 @@ namespace PVR
*/
bool SetRecordingOnChannel(const CPVRChannelPtr &channel, bool bOnOff);

/*!
* @brief Check whether there are active timers.
* @return True if there are active timers, false otherwise.
*/
bool HasTimers(void) const;

/*!
* @brief Check whether there are active recordings.
* @return True if there are active recordings, false otherwise.
*/
bool IsRecording(void) const;

/*!
* @brief Check whether the pvr backend is idle.
* @return True if there are no active timers/recordings/wake-ups within the configured time span.
*/
bool IsIdle(void) const;

/*!
* @brief Check whether the system Kodi is running on can be powered down
* (shutdown/reboot/suspend/hibernate) without stopping any active
Expand Down Expand Up @@ -564,12 +542,6 @@ namespace PVR
*/
void OnWake();

/*!
* @brief Wait until the pvr manager is loaded
* @return True when loaded, false otherwise
*/
bool WaitUntilInitialised(void);

/*!
* @brief Create EPG tags for all channels in internal channel groups
* @return True if EPG tags where created successfully, false otherwise
Expand Down
41 changes: 0 additions & 41 deletions xbmc/pvr/addons/PVRClients.cpp
Expand Up @@ -68,16 +68,6 @@ CPVRClients::~CPVRClients(void)
Unload();
}

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

for (const auto &client : m_clientMap)
if (!CAddonMgr::GetInstance().IsAddonDisabled(client.second->ID()) && client.second->ID() == strAddonId)
return true;
return false;
}

void CPVRClients::Start(void)
{
CAddonMgr::GetInstance().RegisterAddonMgrCallback(ADDON_PVRDLL, this);
Expand Down Expand Up @@ -888,23 +878,6 @@ bool CPVRClients::HasMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat)
client->HaveMenuHooks(cat));
}

bool CPVRClients::GetMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, PVR_MENUHOOKS *hooks)
{
bool bReturn(false);

if (iClientID < 0)
iClientID = GetPlayingClientID();

PVR_CLIENT client;
if (GetCreatedClient(iClientID, client) && client->HaveMenuHooks(cat))
{
*hooks = *(client->GetMenuHooks());
bReturn = true;
}

return bReturn;
}

void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CFileItem *item)
{
// get client id
Expand Down Expand Up @@ -1402,14 +1375,6 @@ int64_t CPVRClients::SeekStream(int64_t iFilePosition, int iWhence/* = SEEK_SET*
return -EINVAL;
}

int64_t CPVRClients::GetStreamPosition(void)
{
PVR_CLIENT client;
if (GetPlayingClient(client))
return client->GetStreamPosition();
return -EINVAL;
}

void CPVRClients::PauseStream(bool bPaused)
{
PVR_CLIENT client;
Expand Down Expand Up @@ -1455,12 +1420,6 @@ bool CPVRClients::IsPlayingRecording(void) const
return m_bIsPlayingRecording;
}

bool CPVRClients::IsReadingLiveStream(void) const
{
CSingleLock lock(m_critSection);
return m_bIsPlayingLiveTV;
}

bool CPVRClients::IsEncrypted(void) const
{
PVR_CLIENT client;
Expand Down
26 changes: 0 additions & 26 deletions xbmc/pvr/addons/PVRClients.h
Expand Up @@ -69,13 +69,6 @@ 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.
*/
Expand Down Expand Up @@ -229,12 +222,6 @@ namespace PVR
*/
int64_t SeekStream(int64_t iFilePosition, int iWhence = SEEK_SET);

/*!
* @brief Get the currently playing position in a stream.
* @return The current position.
*/
int64_t GetStreamPosition(void);

/*!
* @brief Close a PVR stream.
*/
Expand All @@ -261,11 +248,6 @@ namespace PVR
*/
std::string GetCurrentInputFormat(void) const;

/*!
* @return True if a live stream is playing, false otherwise.
*/
bool IsReadingLiveStream(void) const;

/*!
* @return True if a TV channel is playing, false otherwise.
*/
Expand Down Expand Up @@ -694,14 +676,6 @@ namespace PVR
*/
void UpdateAddons(void);

/*!
* @brief Get the menu hooks for a client.
* @param iClientID The client to get the hooks for.
* @param hooks The container to add the hooks to.
* @return True if the hooks were added successfully (if any), false otherwise.
*/
bool GetMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, PVR_MENUHOOKS *hooks);

/*!
* @brief Get the instance of the client.
* @param iClientId The id of the client to get.
Expand Down
5 changes: 0 additions & 5 deletions xbmc/pvr/channels/PVRChannel.cpp
Expand Up @@ -675,11 +675,6 @@ bool CPVRChannel::IsSubChannel(void) const
return SubChannelNumber() > 0;
}

bool CPVRChannel::IsClientSubChannel(void) const
{
return ClientSubChannelNumber() > 0;
}

std::string CPVRChannel::FormattedChannelNumber(void) const
{
return !IsSubChannel() ?
Expand Down
6 changes: 0 additions & 6 deletions xbmc/pvr/channels/PVRChannel.h
Expand Up @@ -149,11 +149,6 @@ namespace PVR
*/
std::string FormattedChannelNumber(void) const;

/**
* @return True when this channel is marked as sub channel by the add-on, false if it's marked as main channel
*/
bool IsClientSubChannel(void) const;

/*!
* @brief Set to true to hide this channel. Set to false to unhide it.
*
Expand Down Expand Up @@ -364,7 +359,6 @@ namespace PVR
*/
bool IsEncrypted(void) const;


/*!
* @brief Return the encryption system ID for this channel. 0 for FTA.
*
Expand Down

0 comments on commit e38907f

Please sign in to comment.