Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
PVR.h
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../c-api/addon-instance/pvr.h"
12#include "pvr/ChannelGroups.h"
13#include "pvr/Channels.h"
14#include "pvr/EDL.h"
15#include "pvr/EPG.h"
16#include "pvr/General.h"
17#include "pvr/MenuHook.h"
18#include "pvr/Providers.h"
19#include "pvr/Recordings.h"
20#include "pvr/Stream.h"
21#include "pvr/Timers.h"
22
23#ifdef __cplusplus
24
49namespace kodi
50{
51namespace addon
52{
53
54//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
55// "C++" Doxygen group set for the definitions
56//{{{
57
58//==============================================================================
68
69//##############################################################################
84//##############################################################################
97//------------------------------------------------------------------------------
99
100//##############################################################################
116//------------------------------------------------------------------------------
117
118//##############################################################################
125//------------------------------------------------------------------------------
126
127//##############################################################################
136//------------------------------------------------------------------------------
137
138//##############################################################################
145//------------------------------------------------------------------------------
146
147//##############################################################################
154//------------------------------------------------------------------------------
155
156//##############################################################################
162//------------------------------------------------------------------------------
163
164//##############################################################################
170//------------------------------------------------------------------------------
171
172//##############################################################################
180//------------------------------------------------------------------------------
181
182//##############################################################################
195//------------------------------------------------------------------------------
196
197//}}}
198//______________________________________________________________________________
199
200//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
201// "C++" PVR addon instance class
202//{{{
203
204//==============================================================================
403class ATTR_DLL_LOCAL CInstancePVRClient : public IAddonInstance
404{
405public:
406 //============================================================================
428
429 //============================================================================
461 CInstancePVRClient() : IAddonInstance(IInstanceInfo(CPrivateBase::m_interface->firstKodiInstance))
462 {
463 if (CPrivateBase::m_interface->globalSingleInstance != nullptr)
464 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of more as one in single "
465 "instance way is not allowed!");
466
467 SetAddonStruct(CPrivateBase::m_interface->firstKodiInstance);
468 CPrivateBase::m_interface->globalSingleInstance = this;
469 }
470 //----------------------------------------------------------------------------
471
472 //============================================================================
505 explicit CInstancePVRClient(const IInstanceInfo& instance) : IAddonInstance(instance)
506 {
507 if (CPrivateBase::m_interface->globalSingleInstance != nullptr)
508 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of multiple together with "
509 "single instance way is not allowed!");
510
511 SetAddonStruct(instance);
512 }
513 //----------------------------------------------------------------------------
514
515 //============================================================================
518 ~CInstancePVRClient() override = default;
519 //----------------------------------------------------------------------------
520
521 //--==----==----==----==----==----==----==----==----==----==----==----==----==
522
523 //============================================================================
555 //----------------------------------------------------------------------------
556
557 //============================================================================
579 virtual PVR_ERROR GetBackendName(std::string& name) = 0;
580 //----------------------------------------------------------------------------
581
582 //============================================================================
606 virtual PVR_ERROR GetBackendVersion(std::string& version) = 0;
607 //----------------------------------------------------------------------------
608
609 //============================================================================
616 virtual PVR_ERROR GetBackendHostname(std::string& hostname) { return PVR_ERROR_NOT_IMPLEMENTED; }
617 //----------------------------------------------------------------------------
618
619 //============================================================================
627 virtual PVR_ERROR GetConnectionString(std::string& connection)
628 {
630 }
631 //----------------------------------------------------------------------------
632
633 //============================================================================
654 virtual PVR_ERROR GetDriveSpace(uint64_t& total, uint64_t& used)
655 {
657 }
658 //----------------------------------------------------------------------------
659
660 //============================================================================
691 //----------------------------------------------------------------------------
692
693 //==========================================================================
742 inline void AddMenuHook(const kodi::addon::PVRMenuhook& hook)
743 {
744 m_instanceData->toKodi->AddMenuHook(m_instanceData->toKodi->kodiInstance, hook);
745 }
746 //----------------------------------------------------------------------------
747
748 //==========================================================================
776 inline void ConnectionStateChange(const std::string& connectionString,
777 PVR_CONNECTION_STATE newState,
778 const std::string& message)
779 {
780 m_instanceData->toKodi->ConnectionStateChange(
781 m_instanceData->toKodi->kodiInstance, connectionString.c_str(), newState, message.c_str());
782 }
783 //----------------------------------------------------------------------------
784
785 //==========================================================================
795 inline std::string UserPath() const { return m_instanceData->props->strUserPath; }
796 //----------------------------------------------------------------------------
797
798 //==========================================================================
808 inline std::string ClientPath() const { return m_instanceData->props->strClientPath; }
809 //----------------------------------------------------------------------------
810
812 //--==----==----==----==----==----==----==----==----==----==----==----==----==
813
814 //============================================================================
838
839 //============================================================================
849 //----------------------------------------------------------------------------
850
851 //============================================================================
892 //----------------------------------------------------------------------------
893
894 //============================================================================
901 {
902 m_instanceData->toKodi->TriggerProvidersUpdate(m_instanceData->toKodi->kodiInstance);
903 }
904 //----------------------------------------------------------------------------
905
906 //============================================================================
915 //----------------------------------------------------------------------------
916
917 //============================================================================
964 {
966 }
967 //----------------------------------------------------------------------------
968
969 //============================================================================
1010 const kodi::addon::PVRChannel& channel,
1011 PVR_SOURCE source,
1012 std::vector<kodi::addon::PVRStreamProperty>& properties)
1013 {
1015 }
1016 //----------------------------------------------------------------------------
1017
1018 //============================================================================
1059 virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus& signalStatus)
1060 {
1062 }
1063 //----------------------------------------------------------------------------
1064
1065 //============================================================================
1079 virtual PVR_ERROR GetDescrambleInfo(int channelUid,
1080 kodi::addon::PVRDescrambleInfo& descrambleInfo)
1081 {
1083 }
1084 //----------------------------------------------------------------------------
1085
1086 //============================================================================
1093 {
1094 m_instanceData->toKodi->TriggerChannelUpdate(m_instanceData->toKodi->kodiInstance);
1095 }
1096 //----------------------------------------------------------------------------
1097
1099 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1100
1101 //============================================================================
1120
1121 //============================================================================
1130 //----------------------------------------------------------------------------
1131
1132 //============================================================================
1178 {
1180 }
1181 //----------------------------------------------------------------------------
1182
1183 //============================================================================
1245 //----------------------------------------------------------------------------
1246
1247 //============================================================================
1254 {
1255 m_instanceData->toKodi->TriggerChannelGroupsUpdate(m_instanceData->toKodi->kodiInstance);
1256 }
1257 //----------------------------------------------------------------------------
1258
1260 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1261
1262 //============================================================================
1281
1282 //============================================================================
1291 {
1293 }
1294 //----------------------------------------------------------------------------
1295
1296 //==========================================================================
1313 {
1315 }
1316 //----------------------------------------------------------------------------
1317
1318 //==========================================================================
1331 //----------------------------------------------------------------------------
1332
1333 //==========================================================================
1343 {
1345 }
1346 //----------------------------------------------------------------------------
1347
1348 //==========================================================================
1357 //----------------------------------------------------------------------------
1358
1359 //==========================================================================
1374 const kodi::addon::PVRChannel& item)
1375 {
1377 }
1378 //----------------------------------------------------------------------------
1379
1381 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1382
1383 //============================================================================
1406
1407 //============================================================================
1456 virtual PVR_ERROR GetEPGForChannel(int channelUid,
1457 time_t start,
1458 time_t end,
1460 {
1462 }
1463 //----------------------------------------------------------------------------
1464
1465 //============================================================================
1474 virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable)
1475 {
1477 }
1478 //----------------------------------------------------------------------------
1479
1480 //============================================================================
1489 virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag& tag, bool& isPlayable)
1490 {
1492 }
1493 //----------------------------------------------------------------------------
1494
1495 //============================================================================
1514 std::vector<kodi::addon::PVREDLEntry>& edl)
1515 {
1517 }
1518 //----------------------------------------------------------------------------
1519
1520 //============================================================================
1555 const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVRStreamProperty>& properties)
1556 {
1558 }
1559 //----------------------------------------------------------------------------
1560
1561 //============================================================================
1577 //----------------------------------------------------------------------------
1578
1579 //============================================================================
1594 virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays) { return PVR_ERROR_NOT_IMPLEMENTED; }
1595 //----------------------------------------------------------------------------
1596
1597 //==========================================================================
1612 const kodi::addon::PVREPGTag& tag)
1613 {
1615 }
1616 //----------------------------------------------------------------------------
1617
1618 //==========================================================================
1628 inline int EpgMaxPastDays() const { return m_instanceData->props->iEpgMaxPastDays; }
1629 //----------------------------------------------------------------------------
1630
1631 //==========================================================================
1641 inline int EpgMaxFutureDays() const { return m_instanceData->props->iEpgMaxFutureDays; }
1642 //----------------------------------------------------------------------------
1643
1644 //==========================================================================
1652 inline void TriggerEpgUpdate(unsigned int channelUid)
1653 {
1654 m_instanceData->toKodi->TriggerEpgUpdate(m_instanceData->toKodi->kodiInstance, channelUid);
1655 }
1656 //----------------------------------------------------------------------------
1657
1658 //==========================================================================
1691 {
1692 m_instanceData->toKodi->EpgEventStateChange(m_instanceData->toKodi->kodiInstance, tag,
1693 newState);
1694 }
1695 //----------------------------------------------------------------------------
1696
1698 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1699
1700 //============================================================================
1723
1724 //============================================================================
1735 virtual PVR_ERROR GetRecordingsAmount(bool deleted, int& amount)
1736 {
1738 }
1739 //----------------------------------------------------------------------------
1740
1741 //============================================================================
1783 {
1785 }
1786 //----------------------------------------------------------------------------
1787
1788 //============================================================================
1798 {
1800 }
1801 //----------------------------------------------------------------------------
1802
1803 //============================================================================
1813 {
1815 }
1816 //----------------------------------------------------------------------------
1817
1818 //============================================================================
1824 //----------------------------------------------------------------------------
1825
1826 //============================================================================
1837 {
1839 }
1840 //----------------------------------------------------------------------------
1841
1842 //============================================================================
1855 {
1857 }
1858 //----------------------------------------------------------------------------
1859
1860 //============================================================================
1872 virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording& recording, int count)
1873 {
1875 }
1876 //----------------------------------------------------------------------------
1877
1878 //============================================================================
1889 int lastplayedposition)
1890 {
1892 }
1893 //----------------------------------------------------------------------------
1894
1895 //============================================================================
1906 int& position)
1907 {
1909 }
1910 //----------------------------------------------------------------------------
1911
1912 //============================================================================
1927 std::vector<kodi::addon::PVREDLEntry>& edl)
1928 {
1930 }
1931 //----------------------------------------------------------------------------
1932
1933 //============================================================================
1943 virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording& recording, int64_t& size)
1944 {
1946 }
1947 //----------------------------------------------------------------------------
1948
1949 //============================================================================
1986 const kodi::addon::PVRRecording& recording,
1987 std::vector<kodi::addon::PVRStreamProperty>& properties)
1988 {
1990 }
1991 //----------------------------------------------------------------------------
1992
1993 //==========================================================================
2008 const kodi::addon::PVRRecording& item)
2009 {
2011 }
2012 //----------------------------------------------------------------------------
2013
2014 //============================================================================
2025 inline void RecordingNotification(const std::string& recordingName,
2026 const std::string& fileName,
2027 bool on)
2028 {
2029 m_instanceData->toKodi->RecordingNotification(m_instanceData->toKodi->kodiInstance,
2030 recordingName.c_str(), fileName.c_str(), on);
2031 }
2032 //----------------------------------------------------------------------------
2033
2034 //============================================================================
2041 {
2042 m_instanceData->toKodi->TriggerRecordingUpdate(m_instanceData->toKodi->kodiInstance);
2043 }
2044 //----------------------------------------------------------------------------
2045
2047 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2048
2049 //============================================================================
2071
2072 //============================================================================
2087 virtual PVR_ERROR GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
2088 {
2090 }
2091 //----------------------------------------------------------------------------
2092
2093 //============================================================================
2102 virtual PVR_ERROR GetTimersAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
2103 //----------------------------------------------------------------------------
2104
2105 //============================================================================
2146 //----------------------------------------------------------------------------
2147
2148 //============================================================================
2158 {
2160 }
2161 //----------------------------------------------------------------------------
2162
2163 //============================================================================
2174 virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer& timer, bool forceDelete)
2175 {
2177 }
2178 //----------------------------------------------------------------------------
2179
2180 //============================================================================
2190 {
2192 }
2193 //----------------------------------------------------------------------------
2194
2195 //============================================================================
2211 const kodi::addon::PVRTimer& item)
2212 {
2214 }
2215 //----------------------------------------------------------------------------
2216
2217 //============================================================================
2224 {
2225 m_instanceData->toKodi->TriggerTimerUpdate(m_instanceData->toKodi->kodiInstance);
2226 }
2227 //----------------------------------------------------------------------------
2228
2230 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2231
2232 //============================================================================
2249
2250 //============================================================================
2256 //----------------------------------------------------------------------------
2257
2258 //============================================================================
2264 //----------------------------------------------------------------------------
2265
2266 //============================================================================
2272 //----------------------------------------------------------------------------
2273
2274 //============================================================================
2280 //----------------------------------------------------------------------------
2281
2283 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2284
2285 //============================================================================
2297
2298 //============================================================================
2315
2316 //============================================================================
2334 virtual bool OpenLiveStream(const kodi::addon::PVRChannel& channel) { return false; }
2335 //----------------------------------------------------------------------------
2336
2337 //============================================================================
2343 virtual void CloseLiveStream() {}
2344 //----------------------------------------------------------------------------
2345
2346 //============================================================================
2356 virtual int ReadLiveStream(unsigned char* buffer, unsigned int size) { return 0; }
2357 //----------------------------------------------------------------------------
2358
2359 //============================================================================
2376 virtual int64_t SeekLiveStream(int64_t position, int whence) { return 0; }
2377 //----------------------------------------------------------------------------
2378
2379 //============================================================================
2387 virtual int64_t LengthLiveStream() { return 0; }
2388 //----------------------------------------------------------------------------
2389
2390 //============================================================================
2410
2411 //============================================================================
2419 virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
2420 {
2422 }
2423 //----------------------------------------------------------------------------
2424
2425 //============================================================================
2434 //----------------------------------------------------------------------------
2435
2436 //============================================================================
2450 virtual DEMUX_PACKET* DemuxRead() { return nullptr; }
2451 //----------------------------------------------------------------------------
2452
2453 //============================================================================
2458 virtual void DemuxReset() {}
2459 //----------------------------------------------------------------------------
2460
2461 //============================================================================
2466 virtual void DemuxAbort() {}
2467 //----------------------------------------------------------------------------
2468
2469 //============================================================================
2475 virtual void DemuxFlush() {}
2476 //----------------------------------------------------------------------------
2477
2478 //============================================================================
2486 virtual void SetSpeed(int speed) {}
2487 //----------------------------------------------------------------------------
2488
2489 //============================================================================
2496 virtual void FillBuffer(bool mode) {}
2497 //----------------------------------------------------------------------------
2498
2499 //============================================================================
2511 virtual bool SeekTime(double time, bool backwards, double& startpts) { return false; }
2512 //----------------------------------------------------------------------------
2513
2514 //============================================================================
2523 inline PVRCodec GetCodecByName(const std::string& codecName) const
2524 {
2525 return PVRCodec(m_instanceData->toKodi->GetCodecByName(m_instanceData->toKodi->kodiInstance,
2526 codecName.c_str()));
2527 }
2528 //----------------------------------------------------------------------------
2529
2530 //============================================================================
2539 inline DEMUX_PACKET* AllocateDemuxPacket(int iDataSize)
2540 {
2541 return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance,
2542 iDataSize);
2543 }
2544 //----------------------------------------------------------------------------
2545
2546 //============================================================================
2554 inline void FreeDemuxPacket(DEMUX_PACKET* pPacket)
2555 {
2556 m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket);
2557 }
2558 //----------------------------------------------------------------------------
2560
2562 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2563
2564 //============================================================================
2583
2584 //============================================================================
2595 virtual bool OpenRecordedStream(const kodi::addon::PVRRecording& recording, int64_t& streamId)
2596 {
2597 return false;
2598 }
2599 //----------------------------------------------------------------------------
2600
2601 //============================================================================
2610 virtual void CloseRecordedStream(int64_t streamId) {}
2611 //----------------------------------------------------------------------------
2612
2613 //============================================================================
2625 virtual int ReadRecordedStream(int64_t streamId, unsigned char* buffer, unsigned int size)
2626 {
2627 return 0;
2628 }
2629 //----------------------------------------------------------------------------
2630
2631 //============================================================================
2650 virtual int64_t SeekRecordedStream(int64_t streamId, int64_t position, int whence) { return 0; }
2651 //----------------------------------------------------------------------------
2652
2653 //============================================================================
2664 virtual int64_t LengthRecordedStream(int64_t streamId) { return 0; }
2665 //----------------------------------------------------------------------------
2666
2667 //============================================================================
2679 virtual PVR_ERROR IsRecordedStreamRealTime(int64_t streamId, bool& isRealTime)
2680 {
2682 }
2683 //----------------------------------------------------------------------------
2684
2685 //============================================================================
2699 virtual PVR_ERROR PauseRecordedStream(int64_t streamId, bool paused)
2700 {
2702 }
2703 //----------------------------------------------------------------------------
2704
2705 //============================================================================
2720 {
2722 }
2724 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2725
2726 //============================================================================
2744
2745 //============================================================================
2755 virtual bool CanPauseStream() { return false; }
2756 //----------------------------------------------------------------------------
2757
2758 //============================================================================
2769 virtual bool CanSeekStream() { return false; }
2770 //----------------------------------------------------------------------------
2771
2772 //============================================================================
2779 virtual void PauseStream(bool paused) {}
2780 //----------------------------------------------------------------------------
2781
2782 //============================================================================
2788 virtual bool IsRealTimeStream() { return false; }
2789 //----------------------------------------------------------------------------
2790
2791 //============================================================================
2802 //----------------------------------------------------------------------------
2803
2804 //============================================================================
2816 //----------------------------------------------------------------------------
2817
2819 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2820
2821private:
2822 void SetAddonStruct(KODI_ADDON_INSTANCE_STRUCT* instance)
2823 {
2824 instance->hdl = this;
2825
2826 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2827 instance->pvr->toAddon->GetCapabilities = ADDON_GetCapabilities;
2828 instance->pvr->toAddon->GetConnectionString = ADDON_GetConnectionString;
2829 instance->pvr->toAddon->GetBackendName = ADDON_GetBackendName;
2830 instance->pvr->toAddon->GetBackendVersion = ADDON_GetBackendVersion;
2831 instance->pvr->toAddon->GetBackendHostname = ADDON_GetBackendHostname;
2832 instance->pvr->toAddon->GetDriveSpace = ADDON_GetDriveSpace;
2833 instance->pvr->toAddon->CallSettingsMenuHook = ADDON_CallSettingsMenuHook;
2834 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2835 instance->pvr->toAddon->GetChannelsAmount = ADDON_GetChannelsAmount;
2836 instance->pvr->toAddon->GetChannels = ADDON_GetChannels;
2837 instance->pvr->toAddon->GetChannelStreamProperties = ADDON_GetChannelStreamProperties;
2838 instance->pvr->toAddon->GetSignalStatus = ADDON_GetSignalStatus;
2839 instance->pvr->toAddon->GetDescrambleInfo = ADDON_GetDescrambleInfo;
2840 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2841 instance->pvr->toAddon->GetProvidersAmount = ADDON_GetProvidersAmount;
2842 instance->pvr->toAddon->GetProviders = ADDON_GetProviders;
2843 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2844 instance->pvr->toAddon->GetChannelGroupsAmount = ADDON_GetChannelGroupsAmount;
2845 instance->pvr->toAddon->GetChannelGroups = ADDON_GetChannelGroups;
2846 instance->pvr->toAddon->GetChannelGroupMembers = ADDON_GetChannelGroupMembers;
2847 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2848 instance->pvr->toAddon->DeleteChannel = ADDON_DeleteChannel;
2849 instance->pvr->toAddon->RenameChannel = ADDON_RenameChannel;
2850 instance->pvr->toAddon->OpenDialogChannelSettings = ADDON_OpenDialogChannelSettings;
2851 instance->pvr->toAddon->OpenDialogChannelAdd = ADDON_OpenDialogChannelAdd;
2852 instance->pvr->toAddon->OpenDialogChannelScan = ADDON_OpenDialogChannelScan;
2853 instance->pvr->toAddon->CallChannelMenuHook = ADDON_CallChannelMenuHook;
2854 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2855 instance->pvr->toAddon->GetEPGForChannel = ADDON_GetEPGForChannel;
2856 instance->pvr->toAddon->IsEPGTagRecordable = ADDON_IsEPGTagRecordable;
2857 instance->pvr->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable;
2858 instance->pvr->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl;
2859 instance->pvr->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties;
2860 instance->pvr->toAddon->SetEPGMaxPastDays = ADDON_SetEPGMaxPastDays;
2861 instance->pvr->toAddon->SetEPGMaxFutureDays = ADDON_SetEPGMaxFutureDays;
2862 instance->pvr->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook;
2863 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2864 instance->pvr->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount;
2865 instance->pvr->toAddon->GetRecordings = ADDON_GetRecordings;
2866 instance->pvr->toAddon->DeleteRecording = ADDON_DeleteRecording;
2867 instance->pvr->toAddon->UndeleteRecording = ADDON_UndeleteRecording;
2868 instance->pvr->toAddon->DeleteAllRecordingsFromTrash = ADDON_DeleteAllRecordingsFromTrash;
2869 instance->pvr->toAddon->RenameRecording = ADDON_RenameRecording;
2870 instance->pvr->toAddon->SetRecordingLifetime = ADDON_SetRecordingLifetime;
2871 instance->pvr->toAddon->SetRecordingPlayCount = ADDON_SetRecordingPlayCount;
2872 instance->pvr->toAddon->SetRecordingLastPlayedPosition = ADDON_SetRecordingLastPlayedPosition;
2873 instance->pvr->toAddon->GetRecordingLastPlayedPosition = ADDON_GetRecordingLastPlayedPosition;
2874 instance->pvr->toAddon->GetRecordingEdl = ADDON_GetRecordingEdl;
2875 instance->pvr->toAddon->GetRecordingSize = ADDON_GetRecordingSize;
2876 instance->pvr->toAddon->GetRecordingStreamProperties = ADDON_GetRecordingStreamProperties;
2877 instance->pvr->toAddon->CallRecordingMenuHook = ADDON_CallRecordingMenuHook;
2878 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2879 instance->pvr->toAddon->GetTimerTypes = ADDON_GetTimerTypes;
2880 instance->pvr->toAddon->GetTimersAmount = ADDON_GetTimersAmount;
2881 instance->pvr->toAddon->GetTimers = ADDON_GetTimers;
2882 instance->pvr->toAddon->AddTimer = ADDON_AddTimer;
2883 instance->pvr->toAddon->DeleteTimer = ADDON_DeleteTimer;
2884 instance->pvr->toAddon->UpdateTimer = ADDON_UpdateTimer;
2885 instance->pvr->toAddon->CallTimerMenuHook = ADDON_CallTimerMenuHook;
2886 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2887 instance->pvr->toAddon->OnSystemSleep = ADDON_OnSystemSleep;
2888 instance->pvr->toAddon->OnSystemWake = ADDON_OnSystemWake;
2889 instance->pvr->toAddon->OnPowerSavingActivated = ADDON_OnPowerSavingActivated;
2890 instance->pvr->toAddon->OnPowerSavingDeactivated = ADDON_OnPowerSavingDeactivated;
2891 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2892 instance->pvr->toAddon->OpenLiveStream = ADDON_OpenLiveStream;
2893 instance->pvr->toAddon->CloseLiveStream = ADDON_CloseLiveStream;
2894 instance->pvr->toAddon->ReadLiveStream = ADDON_ReadLiveStream;
2895 instance->pvr->toAddon->SeekLiveStream = ADDON_SeekLiveStream;
2896 instance->pvr->toAddon->LengthLiveStream = ADDON_LengthLiveStream;
2897 instance->pvr->toAddon->GetStreamProperties = ADDON_GetStreamProperties;
2898 instance->pvr->toAddon->StreamClosed = ADDON_StreamClosed;
2899 instance->pvr->toAddon->GetStreamReadChunkSize = ADDON_GetStreamReadChunkSize;
2900 instance->pvr->toAddon->IsRealTimeStream = ADDON_IsRealTimeStream;
2901 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2902 instance->pvr->toAddon->OpenRecordedStream = ADDON_OpenRecordedStream;
2903 instance->pvr->toAddon->CloseRecordedStream = ADDON_CloseRecordedStream;
2904 instance->pvr->toAddon->ReadRecordedStream = ADDON_ReadRecordedStream;
2905 instance->pvr->toAddon->SeekRecordedStream = ADDON_SeekRecordedStream;
2906 instance->pvr->toAddon->LengthRecordedStream = ADDON_LengthRecordedStream;
2907 instance->pvr->toAddon->IsRecordedStreamRealTime = ADDON_IsRecordedStreamRealTime;
2908 instance->pvr->toAddon->PauseRecordedStream = ADDON_PauseRecordedStream;
2909 instance->pvr->toAddon->GetRecordedStreamTimes = ADDON_GetRecordedStreamTimes;
2910 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2911 instance->pvr->toAddon->DemuxReset = ADDON_DemuxReset;
2912 instance->pvr->toAddon->DemuxAbort = ADDON_DemuxAbort;
2913 instance->pvr->toAddon->DemuxFlush = ADDON_DemuxFlush;
2914 instance->pvr->toAddon->DemuxRead = ADDON_DemuxRead;
2915 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2916 instance->pvr->toAddon->CanPauseStream = ADDON_CanPauseStream;
2917 instance->pvr->toAddon->PauseStream = ADDON_PauseStream;
2918 instance->pvr->toAddon->CanSeekStream = ADDON_CanSeekStream;
2919 instance->pvr->toAddon->SeekTime = ADDON_SeekTime;
2920 instance->pvr->toAddon->SetSpeed = ADDON_SetSpeed;
2921 instance->pvr->toAddon->FillBuffer = ADDON_FillBuffer;
2922 instance->pvr->toAddon->GetStreamTimes = ADDON_GetStreamTimes;
2923 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2924 instance->pvr->toAddon->FreeCapabilities = ADDON_FreeCapabilities;
2925 instance->pvr->toAddon->FreeTimerTypes = ADDON_FreeTimerTypes;
2926 instance->pvr->toAddon->FreeProperties = ADDON_FreeProperties;
2927 instance->pvr->toAddon->FreeDescrambleInfo = ADDON_FreeDescrambleInfo;
2928 instance->pvr->toAddon->FreeSignalStatus = ADDON_FreeSignalStatus;
2929 instance->pvr->toAddon->FreeEdlEntries = ADDON_FreeEdlEntries;
2930 instance->pvr->toAddon->FreeString = ADDON_FreeString;
2931
2932 m_instanceData = instance->pvr;
2933 m_instanceData->toAddon->addonInstance = this;
2934 }
2935
2936 inline static PVR_ERROR ADDON_GetCapabilities(const AddonInstance_PVR* instance,
2937 PVR_ADDON_CAPABILITIES* capabilities)
2938 {
2939 PVRCapabilities cppCapabilities(capabilities);
2940 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2941 ->GetCapabilities(cppCapabilities);
2942 }
2943
2944 inline static PVR_ERROR ADDON_FreeCapabilities(const AddonInstance_PVR* instance,
2945 PVR_ADDON_CAPABILITIES* capabilities)
2946 {
2947 PVRCapabilities::FreeResources(capabilities);
2948 return PVR_ERROR_NO_ERROR;
2949 }
2950
2951 inline static PVR_ERROR ADDON_GetBackendName(const AddonInstance_PVR* instance, char** str)
2952 {
2953 std::string backendName;
2954 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2955 ->GetBackendName(backendName);
2956 if (err == PVR_ERROR_NO_ERROR)
2957 *str = AllocAndCopyString(backendName.c_str());
2958 return err;
2959 }
2960
2961 inline static PVR_ERROR ADDON_GetBackendVersion(const AddonInstance_PVR* instance, char** str)
2962 {
2963 std::string backendVersion;
2964 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2965 ->GetBackendVersion(backendVersion);
2966 if (err == PVR_ERROR_NO_ERROR)
2967 *str = AllocAndCopyString(backendVersion.c_str());
2968 return err;
2969 }
2970
2971 inline static PVR_ERROR ADDON_GetBackendHostname(const AddonInstance_PVR* instance, char** str)
2972 {
2973 std::string backendHostname;
2974 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2975 ->GetBackendHostname(backendHostname);
2976 if (err == PVR_ERROR_NO_ERROR)
2977 *str = AllocAndCopyString(backendHostname.c_str());
2978 return err;
2979 }
2980
2981 inline static PVR_ERROR ADDON_GetConnectionString(const AddonInstance_PVR* instance, char** str)
2982 {
2983 std::string connectionString;
2984 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2985 ->GetConnectionString(connectionString);
2986 if (err == PVR_ERROR_NO_ERROR)
2987 *str = AllocAndCopyString(connectionString.c_str());
2988 return err;
2989 }
2990
2991 inline static PVR_ERROR ADDON_GetDriveSpace(const AddonInstance_PVR* instance,
2992 uint64_t* total,
2993 uint64_t* used)
2994 {
2995 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2996 ->GetDriveSpace(*total, *used);
2997 }
2998
2999 inline static PVR_ERROR ADDON_CallSettingsMenuHook(const AddonInstance_PVR* instance,
3000 const PVR_MENUHOOK* menuhook)
3001 {
3002 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3003 ->CallSettingsMenuHook(menuhook);
3004 }
3005
3006 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3007
3008 inline static PVR_ERROR ADDON_GetChannelsAmount(const AddonInstance_PVR* instance, int* amount)
3009 {
3010 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3011 ->GetChannelsAmount(*amount);
3012 }
3013
3014 inline static PVR_ERROR ADDON_GetChannels(const AddonInstance_PVR* instance,
3015 PVR_HANDLE handle,
3016 bool radio)
3017 {
3018 PVRChannelsResultSet result(instance, handle);
3019 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3020 ->GetChannels(radio, result);
3021 }
3022
3023 inline static PVR_ERROR ADDON_GetChannelStreamProperties(const AddonInstance_PVR* instance,
3024 const PVR_CHANNEL* channel,
3025 PVR_SOURCE source,
3026 PVR_NAMED_VALUE*** properties,
3027 unsigned int* propertiesCount)
3028 {
3029 *propertiesCount = 0;
3030 std::vector<PVRStreamProperty> propertiesList;
3031 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3032 ->GetChannelStreamProperties(channel, source, propertiesList);
3033 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3034 {
3035 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3036 *propertiesCount);
3037 }
3038 return error;
3039 }
3040
3041 inline static PVR_ERROR ADDON_GetSignalStatus(const AddonInstance_PVR* instance,
3042 int channelUid,
3043 PVR_SIGNAL_STATUS* signalStatus)
3044 {
3045 PVRSignalStatus cppSignalStatus(signalStatus);
3046 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3047 ->GetSignalStatus(channelUid, cppSignalStatus);
3048 }
3049
3050 inline static PVR_ERROR ADDON_FreeSignalStatus(const AddonInstance_PVR* instance,
3051 PVR_SIGNAL_STATUS* signalStatus)
3052 {
3053 PVRSignalStatus::FreeResources(signalStatus);
3054 return PVR_ERROR_NO_ERROR;
3055 }
3056
3057 inline static PVR_ERROR ADDON_GetDescrambleInfo(const AddonInstance_PVR* instance,
3058 int channelUid,
3059 PVR_DESCRAMBLE_INFO* descrambleInfo)
3060 {
3061 PVRDescrambleInfo cppDescrambleInfo(descrambleInfo);
3062 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3063 ->GetDescrambleInfo(channelUid, cppDescrambleInfo);
3064 }
3065
3066 inline static PVR_ERROR ADDON_FreeDescrambleInfo(const AddonInstance_PVR* instance,
3067 PVR_DESCRAMBLE_INFO* descrambleInfo)
3068 {
3069 PVRDescrambleInfo::FreeResources(descrambleInfo);
3070 return PVR_ERROR_NO_ERROR;
3071 }
3072
3073 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3074
3075 inline static PVR_ERROR ADDON_GetProvidersAmount(const AddonInstance_PVR* instance, int* amount)
3076 {
3077 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3078 ->GetProvidersAmount(*amount);
3079 }
3080
3081 inline static PVR_ERROR ADDON_GetProviders(const AddonInstance_PVR* instance, PVR_HANDLE handle)
3082 {
3083 PVRProvidersResultSet result(instance, handle);
3084 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetProviders(result);
3085 }
3086
3087 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3088
3089 inline static PVR_ERROR ADDON_GetChannelGroupsAmount(const AddonInstance_PVR* instance,
3090 int* amount)
3091 {
3092 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3093 ->GetChannelGroupsAmount(*amount);
3094 }
3095
3096 inline static PVR_ERROR ADDON_GetChannelGroups(const AddonInstance_PVR* instance,
3097 PVR_HANDLE handle,
3098 bool radio)
3099 {
3100 PVRChannelGroupsResultSet result(instance, handle);
3101 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3102 ->GetChannelGroups(radio, result);
3103 }
3104
3105 inline static PVR_ERROR ADDON_GetChannelGroupMembers(const AddonInstance_PVR* instance,
3106 PVR_HANDLE handle,
3107 const PVR_CHANNEL_GROUP* group)
3108 {
3109 PVRChannelGroupMembersResultSet result(instance, handle);
3110 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3111 ->GetChannelGroupMembers(group, result);
3112 }
3113
3114 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3115
3116 inline static PVR_ERROR ADDON_DeleteChannel(const AddonInstance_PVR* instance,
3117 const PVR_CHANNEL* channel)
3118 {
3119 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3120 ->DeleteChannel(channel);
3121 }
3122
3123 inline static PVR_ERROR ADDON_RenameChannel(const AddonInstance_PVR* instance,
3124 const PVR_CHANNEL* channel)
3125 {
3126 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3127 ->RenameChannel(channel);
3128 }
3129
3130 inline static PVR_ERROR ADDON_OpenDialogChannelSettings(const AddonInstance_PVR* instance,
3131 const PVR_CHANNEL* channel)
3132 {
3133 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3134 ->OpenDialogChannelSettings(channel);
3135 }
3136
3137 inline static PVR_ERROR ADDON_OpenDialogChannelAdd(const AddonInstance_PVR* instance,
3138 const PVR_CHANNEL* channel)
3139 {
3140 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3141 ->OpenDialogChannelAdd(channel);
3142 }
3143
3144 inline static PVR_ERROR ADDON_OpenDialogChannelScan(const AddonInstance_PVR* instance)
3145 {
3146 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3147 ->OpenDialogChannelScan();
3148 }
3149
3150 inline static PVR_ERROR ADDON_CallChannelMenuHook(const AddonInstance_PVR* instance,
3151 const PVR_MENUHOOK* menuhook,
3152 const PVR_CHANNEL* channel)
3153 {
3154 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3155 ->CallChannelMenuHook(menuhook, channel);
3156 }
3157
3158 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3159
3160 inline static PVR_ERROR ADDON_GetEPGForChannel(const AddonInstance_PVR* instance,
3161 PVR_HANDLE handle,
3162 int channelUid,
3163 time_t start,
3164 time_t end)
3165 {
3166 PVREPGTagsResultSet result(instance, handle);
3167 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3168 ->GetEPGForChannel(channelUid, start, end, result);
3169 }
3170
3171 inline static PVR_ERROR ADDON_IsEPGTagRecordable(const AddonInstance_PVR* instance,
3172 const EPG_TAG* tag,
3173 bool* isRecordable)
3174 {
3175 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3176 ->IsEPGTagRecordable(tag, *isRecordable);
3177 }
3178
3179 inline static PVR_ERROR ADDON_IsEPGTagPlayable(const AddonInstance_PVR* instance,
3180 const EPG_TAG* tag,
3181 bool* isPlayable)
3182 {
3183 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3184 ->IsEPGTagPlayable(tag, *isPlayable);
3185 }
3186
3187 inline static PVR_ERROR ADDON_GetEPGTagEdl(const AddonInstance_PVR* instance,
3188 const EPG_TAG* tag,
3189 PVR_EDL_ENTRY*** edls,
3190 unsigned int* size)
3191 {
3192 *size = 0;
3193 std::vector<PVREDLEntry> edlList;
3194 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3195 ->GetEPGTagEdl(tag, edlList);
3196 if (error == PVR_ERROR_NO_ERROR && !edlList.empty())
3197 {
3198 *edls = AllocAndCopyPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edlList, *size);
3199 }
3200 return error;
3201 }
3202
3203 inline static PVR_ERROR ADDON_GetEPGTagStreamProperties(const AddonInstance_PVR* instance,
3204 const EPG_TAG* tag,
3205 PVR_NAMED_VALUE*** properties,
3206 unsigned int* propertiesCount)
3207 {
3208 *propertiesCount = 0;
3209 std::vector<PVRStreamProperty> propertiesList;
3210 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3211 ->GetEPGTagStreamProperties(tag, propertiesList);
3212 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3213 {
3214 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3215 *propertiesCount);
3216 }
3217 return error;
3218 }
3219
3220 inline static PVR_ERROR ADDON_SetEPGMaxPastDays(const AddonInstance_PVR* instance, int pastDays)
3221 {
3222 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3223 ->SetEPGMaxPastDays(pastDays);
3224 }
3225
3226 inline static PVR_ERROR ADDON_SetEPGMaxFutureDays(const AddonInstance_PVR* instance,
3227 int futureDays)
3228 {
3229 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3230 ->SetEPGMaxFutureDays(futureDays);
3231 }
3232
3233 inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance,
3234 const PVR_MENUHOOK* menuhook,
3235 const EPG_TAG* tag)
3236 {
3237 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3238 ->CallEPGMenuHook(menuhook, tag);
3239 }
3240
3241 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3242
3243 inline static PVR_ERROR ADDON_GetRecordingsAmount(const AddonInstance_PVR* instance,
3244 bool deleted,
3245 int* amount)
3246 {
3247 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3248 ->GetRecordingsAmount(deleted, *amount);
3249 }
3250
3251 inline static PVR_ERROR ADDON_GetRecordings(const AddonInstance_PVR* instance,
3252 PVR_HANDLE handle,
3253 bool deleted)
3254 {
3255 PVRRecordingsResultSet result(instance, handle);
3256 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3257 ->GetRecordings(deleted, result);
3258 }
3259
3260 inline static PVR_ERROR ADDON_DeleteRecording(const AddonInstance_PVR* instance,
3261 const PVR_RECORDING* recording)
3262 {
3263 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3264 ->DeleteRecording(recording);
3265 }
3266
3267 inline static PVR_ERROR ADDON_UndeleteRecording(const AddonInstance_PVR* instance,
3268 const PVR_RECORDING* recording)
3269 {
3270 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3271 ->UndeleteRecording(recording);
3272 }
3273
3274 inline static PVR_ERROR ADDON_DeleteAllRecordingsFromTrash(const AddonInstance_PVR* instance)
3275 {
3276 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3277 ->DeleteAllRecordingsFromTrash();
3278 }
3279
3280 inline static PVR_ERROR ADDON_RenameRecording(const AddonInstance_PVR* instance,
3281 const PVR_RECORDING* recording)
3282 {
3283 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3284 ->RenameRecording(recording);
3285 }
3286
3287 inline static PVR_ERROR ADDON_SetRecordingLifetime(const AddonInstance_PVR* instance,
3288 const PVR_RECORDING* recording)
3289 {
3290 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3291 ->SetRecordingLifetime(recording);
3292 }
3293
3294 inline static PVR_ERROR ADDON_SetRecordingPlayCount(const AddonInstance_PVR* instance,
3295 const PVR_RECORDING* recording,
3296 int count)
3297 {
3298 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3299 ->SetRecordingPlayCount(recording, count);
3300 }
3301
3302 inline static PVR_ERROR ADDON_SetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3303 const PVR_RECORDING* recording,
3304 int lastplayedposition)
3305 {
3306 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3307 ->SetRecordingLastPlayedPosition(recording, lastplayedposition);
3308 }
3309
3310 inline static PVR_ERROR ADDON_GetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3311 const PVR_RECORDING* recording,
3312 int* position)
3313 {
3314 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3315 ->GetRecordingLastPlayedPosition(recording, *position);
3316 }
3317
3318 inline static PVR_ERROR ADDON_GetRecordingEdl(const AddonInstance_PVR* instance,
3319 const PVR_RECORDING* recording,
3320 PVR_EDL_ENTRY*** edls,
3321 unsigned int* size)
3322 {
3323 *size = 0;
3324 std::vector<PVREDLEntry> edlList;
3325 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3326 ->GetRecordingEdl(recording, edlList);
3327 if (error == PVR_ERROR_NO_ERROR && !edlList.empty())
3328 {
3329 *edls = AllocAndCopyPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edlList, *size);
3330 }
3331 return error;
3332 }
3333
3334 inline static PVR_ERROR ADDON_FreeEdlEntries(const AddonInstance_PVR* instance,
3335 PVR_EDL_ENTRY** edls,
3336 unsigned int size)
3337 {
3338 FreeStaticPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edls, size);
3339 return PVR_ERROR_NO_ERROR;
3340 }
3341
3342 inline static PVR_ERROR ADDON_GetRecordingSize(const AddonInstance_PVR* instance,
3343 const PVR_RECORDING* recording,
3344 int64_t* size)
3345 {
3346 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3347 ->GetRecordingSize(recording, *size);
3348 }
3349
3350 inline static PVR_ERROR ADDON_GetRecordingStreamProperties(const AddonInstance_PVR* instance,
3351 const PVR_RECORDING* recording,
3352 PVR_NAMED_VALUE*** properties,
3353 unsigned int* propertiesCount)
3354 {
3355 *propertiesCount = 0;
3356 std::vector<PVRStreamProperty> propertiesList;
3357 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3358 ->GetRecordingStreamProperties(recording, propertiesList);
3359 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3360 {
3361 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3362 *propertiesCount);
3363 }
3364 return error;
3365 }
3366
3367 inline static PVR_ERROR ADDON_FreeProperties(const AddonInstance_PVR* instance,
3368 PVR_NAMED_VALUE** properties,
3369 unsigned int propertiesCount)
3370 {
3371 FreeDynamicPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(properties, propertiesCount);
3372 return PVR_ERROR_NO_ERROR;
3373 }
3374
3375 inline static PVR_ERROR ADDON_CallRecordingMenuHook(const AddonInstance_PVR* instance,
3376 const PVR_MENUHOOK* menuhook,
3377 const PVR_RECORDING* recording)
3378 {
3379 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3380 ->CallRecordingMenuHook(menuhook, recording);
3381 }
3382
3383 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3384
3385 inline static PVR_ERROR ADDON_GetTimerTypes(const AddonInstance_PVR* instance,
3386 PVR_TIMER_TYPE*** types,
3387 unsigned int* typesCount)
3388 {
3389 *typesCount = 0;
3390 std::vector<PVRTimerType> timerTypes;
3391 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3392 ->GetTimerTypes(timerTypes);
3393 if (error == PVR_ERROR_NO_ERROR && !timerTypes.empty())
3394 {
3395 *types = AllocAndCopyPointerArray<PVRTimerType, PVR_TIMER_TYPE>(timerTypes, *typesCount);
3396 }
3397 return error;
3398 }
3399
3400 inline static PVR_ERROR ADDON_FreeTimerTypes(const AddonInstance_PVR* instance,
3401 PVR_TIMER_TYPE** types,
3402 unsigned int typesCount)
3403 {
3404 FreeDynamicPointerArray<PVRTimerType, PVR_TIMER_TYPE>(types, typesCount);
3405 return PVR_ERROR_NO_ERROR;
3406 }
3407
3408 inline static PVR_ERROR ADDON_GetTimersAmount(const AddonInstance_PVR* instance, int* amount)
3409 {
3410 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3411 ->GetTimersAmount(*amount);
3412 }
3413
3414 inline static PVR_ERROR ADDON_GetTimers(const AddonInstance_PVR* instance, PVR_HANDLE handle)
3415 {
3416 PVRTimersResultSet result(instance, handle);
3417 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetTimers(result);
3418 }
3419
3420 inline static PVR_ERROR ADDON_AddTimer(const AddonInstance_PVR* instance, const PVR_TIMER* timer)
3421 {
3422 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->AddTimer(timer);
3423 }
3424
3425 inline static PVR_ERROR ADDON_DeleteTimer(const AddonInstance_PVR* instance,
3426 const PVR_TIMER* timer,
3427 bool forceDelete)
3428 {
3429 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3430 ->DeleteTimer(timer, forceDelete);
3431 }
3432
3433 inline static PVR_ERROR ADDON_UpdateTimer(const AddonInstance_PVR* instance,
3434 const PVR_TIMER* timer)
3435 {
3436 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->UpdateTimer(timer);
3437 }
3438
3439 inline static PVR_ERROR ADDON_CallTimerMenuHook(const AddonInstance_PVR* instance,
3440 const PVR_MENUHOOK* menuhook,
3441 const PVR_TIMER* timer)
3442 {
3443 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3444 ->CallTimerMenuHook(menuhook, timer);
3445 }
3446
3447 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3448
3449 inline static PVR_ERROR ADDON_OnSystemSleep(const AddonInstance_PVR* instance)
3450 {
3451 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemSleep();
3452 }
3453
3454 inline static PVR_ERROR ADDON_OnSystemWake(const AddonInstance_PVR* instance)
3455 {
3456 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemWake();
3457 }
3458
3459 inline static PVR_ERROR ADDON_OnPowerSavingActivated(const AddonInstance_PVR* instance)
3460 {
3461 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3462 ->OnPowerSavingActivated();
3463 }
3464
3465 inline static PVR_ERROR ADDON_OnPowerSavingDeactivated(const AddonInstance_PVR* instance)
3466 {
3467 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3468 ->OnPowerSavingDeactivated();
3469 }
3470
3471 // obsolete parts below
3473
3474 inline static bool ADDON_OpenLiveStream(const AddonInstance_PVR* instance,
3475 const PVR_CHANNEL* channel)
3476 {
3477 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3478 ->OpenLiveStream(channel);
3479 }
3480
3481 inline static void ADDON_CloseLiveStream(const AddonInstance_PVR* instance)
3482 {
3483 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseLiveStream();
3484 }
3485
3486 inline static int ADDON_ReadLiveStream(const AddonInstance_PVR* instance,
3487 unsigned char* buffer,
3488 unsigned int size)
3489 {
3490 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3491 ->ReadLiveStream(buffer, size);
3492 }
3493
3494 inline static int64_t ADDON_SeekLiveStream(const AddonInstance_PVR* instance,
3495 int64_t position,
3496 int whence)
3497 {
3498 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3499 ->SeekLiveStream(position, whence);
3500 }
3501
3502 inline static int64_t ADDON_LengthLiveStream(const AddonInstance_PVR* instance)
3503 {
3504 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->LengthLiveStream();
3505 }
3506
3507 inline static PVR_ERROR ADDON_GetStreamProperties(const AddonInstance_PVR* instance,
3508 PVR_STREAM_PROPERTIES* properties)
3509 {
3510 properties->iStreamCount = 0;
3511 std::vector<PVRStreamProperties> cppProperties;
3512 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3513 ->GetStreamProperties(cppProperties);
3514 if (err == PVR_ERROR_NO_ERROR)
3515 {
3516 for (unsigned int i = 0; i < cppProperties.size(); ++i)
3517 {
3518 memcpy(&properties->stream[i],
3519 static_cast<PVR_STREAM_PROPERTIES::PVR_STREAM*>(cppProperties[i]),
3521 ++properties->iStreamCount;
3522
3523 if (properties->iStreamCount >= PVR_STREAM_MAX_STREAMS)
3524 {
3525 kodi::Log(
3527 "CInstancePVRClient::%s: Addon given with '%li' more allowed streams where '%i'",
3528 __func__, cppProperties.size(), PVR_STREAM_MAX_STREAMS);
3529 break;
3530 }
3531 }
3532 }
3533
3534 return err;
3535 }
3536
3537 inline static PVR_ERROR ADDON_StreamClosed(const AddonInstance_PVR* instance)
3538 {
3539 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->StreamClosed();
3540 }
3541
3542 inline static PVR_ERROR ADDON_GetStreamReadChunkSize(const AddonInstance_PVR* instance,
3543 int* chunksize)
3544 {
3545 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3546 ->GetStreamReadChunkSize(*chunksize);
3547 }
3548
3549 inline static bool ADDON_IsRealTimeStream(const AddonInstance_PVR* instance)
3550 {
3551 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->IsRealTimeStream();
3552 }
3553
3554 inline static bool ADDON_OpenRecordedStream(const AddonInstance_PVR* instance,
3555 const PVR_RECORDING* recording,
3556 int64_t* streamId)
3557 {
3558 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3559 ->OpenRecordedStream(recording, *streamId);
3560 }
3561
3562 inline static void ADDON_CloseRecordedStream(const AddonInstance_PVR* instance, int64_t streamId)
3563 {
3564 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3565 ->CloseRecordedStream(streamId);
3566 }
3567
3568 inline static int ADDON_ReadRecordedStream(const AddonInstance_PVR* instance,
3569 int64_t streamId,
3570 unsigned char* buffer,
3571 unsigned int size)
3572 {
3573 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3574 ->ReadRecordedStream(streamId, buffer, size);
3575 }
3576
3577 inline static int64_t ADDON_SeekRecordedStream(const AddonInstance_PVR* instance,
3578 int64_t streamId,
3579 int64_t position,
3580 int whence)
3581 {
3582 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3583 ->SeekRecordedStream(streamId, position, whence);
3584 }
3585
3586 inline static int64_t ADDON_LengthRecordedStream(const AddonInstance_PVR* instance,
3587 int64_t streamId)
3588 {
3589 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3590 ->LengthRecordedStream(streamId);
3591 }
3592
3593 inline static PVR_ERROR ADDON_IsRecordedStreamRealTime(const AddonInstance_PVR* instance,
3594 int64_t streamId,
3595 bool* isRealTime)
3596 {
3597 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3598 ->IsRecordedStreamRealTime(streamId, *isRealTime);
3599 }
3600
3601 inline static PVR_ERROR ADDON_PauseRecordedStream(const AddonInstance_PVR* instance,
3602 int64_t streamId,
3603 bool paused)
3604 {
3605 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3606 ->PauseRecordedStream(streamId, paused);
3607 }
3608
3609 inline static PVR_ERROR ADDON_GetRecordedStreamTimes(const AddonInstance_PVR* instance,
3610 int64_t streamId,
3611 PVR_STREAM_TIMES* times)
3612 {
3613 PVRStreamTimes cppTimes(times);
3614 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3615 ->GetRecordedStreamTimes(streamId, cppTimes);
3616 }
3617
3618 inline static void ADDON_DemuxReset(const AddonInstance_PVR* instance)
3619 {
3620 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxReset();
3621 }
3622
3623 inline static void ADDON_DemuxAbort(const AddonInstance_PVR* instance)
3624 {
3625 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxAbort();
3626 }
3627
3628 inline static void ADDON_DemuxFlush(const AddonInstance_PVR* instance)
3629 {
3630 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush();
3631 }
3632
3633 inline static DEMUX_PACKET* ADDON_DemuxRead(const AddonInstance_PVR* instance)
3634 {
3635 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead();
3636 }
3637
3638 inline static bool ADDON_CanPauseStream(const AddonInstance_PVR* instance)
3639 {
3640 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanPauseStream();
3641 }
3642
3643 inline static bool ADDON_CanSeekStream(const AddonInstance_PVR* instance)
3644 {
3645 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanSeekStream();
3646 }
3647
3648 inline static void ADDON_PauseStream(const AddonInstance_PVR* instance, bool bPaused)
3649 {
3650 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->PauseStream(bPaused);
3651 }
3652
3653 inline static bool ADDON_SeekTime(const AddonInstance_PVR* instance,
3654 double time,
3655 bool backwards,
3656 double* startpts)
3657 {
3658 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3659 ->SeekTime(time, backwards, *startpts);
3660 }
3661
3662 inline static void ADDON_SetSpeed(const AddonInstance_PVR* instance, int speed)
3663 {
3664 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->SetSpeed(speed);
3665 }
3666
3667 inline static void ADDON_FillBuffer(const AddonInstance_PVR* instance, bool mode)
3668 {
3669 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->FillBuffer(mode);
3670 }
3671
3672 inline static PVR_ERROR ADDON_GetStreamTimes(const AddonInstance_PVR* instance,
3673 PVR_STREAM_TIMES* times)
3674 {
3675 PVRStreamTimes cppTimes(times);
3676 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3677 ->GetStreamTimes(cppTimes);
3678 }
3679
3680 inline static PVR_ERROR ADDON_FreeString(const AddonInstance_PVR* instance, char* str)
3681 {
3682 FreeString(str);
3683 return PVR_ERROR_NO_ERROR;
3684 }
3686
3687 AddonInstance_PVR* m_instanceData = nullptr;
3688};
3689//}}}
3690//______________________________________________________________________________
3691
3692} /* namespace addon */
3693} /* namespace kodi */
3694
3695#endif /* __cplusplus */
Definition AddonBase.h:565
Definition AddonBase.h:498
Definition General.h:1077
Definition ChannelGroups.h:38
Definition ChannelGroups.h:259
Definition ChannelGroups.h:113
Definition Channels.h:39
Definition Channels.h:226
Definition Stream.h:39
Definition Channels.h:439
Definition EPG.h:40
Definition MenuHook.h:46
Definition Providers.h:189
Definition Recordings.h:39
Definition Recordings.h:654
Definition Channels.h:271
Definition Stream.h:262
Definition Timers.h:39
Definition Timers.h:544
@ ADDON_LOG_ERROR
3 : To report error messages in the log file.
Definition addon_base.h:193
Definition demux_packet.h:46
virtual PVR_ERROR GetBackendHostname(std::string &hostname)
Get the hostname of the pvr backend server.
Definition PVR.h:616
std::string ClientPath() const
Callback to Kodi Function Get main client path of the PVR addon.
Definition PVR.h:808
void AddMenuHook(const kodi::addon::PVRMenuhook &hook)
Callback to Kodi Function\nAdd or replace a menu hook for the context menu for this add-on
Definition PVR.h:742
virtual PVR_ERROR GetBackendVersion(std::string &version)=0
Get the version string reported by the backend that will be displayed in the UI.
~CInstancePVRClient() override=default
Destructor.
virtual PVR_ERROR CallSettingsMenuHook(const kodi::addon::PVRMenuhook &menuhook)
Call one of the settings related menu hooks (if supported).
Definition PVR.h:687
virtual PVR_ERROR GetConnectionString(std::string &connection)
To get the connection string reported by the backend that will be displayed in the UI.
Definition PVR.h:627
virtual PVR_ERROR GetDriveSpace(uint64_t &total, uint64_t &used)
Get the disk space reported by the backend (if supported).
Definition PVR.h:654
void ConnectionStateChange(const std::string &connectionString, PVR_CONNECTION_STATE newState, const std::string &message)
Callback to Kodi Function Notify a state change for a PVR backend connection.
Definition PVR.h:776
virtual PVR_ERROR GetCapabilities(kodi::addon::PVRCapabilities &capabilities)=0
Get the list of features that this add-on provides.
CInstancePVRClient(const IInstanceInfo &instance)
PVR client class constructor used to support multiple instance types.
Definition PVR.h:505
virtual PVR_ERROR GetBackendName(std::string &name)=0
Get the name reported by the backend that will be displayed in the UI.
std::string UserPath() const
Callback to Kodi Function Get user data path of the PVR addon.
Definition PVR.h:795
CInstancePVRClient()
PVR client class constructor.
Definition PVR.h:461
void TriggerProvidersUpdate()
Callback to Kodi Function Request Kodi to update it's list of providers.
Definition PVR.h:900
virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus &signalStatus)
Get the signal status of the stream that's currently open.
Definition PVR.h:1059
virtual PVR_ERROR GetDescrambleInfo(int channelUid, kodi::addon::PVRDescrambleInfo &descrambleInfo)
Get the descramble information of the stream that's currently open.
Definition PVR.h:1079
void TriggerChannelUpdate()
Callback to Kodi Function Request Kodi to update it's list of channels.
Definition PVR.h:1092
virtual PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet &results)
Request the list of all channels from the backend.
Definition PVR.h:963
virtual PVR_ERROR GetProviders(kodi::addon::PVRProvidersResultSet &results)
Request the list of all providers from the backend.
Definition PVR.h:888
virtual PVR_ERROR GetProvidersAmount(int &amount)
The total amount of providers on the backend.
Definition PVR.h:848
virtual PVR_ERROR GetChannelsAmount(int &amount)
The total amount of channels on the backend.
Definition PVR.h:914
virtual PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel &channel, PVR_SOURCE source, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for a channel from the backend.
Definition PVR.h:1009
PVR_CONNECTION_STATE
Definition pvr_general.h:83
PVR_ERROR
Definition pvr_general.h:36
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition pvr_general.h:44
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition pvr_general.h:38
PVR_SOURCE
Definition pvr_general.h:127
#define PVR_STREAM_MAX_STREAMS
Maximum of allowed streams.
Definition pvr_stream.h:30
EPG_EVENT_STATE
Definition pvr_epg.h:602
virtual PVR_ERROR GetEPGForChannel(int channelUid, time_t start, time_t end, kodi::addon::PVREPGTagsResultSet &results)
Request the EPG for a channel from the backend.
Definition PVR.h:1456
void TriggerEpgUpdate(unsigned int channelUid)
Callback to Kodi Function Schedule an EPG update for the given channel channel.
Definition PVR.h:1652
virtual PVR_ERROR SetEPGMaxPastDays(int pastDays)
Tell the client the past time frame to use when notifying epg events back to Kodi.
Definition PVR.h:1576
virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag &tag, bool &isPlayable)
Check if the given EPG tag can be played.
Definition PVR.h:1489
virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays)
Tell the client the future time frame to use when notifying epg events back to Kodi.
Definition PVR.h:1594
virtual PVR_ERROR GetEPGTagStreamProperties(const kodi::addon::PVREPGTag &tag, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for an epg tag from the backend.
Definition PVR.h:1554
int EpgMaxPastDays() const
Callback to Kodi Function Get the Max past days handled by Kodi.
Definition PVR.h:1628
virtual PVR_ERROR CallEPGMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVREPGTag &tag)
Call one of the EPG related menu hooks (if supported).
Definition PVR.h:1611
virtual PVR_ERROR GetEPGTagEdl(const kodi::addon::PVREPGTag &tag, std::vector< kodi::addon::PVREDLEntry > &edl)
Retrieve the edit decision list (EDL) of an EPG tag on the backend.
Definition PVR.h:1513
virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag &tag, bool &isRecordable)
Check if the given EPG tag can be recorded.
Definition PVR.h:1474
int EpgMaxFutureDays() const
Callback to Kodi Function Get the Max future days handled by Kodi.
Definition PVR.h:1641
void EpgEventStateChange(kodi::addon::PVREPGTag &tag, EPG_EVENT_STATE newState)
Callback to Kodi Function Notify a state change for an EPG event.
Definition PVR.h:1690
virtual PVR_ERROR OnPowerSavingDeactivated()
To notify addon power saving on system is deactivated.
Definition PVR.h:2279
virtual PVR_ERROR OnPowerSavingActivated()
To notify addon power saving on system is activated.
Definition PVR.h:2271
virtual PVR_ERROR OnSystemSleep()
To notify addon about system sleep.
Definition PVR.h:2255
virtual PVR_ERROR OnSystemWake()
To notify addon about system wake up.
Definition PVR.h:2263
virtual PVR_ERROR CallRecordingMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVRRecording &item)
Call one of the recording related menu hooks (if supported).
Definition PVR.h:2007
virtual PVR_ERROR GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet &results)
Request the list of all recordings from the backend, if supported.
Definition PVR.h:1782
virtual PVR_ERROR RenameRecording(const kodi::addon::PVRRecording &recording)
Rename a recording on the backend.
Definition PVR.h:1836
virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording &recording, int64_t &size)
Retrieve the size of a recording on the backend.
Definition PVR.h:1943
virtual PVR_ERROR SetRecordingLastPlayedPosition(const kodi::addon::PVRRecording &recording, int lastplayedposition)
Set the last watched position of a recording on the backend.
Definition PVR.h:1888
void RecordingNotification(const std::string &recordingName, const std::string &fileName, bool on)
Callback to Kodi Function Display a notification in Kodi that a recording started or stopped on the s...
Definition PVR.h:2025
virtual PVR_ERROR GetRecordingEdl(const kodi::addon::PVRRecording &recording, std::vector< kodi::addon::PVREDLEntry > &edl)
Retrieve the edit decision list (EDL) of a recording on the backend.
Definition PVR.h:1926
void TriggerRecordingUpdate()
Callback to Kodi Function Request Kodi to update it's list of recordings.
Definition PVR.h:2040
virtual PVR_ERROR GetRecordingStreamProperties(const kodi::addon::PVRRecording &recording, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for a recording from the backend.
Definition PVR.h:1985
virtual PVR_ERROR GetRecordingsAmount(bool deleted, int &amount)
To get amount of recording present on backend.
Definition PVR.h:1735
virtual PVR_ERROR SetRecordingLifetime(const kodi::addon::PVRRecording &recording)
Set the lifetime of a recording on the backend.
Definition PVR.h:1854
virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition PVR.h:1872
virtual PVR_ERROR UndeleteRecording(const kodi::addon::PVRRecording &recording)
Undelete a recording on the backend.
Definition PVR.h:1812
virtual PVR_ERROR GetRecordingLastPlayedPosition(const kodi::addon::PVRRecording &recording, int &position)
Retrieve the last watched position of a recording on the backend.
Definition PVR.h:1905
virtual PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition PVR.h:1823
virtual PVR_ERROR DeleteRecording(const kodi::addon::PVRRecording &recording)
Delete a recording on the backend.
Definition PVR.h:1797
virtual int64_t SeekRecordedStream(int64_t streamId, int64_t position, int whence)
Seek in a recorded stream.
Definition PVR.h:2650
virtual bool OpenRecordedStream(const kodi::addon::PVRRecording &recording, int64_t &streamId)
Open a stream to a recording on the backend.
Definition PVR.h:2595
virtual PVR_ERROR GetRecordedStreamTimes(int64_t streamId, kodi::addon::PVRStreamTimes &times)
Get stream times.
Definition PVR.h:2719
virtual void CloseRecordedStream(int64_t streamId)
Close an open stream from a recording.
Definition PVR.h:2610
virtual PVR_ERROR PauseRecordedStream(int64_t streamId, bool paused)
Notify the pvr addon that Kodi (un)paused the currently playing stream.
Definition PVR.h:2699
virtual int64_t LengthRecordedStream(int64_t streamId)
Obtain the length of a recorded stream.
Definition PVR.h:2664
virtual int ReadRecordedStream(int64_t streamId, unsigned char *buffer, unsigned int size)
Read from a recording.
Definition PVR.h:2625
virtual PVR_ERROR IsRecordedStreamRealTime(int64_t streamId, bool &isRealTime)
Check for real-time streaming.
Definition PVR.h:2679
virtual PVR_ERROR StreamClosed()
The currently playing stream has been closed.
Definition PVR.h:2433
virtual PVR_ERROR GetStreamProperties(std::vector< kodi::addon::PVRStreamProperties > &properties)
Get the stream properties of the stream that's currently being read.
Definition PVR.h:2419
virtual void DemuxReset()
Reset the demultiplexer in the add-on.
Definition PVR.h:2458
PVRCodec GetCodecByName(const std::string &codecName) const
Callback to Kodi Function Get the codec id used by Kodi.
Definition PVR.h:2523
DEMUX_PACKET * AllocateDemuxPacket(int iDataSize)
Callback to Kodi Function Allocate a demux packet. Free with FreeDemuxPacket().
Definition PVR.h:2539
void FreeDemuxPacket(DEMUX_PACKET *pPacket)
Callback to Kodi Function Free a packet that was allocated with AllocateDemuxPacket().
Definition PVR.h:2554
virtual DEMUX_PACKET * DemuxRead()
Read the next packet from the demultiplexer, if there is one.
Definition PVR.h:2450
virtual void DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition PVR.h:2466
virtual void DemuxFlush()
Flush all data that's currently in the demultiplexer buffer in the add-on.
Definition PVR.h:2475
virtual bool SeekTime(double time, bool backwards, double &startpts)
Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time.
Definition PVR.h:2511
virtual void SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition PVR.h:2486
virtual void FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition PVR.h:2496
virtual void CloseLiveStream()
Close an open live stream.
Definition PVR.h:2343
virtual bool OpenLiveStream(const kodi::addon::PVRChannel &channel)
Open a live stream on the backend.
Definition PVR.h:2334
virtual int64_t SeekLiveStream(int64_t position, int whence)
Seek in a live stream on a backend that supports timeshifting.
Definition PVR.h:2376
virtual int ReadLiveStream(unsigned char *buffer, unsigned int size)
Read from an open live stream.
Definition PVR.h:2356
virtual int64_t LengthLiveStream()
Obtain the length of a live stream.
Definition PVR.h:2387
virtual PVR_ERROR GetStreamTimes(kodi::addon::PVRStreamTimes &times)
Get stream times.
Definition PVR.h:2798
virtual bool CanPauseStream()
Check if the backend support pausing the currently playing stream.
Definition PVR.h:2755
virtual bool IsRealTimeStream()
Check for real-time streaming.
Definition PVR.h:2788
virtual void PauseStream(bool paused)
Notify the pvr addon that Kodi (un)paused the currently playing stream.
Definition PVR.h:2779
virtual PVR_ERROR GetStreamReadChunkSize(int &chunksize)
Obtain the chunk size to use when reading streams.
Definition PVR.h:2815
virtual bool CanSeekStream()
Check if the backend supports seeking for the currently playing stream.
Definition PVR.h:2769
void TriggerTimerUpdate()
Callback to Kodi Function Request Kodi to update it's list of timers.
Definition PVR.h:2223
virtual PVR_ERROR UpdateTimer(const kodi::addon::PVRTimer &timer)
Update the timer information on the backend.
Definition PVR.h:2189
virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer &timer, bool forceDelete)
Delete a timer on the backend.
Definition PVR.h:2174
virtual PVR_ERROR CallTimerMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVRTimer &item)
Call one of the timer related menu hooks (if supported).
Definition PVR.h:2210
virtual PVR_ERROR AddTimer(const kodi::addon::PVRTimer &timer)
Add a timer on the backend.
Definition PVR.h:2157
virtual PVR_ERROR GetTimers(kodi::addon::PVRTimersResultSet &results)
Request the list of all timers from the backend if supported.
Definition PVR.h:2142
virtual PVR_ERROR GetTimersAmount(int &amount)
To get total amount of timers on the backend or -1 on error.
Definition PVR.h:2102
virtual PVR_ERROR GetTimerTypes(std::vector< kodi::addon::PVRTimerType > &types)
Retrieve the timer types supported by the backend.
Definition PVR.h:2087
virtual PVR_ERROR OpenDialogChannelAdd(const kodi::addon::PVRChannel &channel)
Show the dialog to add a channel on the backend, if supported by the backend.
Definition PVR.h:1342
virtual PVR_ERROR RenameChannel(const kodi::addon::PVRChannel &channel)
Rename a channel on the backend.
Definition PVR.h:1312
virtual PVR_ERROR OpenDialogChannelScan()
Show the channel scan dialog if this backend supports it.
Definition PVR.h:1356
virtual PVR_ERROR OpenDialogChannelSettings(const kodi::addon::PVRChannel &channel)
Show the channel settings dialog, if supported by the backend.
Definition PVR.h:1327
virtual PVR_ERROR DeleteChannel(const kodi::addon::PVRChannel &channel)
Delete a channel from the backend.
Definition PVR.h:1290
virtual PVR_ERROR CallChannelMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVRChannel &item)
Call one of the channel related menu hooks (if supported).
Definition PVR.h:1373
virtual PVR_ERROR GetChannelGroupMembers(const kodi::addon::PVRChannelGroup &group, kodi::addon::PVRChannelGroupMembersResultSet &results)
Get a list of members on a group.
Definition PVR.h:1240
virtual PVR_ERROR GetChannelGroupsAmount(int &amount)
Get the total amount of channel groups on the backend if it supports channel groups.
Definition PVR.h:1129
void TriggerChannelGroupsUpdate()
Callback to Kodi Function Request Kodi to update it's list of channel groups.
Definition PVR.h:1253
virtual PVR_ERROR GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet &results)
Get a list of available channel groups on addon.
Definition PVR.h:1177
void ATTR_DLL_LOCAL Log(const ADDON_LOG loglevel, const char *format,...)
Add a message to Kodi's log.
Definition AddonBase.h:1938
Definition pvr.h:362
"C" PVR add-on channel group member.
Definition pvr_epg.h:623
Definition addon_base.h:268
"C" PVR add-on capabilities.
Definition pvr_general.h:350
"C" PVR add-on channel group.
Definition pvr_channel_groups.h:31
"C" PVR add-on channel.
Definition pvr_channels.h:41
"C" PVR add-on descramble information.
Definition pvr_channels.h:92
"C" Edit definition list entry.
Definition pvr_edl.h:55
"C" PVR add-on menu hook.
Definition pvr_menu_hook.h:65
"C" Representation of a named value.
Definition pvr_defines.h:44
"C" PVR add-on recording.
Definition pvr_recordings.h:111
"C" PVR add-on signal status information.
Definition pvr_channels.h:64
"C" Stream properties
Definition pvr_stream.h:115
Definition pvr_stream.h:118
"C" Times of playing stream (Live TV and recordings)
Definition pvr_stream.h:145
"C" PVR add-on timer type.
Definition pvr_timers.h:379
"C" PVR add-on timer event.
Definition pvr_timers.h:338
Internal used structure to have stored C API data above and available for everything below.
Definition AddonBase.h:73