Skip to content

Commit

Permalink
Merge pull request #36 from hudokkow/p8platform
Browse files Browse the repository at this point in the history
Update to libp8-platform
  • Loading branch information
hudokkow committed Jan 23, 2016
2 parents 2bca8b2 + 8659580 commit 2caaffb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ enable_language(CXX)

find_package(kodi REQUIRED)
find_package(kodiplatform REQUIRED)
find_package(platform REQUIRED)
find_package(p8-platform REQUIRED)
find_package(JsonCpp REQUIRED)

include_directories(${kodiplatform_INCLUDE_DIRS}
${platform_INCLUDE_DIRS}
${p8-platform_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIRS}
${KODI_INCLUDE_DIR})

set(DEPLIBS ${platform_LIBRARIES} ${JSONCPP_LIBRARIES})
set(DEPLIBS ${p8-platform_LIBRARIES} ${JSONCPP_LIBRARIES})

set(FILMON_SOURCES src/client.cpp
src/FilmonAPI.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/FilmonAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <json/json.h>

#include "platform/util/timeutils.h" // for usleep
#include "p8-platform/util/timeutils.h" // for usleep

#include "FilmonAPI.h"
#include "client.h"
Expand Down
24 changes: 12 additions & 12 deletions src/PVRFilmonData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PVRFilmonData::~PVRFilmonData(void) {
}

bool PVRFilmonData::Load(std::string user, std::string pwd) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
username = user;
password = pwd;
bool res = filmonAPICreate();
Expand Down Expand Up @@ -74,7 +74,7 @@ const char* PVRFilmonData:: GetConnection(void) {
}

void PVRFilmonData::GetDriveSpace(long long *iTotal, long long *iUsed) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "getting user storage from API");
filmonAPIgetUserStorage(iTotal, iUsed);
*iTotal = *iTotal/10;
Expand All @@ -89,7 +89,7 @@ int PVRFilmonData::GetChannelsAmount(void) {
}

PVR_ERROR PVRFilmonData::GetChannels(ADDON_HANDLE handle, bool bRadio) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
bool res = false;
bool expired = false;
if (time(0) - lastTimeChannels > FILMON_CACHE_TIME) {
Expand Down Expand Up @@ -159,7 +159,7 @@ int PVRFilmonData::GetChannelGroupsAmount(void) {
}

PVR_ERROR PVRFilmonData::GetChannelGroups(ADDON_HANDLE handle, bool bRadio) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
if (bRadio == false) {
if (time(0) - lastTimeGroups > FILMON_CACHE_TIME) {
XBMC->Log(LOG_DEBUG,
Expand All @@ -184,7 +184,7 @@ PVR_ERROR PVRFilmonData::GetChannelGroups(ADDON_HANDLE handle, bool bRadio) {

PVR_ERROR PVRFilmonData::GetChannelGroupMembers(ADDON_HANDLE handle,
const PVR_CHANNEL_GROUP &group) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
if (time(0) - lastTimeGroups > FILMON_CACHE_TIME) {
XBMC->Log(LOG_DEBUG,
"cache expired, getting channel groups members from API");
Expand Down Expand Up @@ -230,7 +230,7 @@ int PVRFilmonData::UpdateChannel(unsigned int channelId) {
// Called periodically to refresh EPG
PVR_ERROR PVRFilmonData::GetEPGForChannel(ADDON_HANDLE handle,
const PVR_CHANNEL &channel, time_t iStart, time_t iEnd) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "getting EPG for channel");
unsigned int broadcastIdCount = lastTimeChannels;
int chIndex = PVRFilmonData::UpdateChannel(channel.iUniqueId);
Expand Down Expand Up @@ -289,7 +289,7 @@ int PVRFilmonData::GetRecordingsAmount(void) {
}

PVR_ERROR PVRFilmonData::GetRecordings(ADDON_HANDLE handle) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "getting recordings from API");
m_recordings = filmonAPIgetRecordings();
for (std::vector<PVRFilmonRecording>::iterator it = m_recordings.begin();
Expand Down Expand Up @@ -328,7 +328,7 @@ PVR_ERROR PVRFilmonData::GetRecordings(ADDON_HANDLE handle) {
}

PVR_ERROR PVRFilmonData::DeleteRecording(const PVR_RECORDING &recording) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "deleting recording %s", recording.strRecordingId);
if (filmonAPIdeleteRecording((unsigned int)atoi(recording.strRecordingId))) {
PVR->TriggerRecordingUpdate();
Expand All @@ -345,7 +345,7 @@ int PVRFilmonData::GetTimersAmount(void) {

// Gets called every 5 minutes, same as Filmon session lifetime
PVR_ERROR PVRFilmonData::GetTimers(ADDON_HANDLE handle) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "getting timers from API");
if (filmonAPIkeepAlive()) { // Keeps session alive
m_timers = filmonAPIgetTimers();
Expand Down Expand Up @@ -387,7 +387,7 @@ PVR_ERROR PVRFilmonData::GetTimers(ADDON_HANDLE handle) {
}

PVR_ERROR PVRFilmonData::AddTimer(const PVR_TIMER &timer) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "adding timer");
if (filmonAPIaddTimer(timer.iClientChannelUid, timer.startTime,
timer.endTime)) {
Expand All @@ -400,7 +400,7 @@ PVR_ERROR PVRFilmonData::AddTimer(const PVR_TIMER &timer) {

PVR_ERROR PVRFilmonData::DeleteTimer(const PVR_TIMER &timer,
bool bForceDelete) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "deleting timer %d", timer.iClientIndex);
if (filmonAPIdeleteTimer(timer.iClientIndex, bForceDelete)) {
PVR->TriggerTimerUpdate();
Expand All @@ -411,7 +411,7 @@ PVR_ERROR PVRFilmonData::DeleteTimer(const PVR_TIMER &timer,
}

PVR_ERROR PVRFilmonData::UpdateTimer(const PVR_TIMER& timer) {
PLATFORM::CLockObject lock(m_mutex);
P8PLATFORM::CLockObject lock(m_mutex);
XBMC->Log(LOG_DEBUG, "updating timer");
if (filmonAPIdeleteTimer(timer.iClientIndex, true)
&& filmonAPIaddTimer(timer.iClientChannelUid, timer.startTime,
Expand Down
6 changes: 3 additions & 3 deletions src/PVRFilmonData.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/

#include <vector>
#include "platform/util/StdString.h"
#include "platform/threads/mutex.h"
#include "p8-platform/util/StdString.h"
#include "p8-platform/threads/mutex.h"
#include "client.h"
#include "kodi/libXBMC_pvr.h"
#include "FilmonAPI.h"
Expand Down Expand Up @@ -71,7 +71,7 @@ class PVRFilmonData {

private:
int UpdateChannel(unsigned int channelId);
PLATFORM::CMutex m_mutex;
P8PLATFORM::CMutex m_mutex;
std::vector<PVRFilmonChannelGroup> m_groups;
std::vector<PVRFilmonChannel> m_channels;
std::vector<PVRFilmonRecording> m_recordings;
Expand Down
2 changes: 1 addition & 1 deletion src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "client.h"

#include "platform/util/util.h"
#include "p8-platform/util/util.h"
#include "PVRFilmonData.h"
#include "kodi/xbmc_pvr_dll.h"
#include "kodi/libKODI_guilib.h"
Expand Down

0 comments on commit 2caaffb

Please sign in to comment.