Skip to content

Commit

Permalink
Merge pull request #36 from ksooo/pvr-api-5-0-0
Browse files Browse the repository at this point in the history
Implement PVR API 5.0.0
  • Loading branch information
ksooo committed Feb 16, 2016
2 parents 8327f88 + b9af112 commit 2aa58b2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 30 deletions.
7 changes: 3 additions & 4 deletions pvr.wmc/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.wmc"
version="1.0.2"
version="1.1.0"
name="PVR WMC Client"
provider-name="KrustyReturns and scarecrow420">
<requires>
<c-pluff version="0.1"/>
<import addon="xbmc.pvr" version="4.2.0"/>
<import addon="kodi.guilib" version="5.10.0"/>
<import addon="xbmc.pvr" version="5.0.0"/>
</requires>
<extension
point="xbmc.pvrclient"
Expand Down
5 changes: 4 additions & 1 deletion pvr.wmc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
1.0.2
1.1.0
- Updated to PVR addon API v5.0.0

1.0.2
- Updated to PVR API v4.2.0

1.0.1
Expand Down
24 changes: 3 additions & 21 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "client.h"
#include "kodi/xbmc_pvr_dll.h"
#include "kodi/libKODI_guilib.h"
#include "pvr2wmc.h"
#include "utilities.h"
#include "p8-platform/util/util.h"
Expand Down Expand Up @@ -67,7 +66,6 @@ CStdString g_AddonDataCustom = ""; // location of custom addondata settings

CHelper_libXBMC_addon *XBMC = NULL;
CHelper_libXBMC_pvr *PVR = NULL;
CHelper_libKODI_guilib *GUI = NULL;

#define LOCALHOST "127.0.0.1"

Expand Down Expand Up @@ -174,21 +172,11 @@ extern "C" {
return ADDON_STATUS_PERMANENT_FAILURE;
}

// register gui
GUI = new CHelper_libKODI_guilib;
if (!GUI->RegisterMe(hdl))
{
SAFE_DELETE(GUI);
SAFE_DELETE(XBMC);
return ADDON_STATUS_PERMANENT_FAILURE;
}

// register as pvr
PVR = new CHelper_libXBMC_pvr;
if (!PVR->RegisterMe(hdl))
{
SAFE_DELETE(PVR);
SAFE_DELETE(GUI);
SAFE_DELETE(XBMC);
return ADDON_STATUS_PERMANENT_FAILURE;
}
Expand All @@ -207,7 +195,6 @@ extern "C" {
{
SAFE_DELETE(_wmc);
SAFE_DELETE(PVR);
SAFE_DELETE(GUI);
SAFE_DELETE(XBMC);
_CurStatus = ADDON_STATUS_LOST_CONNECTION;
}
Expand Down Expand Up @@ -240,7 +227,6 @@ extern "C" {
if (_wmc)
_wmc->UnLoading();
SAFE_DELETE(PVR);
SAFE_DELETE(GUI);
_bCreated = false;
_CurStatus = ADDON_STATUS_UNKNOWN;
}
Expand Down Expand Up @@ -308,12 +294,12 @@ extern "C" {

const char* GetGUIAPIVersion(void)
{
return KODI_GUILIB_API_VERSION;
return ""; // GUI API not used
}

const char* GetMininumGUIAPIVersion(void)
{
return KODI_GUILIB_MIN_API_VERSION;
return ""; // GUI API not used
}

PVR_ERROR GetAddonCapabilities(PVR_ADDON_CAPABILITIES* pCapabilities)
Expand Down Expand Up @@ -377,11 +363,6 @@ extern "C" {
return PVR_ERROR_SERVER_ERROR;
}

int GetCurrentClientChannel(void)
{
return _currentChannel.iUniqueId;
}

PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties)
{
return PVR_ERROR_NOT_IMPLEMENTED;
Expand Down Expand Up @@ -726,5 +707,6 @@ extern "C" {
PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY[], int*) { return PVR_ERROR_NOT_IMPLEMENTED; };
PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; }
PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; }
PVR_ERROR SetEPGTimeFrame(int) { return PVR_ERROR_NOT_IMPLEMENTED; }

}
1 change: 0 additions & 1 deletion src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extern int g_signalThrottle;
extern bool g_bEnableMultiResume;
extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_pvr *PVR;
extern CHelper_libKODI_guilib *GUI;
extern CStdString g_strServerMAC;
extern bool g_bWakeOnLAN;
extern CStdString g_AddonDataCustom;
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

inline CStdString PVRWMC_GetClientVersion()
{
return "1.0.2"; // ALSO CHANGE IN REV NUMBER in 'pvr.wmc/addon.xml.in'
return "1.1.0"; // ALSO CHANGE IN REV NUMBER in 'pvr.wmc/addon.xml.in'
}
5 changes: 3 additions & 2 deletions src/pvr2wmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,9 @@ PVR_ERROR Pvr2Wmc::GetRecordings(ADDON_HANDLE handle)
xRec.iEpgEventId = atoi(v[18].c_str());
}

/* TODO: PVR API 5.0.0: Implement this */
xRec.iChannelUid = PVR_CHANNEL_INVALID_UID;

PVR->TransferRecordingEntry(handle, &xRec);
}

Expand Down Expand Up @@ -1673,8 +1676,6 @@ PVR_ERROR Pvr2Wmc::SignalStatus(PVR_SIGNAL_STATUS &signalStatus)
snprintf(cachedSignalStatus.strServiceName, sizeof(cachedSignalStatus.strServiceName), "%s", results[3].c_str());
snprintf(cachedSignalStatus.strMuxName, sizeof(cachedSignalStatus.strMuxName), "%s", results[4].c_str());
cachedSignalStatus.iSignal = (int)(atoi(results[5]) * 655.35);
cachedSignalStatus.dVideoBitrate = atof(results[6]);
cachedSignalStatus.dAudioBitrate = atof(results[7]);

bool error = atoi(results[8]) == 1;
if (error)
Expand Down

0 comments on commit 2aa58b2

Please sign in to comment.