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//==============================================================================
405class ATTR_DLL_LOCAL CInstancePVRClient : public IAddonInstance
406{
407public:
408 //============================================================================
430
431 //============================================================================
463 CInstancePVRClient() : IAddonInstance(IInstanceInfo(CPrivateBase::m_interface->firstKodiInstance))
464 {
465 if (CPrivateBase::m_interface->globalSingleInstance != nullptr)
466 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of more as one in single "
467 "instance way is not allowed!");
468
469 SetAddonStruct(CPrivateBase::m_interface->firstKodiInstance);
470 CPrivateBase::m_interface->globalSingleInstance = this;
471 }
472 //----------------------------------------------------------------------------
473
474 //============================================================================
507 explicit CInstancePVRClient(const IInstanceInfo& instance) : IAddonInstance(instance)
508 {
509 if (CPrivateBase::m_interface->globalSingleInstance != nullptr)
510 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of multiple together with "
511 "single instance way is not allowed!");
512
513 SetAddonStruct(instance);
514 }
515 //----------------------------------------------------------------------------
516
517 //============================================================================
520 ~CInstancePVRClient() override = default;
521 //----------------------------------------------------------------------------
522
523 //--==----==----==----==----==----==----==----==----==----==----==----==----==
524
525 //============================================================================
557 //----------------------------------------------------------------------------
558
559 //============================================================================
581 virtual PVR_ERROR GetBackendName(std::string& name) = 0;
582 //----------------------------------------------------------------------------
583
584 //============================================================================
608 virtual PVR_ERROR GetBackendVersion(std::string& version) = 0;
609 //----------------------------------------------------------------------------
610
611 //============================================================================
618 virtual PVR_ERROR GetBackendHostname(std::string& hostname) { return PVR_ERROR_NOT_IMPLEMENTED; }
619 //----------------------------------------------------------------------------
620
621 //============================================================================
629 virtual PVR_ERROR GetConnectionString(std::string& connection)
630 {
632 }
633 //----------------------------------------------------------------------------
634
635 //============================================================================
656 virtual PVR_ERROR GetDriveSpace(uint64_t& total, uint64_t& used)
657 {
659 }
660 //----------------------------------------------------------------------------
661
662 //============================================================================
693 //----------------------------------------------------------------------------
694
695 //==========================================================================
744 inline void AddMenuHook(const kodi::addon::PVRMenuhook& hook)
745 {
746 m_instanceData->toKodi->AddMenuHook(m_instanceData->toKodi->kodiInstance, hook);
747 }
748 //----------------------------------------------------------------------------
749
750 //==========================================================================
778 inline void ConnectionStateChange(const std::string& connectionString,
779 PVR_CONNECTION_STATE newState,
780 const std::string& message)
781 {
782 m_instanceData->toKodi->ConnectionStateChange(
783 m_instanceData->toKodi->kodiInstance, connectionString.c_str(), newState, message.c_str());
784 }
785 //----------------------------------------------------------------------------
786
787 //==========================================================================
797 inline std::string UserPath() const { return m_instanceData->props->strUserPath; }
798 //----------------------------------------------------------------------------
799
800 //==========================================================================
810 inline std::string ClientPath() const { return m_instanceData->props->strClientPath; }
811 //----------------------------------------------------------------------------
812
814 //--==----==----==----==----==----==----==----==----==----==----==----==----==
815
816 //============================================================================
840
841 //============================================================================
851 //----------------------------------------------------------------------------
852
853 //============================================================================
894 //----------------------------------------------------------------------------
895
896 //============================================================================
903 {
904 m_instanceData->toKodi->TriggerProvidersUpdate(m_instanceData->toKodi->kodiInstance);
905 }
906 //----------------------------------------------------------------------------
907
908 //============================================================================
917 //----------------------------------------------------------------------------
918
919 //============================================================================
966 {
968 }
969 //----------------------------------------------------------------------------
970
971 //============================================================================
1012 const kodi::addon::PVRChannel& channel,
1013 PVR_SOURCE source,
1014 std::vector<kodi::addon::PVRStreamProperty>& properties)
1015 {
1017 }
1018 //----------------------------------------------------------------------------
1019
1020 //============================================================================
1062 virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus& signalStatus)
1063 {
1065 }
1066 //----------------------------------------------------------------------------
1067
1068 //============================================================================
1082 virtual PVR_ERROR GetDescrambleInfo(int channelUid,
1083 kodi::addon::PVRDescrambleInfo& descrambleInfo)
1084 {
1086 }
1087 //----------------------------------------------------------------------------
1088
1089 //============================================================================
1096 {
1097 m_instanceData->toKodi->TriggerChannelUpdate(m_instanceData->toKodi->kodiInstance);
1098 }
1099 //----------------------------------------------------------------------------
1100
1102 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1103
1104 //============================================================================
1123
1124 //============================================================================
1133 //----------------------------------------------------------------------------
1134
1135 //============================================================================
1181 {
1183 }
1184 //----------------------------------------------------------------------------
1185
1186 //============================================================================
1248 //----------------------------------------------------------------------------
1249
1250 //============================================================================
1257 {
1258 m_instanceData->toKodi->TriggerChannelGroupsUpdate(m_instanceData->toKodi->kodiInstance);
1259 }
1260 //----------------------------------------------------------------------------
1261
1263 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1264
1265 //============================================================================
1284
1285 //============================================================================
1294 {
1296 }
1297 //----------------------------------------------------------------------------
1298
1299 //==========================================================================
1316 {
1318 }
1319 //----------------------------------------------------------------------------
1320
1321 //==========================================================================
1334 //----------------------------------------------------------------------------
1335
1336 //==========================================================================
1346 {
1348 }
1349 //----------------------------------------------------------------------------
1350
1351 //==========================================================================
1360 //----------------------------------------------------------------------------
1361
1362 //==========================================================================
1377 const kodi::addon::PVRChannel& item)
1378 {
1380 }
1381 //----------------------------------------------------------------------------
1382
1384 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1385
1386 //============================================================================
1409
1410 //============================================================================
1459 virtual PVR_ERROR GetEPGForChannel(int channelUid,
1460 time_t start,
1461 time_t end,
1463 {
1465 }
1466 //----------------------------------------------------------------------------
1467
1468 //============================================================================
1477 virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable)
1478 {
1480 }
1481 //----------------------------------------------------------------------------
1482
1483 //============================================================================
1492 virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag& tag, bool& isPlayable)
1493 {
1495 }
1496 //----------------------------------------------------------------------------
1497
1498 //============================================================================
1517 std::vector<kodi::addon::PVREDLEntry>& edl)
1518 {
1520 }
1521 //----------------------------------------------------------------------------
1522
1523 //============================================================================
1558 const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVRStreamProperty>& properties)
1559 {
1561 }
1562 //----------------------------------------------------------------------------
1563
1564 //============================================================================
1580 //----------------------------------------------------------------------------
1581
1582 //============================================================================
1597 virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays) { return PVR_ERROR_NOT_IMPLEMENTED; }
1598 //----------------------------------------------------------------------------
1599
1600 //==========================================================================
1615 const kodi::addon::PVREPGTag& tag)
1616 {
1618 }
1619 //----------------------------------------------------------------------------
1620
1621 //==========================================================================
1631 inline int EpgMaxPastDays() const { return m_instanceData->props->iEpgMaxPastDays; }
1632 //----------------------------------------------------------------------------
1633
1634 //==========================================================================
1644 inline int EpgMaxFutureDays() const { return m_instanceData->props->iEpgMaxFutureDays; }
1645 //----------------------------------------------------------------------------
1646
1647 //==========================================================================
1655 inline void TriggerEpgUpdate(unsigned int channelUid)
1656 {
1657 m_instanceData->toKodi->TriggerEpgUpdate(m_instanceData->toKodi->kodiInstance, channelUid);
1658 }
1659 //----------------------------------------------------------------------------
1660
1661 //==========================================================================
1694 {
1695 m_instanceData->toKodi->EpgEventStateChange(m_instanceData->toKodi->kodiInstance, tag,
1696 newState);
1697 }
1698 //----------------------------------------------------------------------------
1699
1701 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1702
1703 //============================================================================
1726
1727 //============================================================================
1738 virtual PVR_ERROR GetRecordingsAmount(bool deleted, int& amount)
1739 {
1741 }
1742 //----------------------------------------------------------------------------
1743
1744 //============================================================================
1786 {
1788 }
1789 //----------------------------------------------------------------------------
1790
1791 //============================================================================
1801 {
1803 }
1804 //----------------------------------------------------------------------------
1805
1806 //============================================================================
1816 {
1818 }
1819 //----------------------------------------------------------------------------
1820
1821 //============================================================================
1827 //----------------------------------------------------------------------------
1828
1829 //============================================================================
1840 {
1842 }
1843 //----------------------------------------------------------------------------
1844
1845 //============================================================================
1858 {
1860 }
1861 //----------------------------------------------------------------------------
1862
1863 //============================================================================
1875 virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording& recording, int count)
1876 {
1878 }
1879 //----------------------------------------------------------------------------
1880
1881 //============================================================================
1892 int lastplayedposition)
1893 {
1895 }
1896 //----------------------------------------------------------------------------
1897
1898 //============================================================================
1909 int& position)
1910 {
1912 }
1913 //----------------------------------------------------------------------------
1914
1915 //============================================================================
1930 std::vector<kodi::addon::PVREDLEntry>& edl)
1931 {
1933 }
1934 //----------------------------------------------------------------------------
1935
1936 //============================================================================
1946 virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording& recording, int64_t& size)
1947 {
1949 }
1950 //----------------------------------------------------------------------------
1951
1952 //============================================================================
1989 const kodi::addon::PVRRecording& recording,
1990 std::vector<kodi::addon::PVRStreamProperty>& properties)
1991 {
1993 }
1994 //----------------------------------------------------------------------------
1995
1996 //==========================================================================
2011 const kodi::addon::PVRRecording& item)
2012 {
2014 }
2015 //----------------------------------------------------------------------------
2016
2017 //============================================================================
2028 inline void RecordingNotification(const std::string& recordingName,
2029 const std::string& fileName,
2030 bool on)
2031 {
2032 m_instanceData->toKodi->RecordingNotification(m_instanceData->toKodi->kodiInstance,
2033 recordingName.c_str(), fileName.c_str(), on);
2034 }
2035 //----------------------------------------------------------------------------
2036
2037 //============================================================================
2044 {
2045 m_instanceData->toKodi->TriggerRecordingUpdate(m_instanceData->toKodi->kodiInstance);
2046 }
2047 //----------------------------------------------------------------------------
2048
2050 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2051
2052 //============================================================================
2074
2075 //============================================================================
2090 virtual PVR_ERROR GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
2091 {
2093 }
2094 //----------------------------------------------------------------------------
2095
2096 //============================================================================
2105 virtual PVR_ERROR GetTimersAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
2106 //----------------------------------------------------------------------------
2107
2108 //============================================================================
2149 //----------------------------------------------------------------------------
2150
2151 //============================================================================
2161 {
2163 }
2164 //----------------------------------------------------------------------------
2165
2166 //============================================================================
2177 virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer& timer, bool forceDelete)
2178 {
2180 }
2181 //----------------------------------------------------------------------------
2182
2183 //============================================================================
2193 {
2195 }
2196 //----------------------------------------------------------------------------
2197
2198 //============================================================================
2214 const kodi::addon::PVRTimer& item)
2215 {
2217 }
2218 //----------------------------------------------------------------------------
2219
2220 //============================================================================
2227 {
2228 m_instanceData->toKodi->TriggerTimerUpdate(m_instanceData->toKodi->kodiInstance);
2229 }
2230 //----------------------------------------------------------------------------
2231
2233 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2234
2235 //============================================================================
2252
2253 //============================================================================
2259 //----------------------------------------------------------------------------
2260
2261 //============================================================================
2267 //----------------------------------------------------------------------------
2268
2269 //============================================================================
2275 //----------------------------------------------------------------------------
2276
2277 //============================================================================
2283 //----------------------------------------------------------------------------
2284
2286 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2287
2288 //============================================================================
2300
2301 //============================================================================
2318
2319 //============================================================================
2337 virtual bool OpenLiveStream(const kodi::addon::PVRChannel& channel) { return false; }
2338 //----------------------------------------------------------------------------
2339
2340 //============================================================================
2346 virtual void CloseLiveStream() {}
2347 //----------------------------------------------------------------------------
2348
2349 //============================================================================
2359 virtual int ReadLiveStream(unsigned char* buffer, unsigned int size) { return 0; }
2360 //----------------------------------------------------------------------------
2361
2362 //============================================================================
2379 virtual int64_t SeekLiveStream(int64_t position, int whence) { return 0; }
2380 //----------------------------------------------------------------------------
2381
2382 //============================================================================
2390 virtual int64_t LengthLiveStream() { return 0; }
2391 //----------------------------------------------------------------------------
2392
2393 //============================================================================
2413
2414 //============================================================================
2422 virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
2423 {
2425 }
2426 //----------------------------------------------------------------------------
2427
2428 //============================================================================
2437 //----------------------------------------------------------------------------
2438
2439 //============================================================================
2453 virtual DEMUX_PACKET* DemuxRead() { return nullptr; }
2454 //----------------------------------------------------------------------------
2455
2456 //============================================================================
2461 virtual void DemuxReset() {}
2462 //----------------------------------------------------------------------------
2463
2464 //============================================================================
2469 virtual void DemuxAbort() {}
2470 //----------------------------------------------------------------------------
2471
2472 //============================================================================
2478 virtual void DemuxFlush() {}
2479 //----------------------------------------------------------------------------
2480
2481 //============================================================================
2489 virtual void SetSpeed(int speed) {}
2490 //----------------------------------------------------------------------------
2491
2492 //============================================================================
2499 virtual void FillBuffer(bool mode) {}
2500 //----------------------------------------------------------------------------
2501
2502 //============================================================================
2514 virtual bool SeekTime(double time, bool backwards, double& startpts) { return false; }
2515 //----------------------------------------------------------------------------
2516
2517 //============================================================================
2526 inline PVRCodec GetCodecByName(const std::string& codecName) const
2527 {
2528 return PVRCodec(m_instanceData->toKodi->GetCodecByName(m_instanceData->toKodi->kodiInstance,
2529 codecName.c_str()));
2530 }
2531 //----------------------------------------------------------------------------
2532
2533 //============================================================================
2542 inline DEMUX_PACKET* AllocateDemuxPacket(int iDataSize)
2543 {
2544 return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance,
2545 iDataSize);
2546 }
2547 //----------------------------------------------------------------------------
2548
2549 //============================================================================
2557 inline void FreeDemuxPacket(DEMUX_PACKET* pPacket)
2558 {
2559 m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket);
2560 }
2561 //----------------------------------------------------------------------------
2563
2565 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2566
2567 //============================================================================
2586
2587 //============================================================================
2598 virtual bool OpenRecordedStream(const kodi::addon::PVRRecording& recording, int64_t& streamId)
2599 {
2600 return false;
2601 }
2602 //----------------------------------------------------------------------------
2603
2604 //============================================================================
2613 virtual void CloseRecordedStream(int64_t streamId) {}
2614 //----------------------------------------------------------------------------
2615
2616 //============================================================================
2628 virtual int ReadRecordedStream(int64_t streamId, unsigned char* buffer, unsigned int size)
2629 {
2630 return 0;
2631 }
2632 //----------------------------------------------------------------------------
2633
2634 //============================================================================
2653 virtual int64_t SeekRecordedStream(int64_t streamId, int64_t position, int whence) { return 0; }
2654 //----------------------------------------------------------------------------
2655
2656 //============================================================================
2667 virtual int64_t LengthRecordedStream(int64_t streamId) { return 0; }
2668 //----------------------------------------------------------------------------
2669
2670 //============================================================================
2682 virtual PVR_ERROR IsRecordedStreamRealTime(int64_t streamId, bool& isRealTime)
2683 {
2685 }
2686 //----------------------------------------------------------------------------
2687
2688 //============================================================================
2702 virtual PVR_ERROR PauseRecordedStream(int64_t streamId, bool paused)
2703 {
2705 }
2706 //----------------------------------------------------------------------------
2707
2708 //============================================================================
2723 {
2725 }
2727 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2728
2729 //============================================================================
2747
2748 //============================================================================
2758 virtual bool CanPauseStream() { return false; }
2759 //----------------------------------------------------------------------------
2760
2761 //============================================================================
2772 virtual bool CanSeekStream() { return false; }
2773 //----------------------------------------------------------------------------
2774
2775 //============================================================================
2782 virtual void PauseStream(bool paused) {}
2783 //----------------------------------------------------------------------------
2784
2785 //============================================================================
2791 virtual bool IsRealTimeStream() { return false; }
2792 //----------------------------------------------------------------------------
2793
2794 //============================================================================
2805 //----------------------------------------------------------------------------
2806
2807 //============================================================================
2819 //----------------------------------------------------------------------------
2820
2822 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2823
2824private:
2825 void SetAddonStruct(KODI_ADDON_INSTANCE_STRUCT* instance)
2826 {
2827 instance->hdl = this;
2828
2829 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2830 instance->pvr->toAddon->GetCapabilities = ADDON_GetCapabilities;
2831 instance->pvr->toAddon->GetConnectionString = ADDON_GetConnectionString;
2832 instance->pvr->toAddon->GetBackendName = ADDON_GetBackendName;
2833 instance->pvr->toAddon->GetBackendVersion = ADDON_GetBackendVersion;
2834 instance->pvr->toAddon->GetBackendHostname = ADDON_GetBackendHostname;
2835 instance->pvr->toAddon->GetDriveSpace = ADDON_GetDriveSpace;
2836 instance->pvr->toAddon->CallSettingsMenuHook = ADDON_CallSettingsMenuHook;
2837 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2838 instance->pvr->toAddon->GetChannelsAmount = ADDON_GetChannelsAmount;
2839 instance->pvr->toAddon->GetChannels = ADDON_GetChannels;
2840 instance->pvr->toAddon->GetChannelStreamProperties = ADDON_GetChannelStreamProperties;
2841 instance->pvr->toAddon->GetSignalStatus = ADDON_GetSignalStatus;
2842 instance->pvr->toAddon->GetDescrambleInfo = ADDON_GetDescrambleInfo;
2843 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2844 instance->pvr->toAddon->GetProvidersAmount = ADDON_GetProvidersAmount;
2845 instance->pvr->toAddon->GetProviders = ADDON_GetProviders;
2846 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2847 instance->pvr->toAddon->GetChannelGroupsAmount = ADDON_GetChannelGroupsAmount;
2848 instance->pvr->toAddon->GetChannelGroups = ADDON_GetChannelGroups;
2849 instance->pvr->toAddon->GetChannelGroupMembers = ADDON_GetChannelGroupMembers;
2850 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2851 instance->pvr->toAddon->DeleteChannel = ADDON_DeleteChannel;
2852 instance->pvr->toAddon->RenameChannel = ADDON_RenameChannel;
2853 instance->pvr->toAddon->OpenDialogChannelSettings = ADDON_OpenDialogChannelSettings;
2854 instance->pvr->toAddon->OpenDialogChannelAdd = ADDON_OpenDialogChannelAdd;
2855 instance->pvr->toAddon->OpenDialogChannelScan = ADDON_OpenDialogChannelScan;
2856 instance->pvr->toAddon->CallChannelMenuHook = ADDON_CallChannelMenuHook;
2857 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2858 instance->pvr->toAddon->GetEPGForChannel = ADDON_GetEPGForChannel;
2859 instance->pvr->toAddon->IsEPGTagRecordable = ADDON_IsEPGTagRecordable;
2860 instance->pvr->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable;
2861 instance->pvr->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl;
2862 instance->pvr->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties;
2863 instance->pvr->toAddon->SetEPGMaxPastDays = ADDON_SetEPGMaxPastDays;
2864 instance->pvr->toAddon->SetEPGMaxFutureDays = ADDON_SetEPGMaxFutureDays;
2865 instance->pvr->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook;
2866 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2867 instance->pvr->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount;
2868 instance->pvr->toAddon->GetRecordings = ADDON_GetRecordings;
2869 instance->pvr->toAddon->DeleteRecording = ADDON_DeleteRecording;
2870 instance->pvr->toAddon->UndeleteRecording = ADDON_UndeleteRecording;
2871 instance->pvr->toAddon->DeleteAllRecordingsFromTrash = ADDON_DeleteAllRecordingsFromTrash;
2872 instance->pvr->toAddon->RenameRecording = ADDON_RenameRecording;
2873 instance->pvr->toAddon->SetRecordingLifetime = ADDON_SetRecordingLifetime;
2874 instance->pvr->toAddon->SetRecordingPlayCount = ADDON_SetRecordingPlayCount;
2875 instance->pvr->toAddon->SetRecordingLastPlayedPosition = ADDON_SetRecordingLastPlayedPosition;
2876 instance->pvr->toAddon->GetRecordingLastPlayedPosition = ADDON_GetRecordingLastPlayedPosition;
2877 instance->pvr->toAddon->GetRecordingEdl = ADDON_GetRecordingEdl;
2878 instance->pvr->toAddon->GetRecordingSize = ADDON_GetRecordingSize;
2879 instance->pvr->toAddon->GetRecordingStreamProperties = ADDON_GetRecordingStreamProperties;
2880 instance->pvr->toAddon->CallRecordingMenuHook = ADDON_CallRecordingMenuHook;
2881 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2882 instance->pvr->toAddon->GetTimerTypes = ADDON_GetTimerTypes;
2883 instance->pvr->toAddon->GetTimersAmount = ADDON_GetTimersAmount;
2884 instance->pvr->toAddon->GetTimers = ADDON_GetTimers;
2885 instance->pvr->toAddon->AddTimer = ADDON_AddTimer;
2886 instance->pvr->toAddon->DeleteTimer = ADDON_DeleteTimer;
2887 instance->pvr->toAddon->UpdateTimer = ADDON_UpdateTimer;
2888 instance->pvr->toAddon->CallTimerMenuHook = ADDON_CallTimerMenuHook;
2889 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2890 instance->pvr->toAddon->OnSystemSleep = ADDON_OnSystemSleep;
2891 instance->pvr->toAddon->OnSystemWake = ADDON_OnSystemWake;
2892 instance->pvr->toAddon->OnPowerSavingActivated = ADDON_OnPowerSavingActivated;
2893 instance->pvr->toAddon->OnPowerSavingDeactivated = ADDON_OnPowerSavingDeactivated;
2894 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2895 instance->pvr->toAddon->OpenLiveStream = ADDON_OpenLiveStream;
2896 instance->pvr->toAddon->CloseLiveStream = ADDON_CloseLiveStream;
2897 instance->pvr->toAddon->ReadLiveStream = ADDON_ReadLiveStream;
2898 instance->pvr->toAddon->SeekLiveStream = ADDON_SeekLiveStream;
2899 instance->pvr->toAddon->LengthLiveStream = ADDON_LengthLiveStream;
2900 instance->pvr->toAddon->GetStreamProperties = ADDON_GetStreamProperties;
2901 instance->pvr->toAddon->StreamClosed = ADDON_StreamClosed;
2902 instance->pvr->toAddon->GetStreamReadChunkSize = ADDON_GetStreamReadChunkSize;
2903 instance->pvr->toAddon->IsRealTimeStream = ADDON_IsRealTimeStream;
2904 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2905 instance->pvr->toAddon->OpenRecordedStream = ADDON_OpenRecordedStream;
2906 instance->pvr->toAddon->CloseRecordedStream = ADDON_CloseRecordedStream;
2907 instance->pvr->toAddon->ReadRecordedStream = ADDON_ReadRecordedStream;
2908 instance->pvr->toAddon->SeekRecordedStream = ADDON_SeekRecordedStream;
2909 instance->pvr->toAddon->LengthRecordedStream = ADDON_LengthRecordedStream;
2910 instance->pvr->toAddon->IsRecordedStreamRealTime = ADDON_IsRecordedStreamRealTime;
2911 instance->pvr->toAddon->PauseRecordedStream = ADDON_PauseRecordedStream;
2912 instance->pvr->toAddon->GetRecordedStreamTimes = ADDON_GetRecordedStreamTimes;
2913 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2914 instance->pvr->toAddon->DemuxReset = ADDON_DemuxReset;
2915 instance->pvr->toAddon->DemuxAbort = ADDON_DemuxAbort;
2916 instance->pvr->toAddon->DemuxFlush = ADDON_DemuxFlush;
2917 instance->pvr->toAddon->DemuxRead = ADDON_DemuxRead;
2918 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2919 instance->pvr->toAddon->CanPauseStream = ADDON_CanPauseStream;
2920 instance->pvr->toAddon->PauseStream = ADDON_PauseStream;
2921 instance->pvr->toAddon->CanSeekStream = ADDON_CanSeekStream;
2922 instance->pvr->toAddon->SeekTime = ADDON_SeekTime;
2923 instance->pvr->toAddon->SetSpeed = ADDON_SetSpeed;
2924 instance->pvr->toAddon->FillBuffer = ADDON_FillBuffer;
2925 instance->pvr->toAddon->GetStreamTimes = ADDON_GetStreamTimes;
2926 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2927 instance->pvr->toAddon->FreeCapabilities = ADDON_FreeCapabilities;
2928 instance->pvr->toAddon->FreeTimerTypes = ADDON_FreeTimerTypes;
2929 instance->pvr->toAddon->FreeProperties = ADDON_FreeProperties;
2930 instance->pvr->toAddon->FreeDescrambleInfo = ADDON_FreeDescrambleInfo;
2931 instance->pvr->toAddon->FreeSignalStatus = ADDON_FreeSignalStatus;
2932 instance->pvr->toAddon->FreeEdlEntries = ADDON_FreeEdlEntries;
2933 instance->pvr->toAddon->FreeString = ADDON_FreeString;
2934
2935 m_instanceData = instance->pvr;
2936 m_instanceData->toAddon->addonInstance = this;
2937 }
2938
2939 inline static PVR_ERROR ADDON_GetCapabilities(const AddonInstance_PVR* instance,
2940 PVR_ADDON_CAPABILITIES* capabilities)
2941 {
2942 PVRCapabilities cppCapabilities(capabilities);
2943 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2944 ->GetCapabilities(cppCapabilities);
2945 }
2946
2947 inline static PVR_ERROR ADDON_FreeCapabilities(const AddonInstance_PVR* instance,
2948 PVR_ADDON_CAPABILITIES* capabilities)
2949 {
2950 PVRCapabilities::FreeResources(capabilities);
2951 return PVR_ERROR_NO_ERROR;
2952 }
2953
2954 inline static PVR_ERROR ADDON_GetBackendName(const AddonInstance_PVR* instance, char** str)
2955 {
2956 std::string backendName;
2957 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2958 ->GetBackendName(backendName);
2959 if (err == PVR_ERROR_NO_ERROR)
2960 *str = AllocAndCopyString(backendName.c_str());
2961 return err;
2962 }
2963
2964 inline static PVR_ERROR ADDON_GetBackendVersion(const AddonInstance_PVR* instance, char** str)
2965 {
2966 std::string backendVersion;
2967 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2968 ->GetBackendVersion(backendVersion);
2969 if (err == PVR_ERROR_NO_ERROR)
2970 *str = AllocAndCopyString(backendVersion.c_str());
2971 return err;
2972 }
2973
2974 inline static PVR_ERROR ADDON_GetBackendHostname(const AddonInstance_PVR* instance, char** str)
2975 {
2976 std::string backendHostname;
2977 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2978 ->GetBackendHostname(backendHostname);
2979 if (err == PVR_ERROR_NO_ERROR)
2980 *str = AllocAndCopyString(backendHostname.c_str());
2981 return err;
2982 }
2983
2984 inline static PVR_ERROR ADDON_GetConnectionString(const AddonInstance_PVR* instance, char** str)
2985 {
2986 std::string connectionString;
2987 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2988 ->GetConnectionString(connectionString);
2989 if (err == PVR_ERROR_NO_ERROR)
2990 *str = AllocAndCopyString(connectionString.c_str());
2991 return err;
2992 }
2993
2994 inline static PVR_ERROR ADDON_GetDriveSpace(const AddonInstance_PVR* instance,
2995 uint64_t* total,
2996 uint64_t* used)
2997 {
2998 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2999 ->GetDriveSpace(*total, *used);
3000 }
3001
3002 inline static PVR_ERROR ADDON_CallSettingsMenuHook(const AddonInstance_PVR* instance,
3003 const PVR_MENUHOOK* menuhook)
3004 {
3005 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3006 ->CallSettingsMenuHook(menuhook);
3007 }
3008
3009 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3010
3011 inline static PVR_ERROR ADDON_GetChannelsAmount(const AddonInstance_PVR* instance, int* amount)
3012 {
3013 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3014 ->GetChannelsAmount(*amount);
3015 }
3016
3017 inline static PVR_ERROR ADDON_GetChannels(const AddonInstance_PVR* instance,
3018 PVR_HANDLE handle,
3019 bool radio)
3020 {
3021 PVRChannelsResultSet result(instance, handle);
3022 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3023 ->GetChannels(radio, result);
3024 }
3025
3026 inline static PVR_ERROR ADDON_GetChannelStreamProperties(const AddonInstance_PVR* instance,
3027 const PVR_CHANNEL* channel,
3028 PVR_SOURCE source,
3029 PVR_NAMED_VALUE*** properties,
3030 unsigned int* propertiesCount)
3031 {
3032 *propertiesCount = 0;
3033 std::vector<PVRStreamProperty> propertiesList;
3034 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3035 ->GetChannelStreamProperties(channel, source, propertiesList);
3036 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3037 {
3038 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3039 *propertiesCount);
3040 }
3041 return error;
3042 }
3043
3044 inline static PVR_ERROR ADDON_GetSignalStatus(const AddonInstance_PVR* instance,
3045 int channelUid,
3046 PVR_SIGNAL_STATUS* signalStatus)
3047 {
3048 PVRSignalStatus cppSignalStatus(signalStatus);
3049 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3050 ->GetSignalStatus(channelUid, cppSignalStatus);
3051 }
3052
3053 inline static PVR_ERROR ADDON_FreeSignalStatus(const AddonInstance_PVR* instance,
3054 PVR_SIGNAL_STATUS* signalStatus)
3055 {
3056 PVRSignalStatus::FreeResources(signalStatus);
3057 return PVR_ERROR_NO_ERROR;
3058 }
3059
3060 inline static PVR_ERROR ADDON_GetDescrambleInfo(const AddonInstance_PVR* instance,
3061 int channelUid,
3062 PVR_DESCRAMBLE_INFO* descrambleInfo)
3063 {
3064 PVRDescrambleInfo cppDescrambleInfo(descrambleInfo);
3065 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3066 ->GetDescrambleInfo(channelUid, cppDescrambleInfo);
3067 }
3068
3069 inline static PVR_ERROR ADDON_FreeDescrambleInfo(const AddonInstance_PVR* instance,
3070 PVR_DESCRAMBLE_INFO* descrambleInfo)
3071 {
3072 PVRDescrambleInfo::FreeResources(descrambleInfo);
3073 return PVR_ERROR_NO_ERROR;
3074 }
3075
3076 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3077
3078 inline static PVR_ERROR ADDON_GetProvidersAmount(const AddonInstance_PVR* instance, int* amount)
3079 {
3080 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3081 ->GetProvidersAmount(*amount);
3082 }
3083
3084 inline static PVR_ERROR ADDON_GetProviders(const AddonInstance_PVR* instance, PVR_HANDLE handle)
3085 {
3086 PVRProvidersResultSet result(instance, handle);
3087 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetProviders(result);
3088 }
3089
3090 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3091
3092 inline static PVR_ERROR ADDON_GetChannelGroupsAmount(const AddonInstance_PVR* instance,
3093 int* amount)
3094 {
3095 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3096 ->GetChannelGroupsAmount(*amount);
3097 }
3098
3099 inline static PVR_ERROR ADDON_GetChannelGroups(const AddonInstance_PVR* instance,
3100 PVR_HANDLE handle,
3101 bool radio)
3102 {
3103 PVRChannelGroupsResultSet result(instance, handle);
3104 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3105 ->GetChannelGroups(radio, result);
3106 }
3107
3108 inline static PVR_ERROR ADDON_GetChannelGroupMembers(const AddonInstance_PVR* instance,
3109 PVR_HANDLE handle,
3110 const PVR_CHANNEL_GROUP* group)
3111 {
3112 PVRChannelGroupMembersResultSet result(instance, handle);
3113 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3114 ->GetChannelGroupMembers(group, result);
3115 }
3116
3117 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3118
3119 inline static PVR_ERROR ADDON_DeleteChannel(const AddonInstance_PVR* instance,
3120 const PVR_CHANNEL* channel)
3121 {
3122 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3123 ->DeleteChannel(channel);
3124 }
3125
3126 inline static PVR_ERROR ADDON_RenameChannel(const AddonInstance_PVR* instance,
3127 const PVR_CHANNEL* channel)
3128 {
3129 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3130 ->RenameChannel(channel);
3131 }
3132
3133 inline static PVR_ERROR ADDON_OpenDialogChannelSettings(const AddonInstance_PVR* instance,
3134 const PVR_CHANNEL* channel)
3135 {
3136 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3137 ->OpenDialogChannelSettings(channel);
3138 }
3139
3140 inline static PVR_ERROR ADDON_OpenDialogChannelAdd(const AddonInstance_PVR* instance,
3141 const PVR_CHANNEL* channel)
3142 {
3143 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3144 ->OpenDialogChannelAdd(channel);
3145 }
3146
3147 inline static PVR_ERROR ADDON_OpenDialogChannelScan(const AddonInstance_PVR* instance)
3148 {
3149 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3150 ->OpenDialogChannelScan();
3151 }
3152
3153 inline static PVR_ERROR ADDON_CallChannelMenuHook(const AddonInstance_PVR* instance,
3154 const PVR_MENUHOOK* menuhook,
3155 const PVR_CHANNEL* channel)
3156 {
3157 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3158 ->CallChannelMenuHook(menuhook, channel);
3159 }
3160
3161 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3162
3163 inline static PVR_ERROR ADDON_GetEPGForChannel(const AddonInstance_PVR* instance,
3164 PVR_HANDLE handle,
3165 int channelUid,
3166 time_t start,
3167 time_t end)
3168 {
3169 PVREPGTagsResultSet result(instance, handle);
3170 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3171 ->GetEPGForChannel(channelUid, start, end, result);
3172 }
3173
3174 inline static PVR_ERROR ADDON_IsEPGTagRecordable(const AddonInstance_PVR* instance,
3175 const EPG_TAG* tag,
3176 bool* isRecordable)
3177 {
3178 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3179 ->IsEPGTagRecordable(tag, *isRecordable);
3180 }
3181
3182 inline static PVR_ERROR ADDON_IsEPGTagPlayable(const AddonInstance_PVR* instance,
3183 const EPG_TAG* tag,
3184 bool* isPlayable)
3185 {
3186 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3187 ->IsEPGTagPlayable(tag, *isPlayable);
3188 }
3189
3190 inline static PVR_ERROR ADDON_GetEPGTagEdl(const AddonInstance_PVR* instance,
3191 const EPG_TAG* tag,
3192 PVR_EDL_ENTRY*** edls,
3193 unsigned int* size)
3194 {
3195 *size = 0;
3196 std::vector<PVREDLEntry> edlList;
3197 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3198 ->GetEPGTagEdl(tag, edlList);
3199 if (error == PVR_ERROR_NO_ERROR && !edlList.empty())
3200 {
3201 *edls = AllocAndCopyPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edlList, *size);
3202 }
3203 return error;
3204 }
3205
3206 inline static PVR_ERROR ADDON_GetEPGTagStreamProperties(const AddonInstance_PVR* instance,
3207 const EPG_TAG* tag,
3208 PVR_NAMED_VALUE*** properties,
3209 unsigned int* propertiesCount)
3210 {
3211 *propertiesCount = 0;
3212 std::vector<PVRStreamProperty> propertiesList;
3213 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3214 ->GetEPGTagStreamProperties(tag, propertiesList);
3215 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3216 {
3217 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3218 *propertiesCount);
3219 }
3220 return error;
3221 }
3222
3223 inline static PVR_ERROR ADDON_SetEPGMaxPastDays(const AddonInstance_PVR* instance, int pastDays)
3224 {
3225 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3226 ->SetEPGMaxPastDays(pastDays);
3227 }
3228
3229 inline static PVR_ERROR ADDON_SetEPGMaxFutureDays(const AddonInstance_PVR* instance,
3230 int futureDays)
3231 {
3232 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3233 ->SetEPGMaxFutureDays(futureDays);
3234 }
3235
3236 inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance,
3237 const PVR_MENUHOOK* menuhook,
3238 const EPG_TAG* tag)
3239 {
3240 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3241 ->CallEPGMenuHook(menuhook, tag);
3242 }
3243
3244 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3245
3246 inline static PVR_ERROR ADDON_GetRecordingsAmount(const AddonInstance_PVR* instance,
3247 bool deleted,
3248 int* amount)
3249 {
3250 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3251 ->GetRecordingsAmount(deleted, *amount);
3252 }
3253
3254 inline static PVR_ERROR ADDON_GetRecordings(const AddonInstance_PVR* instance,
3255 PVR_HANDLE handle,
3256 bool deleted)
3257 {
3258 PVRRecordingsResultSet result(instance, handle);
3259 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3260 ->GetRecordings(deleted, result);
3261 }
3262
3263 inline static PVR_ERROR ADDON_DeleteRecording(const AddonInstance_PVR* instance,
3264 const PVR_RECORDING* recording)
3265 {
3266 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3267 ->DeleteRecording(recording);
3268 }
3269
3270 inline static PVR_ERROR ADDON_UndeleteRecording(const AddonInstance_PVR* instance,
3271 const PVR_RECORDING* recording)
3272 {
3273 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3274 ->UndeleteRecording(recording);
3275 }
3276
3277 inline static PVR_ERROR ADDON_DeleteAllRecordingsFromTrash(const AddonInstance_PVR* instance)
3278 {
3279 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3280 ->DeleteAllRecordingsFromTrash();
3281 }
3282
3283 inline static PVR_ERROR ADDON_RenameRecording(const AddonInstance_PVR* instance,
3284 const PVR_RECORDING* recording)
3285 {
3286 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3287 ->RenameRecording(recording);
3288 }
3289
3290 inline static PVR_ERROR ADDON_SetRecordingLifetime(const AddonInstance_PVR* instance,
3291 const PVR_RECORDING* recording)
3292 {
3293 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3294 ->SetRecordingLifetime(recording);
3295 }
3296
3297 inline static PVR_ERROR ADDON_SetRecordingPlayCount(const AddonInstance_PVR* instance,
3298 const PVR_RECORDING* recording,
3299 int count)
3300 {
3301 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3302 ->SetRecordingPlayCount(recording, count);
3303 }
3304
3305 inline static PVR_ERROR ADDON_SetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3306 const PVR_RECORDING* recording,
3307 int lastplayedposition)
3308 {
3309 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3310 ->SetRecordingLastPlayedPosition(recording, lastplayedposition);
3311 }
3312
3313 inline static PVR_ERROR ADDON_GetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3314 const PVR_RECORDING* recording,
3315 int* position)
3316 {
3317 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3318 ->GetRecordingLastPlayedPosition(recording, *position);
3319 }
3320
3321 inline static PVR_ERROR ADDON_GetRecordingEdl(const AddonInstance_PVR* instance,
3322 const PVR_RECORDING* recording,
3323 PVR_EDL_ENTRY*** edls,
3324 unsigned int* size)
3325 {
3326 *size = 0;
3327 std::vector<PVREDLEntry> edlList;
3328 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3329 ->GetRecordingEdl(recording, edlList);
3330 if (error == PVR_ERROR_NO_ERROR && !edlList.empty())
3331 {
3332 *edls = AllocAndCopyPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edlList, *size);
3333 }
3334 return error;
3335 }
3336
3337 inline static PVR_ERROR ADDON_FreeEdlEntries(const AddonInstance_PVR* instance,
3338 PVR_EDL_ENTRY** edls,
3339 unsigned int size)
3340 {
3341 FreeStaticPointerArray<PVREDLEntry, PVR_EDL_ENTRY>(edls, size);
3342 return PVR_ERROR_NO_ERROR;
3343 }
3344
3345 inline static PVR_ERROR ADDON_GetRecordingSize(const AddonInstance_PVR* instance,
3346 const PVR_RECORDING* recording,
3347 int64_t* size)
3348 {
3349 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3350 ->GetRecordingSize(recording, *size);
3351 }
3352
3353 inline static PVR_ERROR ADDON_GetRecordingStreamProperties(const AddonInstance_PVR* instance,
3354 const PVR_RECORDING* recording,
3355 PVR_NAMED_VALUE*** properties,
3356 unsigned int* propertiesCount)
3357 {
3358 *propertiesCount = 0;
3359 std::vector<PVRStreamProperty> propertiesList;
3360 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3361 ->GetRecordingStreamProperties(recording, propertiesList);
3362 if (error == PVR_ERROR_NO_ERROR && !propertiesList.empty())
3363 {
3364 *properties = AllocAndCopyPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(propertiesList,
3365 *propertiesCount);
3366 }
3367 return error;
3368 }
3369
3370 inline static PVR_ERROR ADDON_FreeProperties(const AddonInstance_PVR* instance,
3371 PVR_NAMED_VALUE** properties,
3372 unsigned int propertiesCount)
3373 {
3374 FreeDynamicPointerArray<PVRStreamProperty, PVR_NAMED_VALUE>(properties, propertiesCount);
3375 return PVR_ERROR_NO_ERROR;
3376 }
3377
3378 inline static PVR_ERROR ADDON_CallRecordingMenuHook(const AddonInstance_PVR* instance,
3379 const PVR_MENUHOOK* menuhook,
3380 const PVR_RECORDING* recording)
3381 {
3382 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3383 ->CallRecordingMenuHook(menuhook, recording);
3384 }
3385
3386 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3387
3388 inline static PVR_ERROR ADDON_GetTimerTypes(const AddonInstance_PVR* instance,
3389 PVR_TIMER_TYPE*** types,
3390 unsigned int* typesCount)
3391 {
3392 *typesCount = 0;
3393 std::vector<PVRTimerType> timerTypes;
3394 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3395 ->GetTimerTypes(timerTypes);
3396 if (error == PVR_ERROR_NO_ERROR && !timerTypes.empty())
3397 {
3398 *types = AllocAndCopyPointerArray<PVRTimerType, PVR_TIMER_TYPE>(timerTypes, *typesCount);
3399 }
3400 return error;
3401 }
3402
3403 inline static PVR_ERROR ADDON_FreeTimerTypes(const AddonInstance_PVR* instance,
3404 PVR_TIMER_TYPE** types,
3405 unsigned int typesCount)
3406 {
3407 FreeDynamicPointerArray<PVRTimerType, PVR_TIMER_TYPE>(types, typesCount);
3408 return PVR_ERROR_NO_ERROR;
3409 }
3410
3411 inline static PVR_ERROR ADDON_GetTimersAmount(const AddonInstance_PVR* instance, int* amount)
3412 {
3413 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3414 ->GetTimersAmount(*amount);
3415 }
3416
3417 inline static PVR_ERROR ADDON_GetTimers(const AddonInstance_PVR* instance, PVR_HANDLE handle)
3418 {
3419 PVRTimersResultSet result(instance, handle);
3420 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetTimers(result);
3421 }
3422
3423 inline static PVR_ERROR ADDON_AddTimer(const AddonInstance_PVR* instance, const PVR_TIMER* timer)
3424 {
3425 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->AddTimer(timer);
3426 }
3427
3428 inline static PVR_ERROR ADDON_DeleteTimer(const AddonInstance_PVR* instance,
3429 const PVR_TIMER* timer,
3430 bool forceDelete)
3431 {
3432 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3433 ->DeleteTimer(timer, forceDelete);
3434 }
3435
3436 inline static PVR_ERROR ADDON_UpdateTimer(const AddonInstance_PVR* instance,
3437 const PVR_TIMER* timer)
3438 {
3439 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->UpdateTimer(timer);
3440 }
3441
3442 inline static PVR_ERROR ADDON_CallTimerMenuHook(const AddonInstance_PVR* instance,
3443 const PVR_MENUHOOK* menuhook,
3444 const PVR_TIMER* timer)
3445 {
3446 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3447 ->CallTimerMenuHook(menuhook, timer);
3448 }
3449
3450 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3451
3452 inline static PVR_ERROR ADDON_OnSystemSleep(const AddonInstance_PVR* instance)
3453 {
3454 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemSleep();
3455 }
3456
3457 inline static PVR_ERROR ADDON_OnSystemWake(const AddonInstance_PVR* instance)
3458 {
3459 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemWake();
3460 }
3461
3462 inline static PVR_ERROR ADDON_OnPowerSavingActivated(const AddonInstance_PVR* instance)
3463 {
3464 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3465 ->OnPowerSavingActivated();
3466 }
3467
3468 inline static PVR_ERROR ADDON_OnPowerSavingDeactivated(const AddonInstance_PVR* instance)
3469 {
3470 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3471 ->OnPowerSavingDeactivated();
3472 }
3473
3474 // obsolete parts below
3476
3477 inline static bool ADDON_OpenLiveStream(const AddonInstance_PVR* instance,
3478 const PVR_CHANNEL* channel)
3479 {
3480 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3481 ->OpenLiveStream(channel);
3482 }
3483
3484 inline static void ADDON_CloseLiveStream(const AddonInstance_PVR* instance)
3485 {
3486 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseLiveStream();
3487 }
3488
3489 inline static int ADDON_ReadLiveStream(const AddonInstance_PVR* instance,
3490 unsigned char* buffer,
3491 unsigned int size)
3492 {
3493 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3494 ->ReadLiveStream(buffer, size);
3495 }
3496
3497 inline static int64_t ADDON_SeekLiveStream(const AddonInstance_PVR* instance,
3498 int64_t position,
3499 int whence)
3500 {
3501 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3502 ->SeekLiveStream(position, whence);
3503 }
3504
3505 inline static int64_t ADDON_LengthLiveStream(const AddonInstance_PVR* instance)
3506 {
3507 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->LengthLiveStream();
3508 }
3509
3510 inline static PVR_ERROR ADDON_GetStreamProperties(const AddonInstance_PVR* instance,
3511 PVR_STREAM_PROPERTIES* properties)
3512 {
3513 properties->iStreamCount = 0;
3514 std::vector<PVRStreamProperties> cppProperties;
3515 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3516 ->GetStreamProperties(cppProperties);
3517 if (err == PVR_ERROR_NO_ERROR)
3518 {
3519 for (unsigned int i = 0; i < cppProperties.size(); ++i)
3520 {
3521 memcpy(&properties->stream[i],
3522 static_cast<PVR_STREAM_PROPERTIES::PVR_STREAM*>(cppProperties[i]),
3524 ++properties->iStreamCount;
3525
3526 if (properties->iStreamCount >= PVR_STREAM_MAX_STREAMS)
3527 {
3528 kodi::Log(
3530 "CInstancePVRClient::%s: Addon given with '%li' more allowed streams where '%i'",
3531 __func__, cppProperties.size(), PVR_STREAM_MAX_STREAMS);
3532 break;
3533 }
3534 }
3535 }
3536
3537 return err;
3538 }
3539
3540 inline static PVR_ERROR ADDON_StreamClosed(const AddonInstance_PVR* instance)
3541 {
3542 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->StreamClosed();
3543 }
3544
3545 inline static PVR_ERROR ADDON_GetStreamReadChunkSize(const AddonInstance_PVR* instance,
3546 int* chunksize)
3547 {
3548 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3549 ->GetStreamReadChunkSize(*chunksize);
3550 }
3551
3552 inline static bool ADDON_IsRealTimeStream(const AddonInstance_PVR* instance)
3553 {
3554 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->IsRealTimeStream();
3555 }
3556
3557 inline static bool ADDON_OpenRecordedStream(const AddonInstance_PVR* instance,
3558 const PVR_RECORDING* recording,
3559 int64_t* streamId)
3560 {
3561 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3562 ->OpenRecordedStream(recording, *streamId);
3563 }
3564
3565 inline static void ADDON_CloseRecordedStream(const AddonInstance_PVR* instance, int64_t streamId)
3566 {
3567 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3568 ->CloseRecordedStream(streamId);
3569 }
3570
3571 inline static int ADDON_ReadRecordedStream(const AddonInstance_PVR* instance,
3572 int64_t streamId,
3573 unsigned char* buffer,
3574 unsigned int size)
3575 {
3576 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3577 ->ReadRecordedStream(streamId, buffer, size);
3578 }
3579
3580 inline static int64_t ADDON_SeekRecordedStream(const AddonInstance_PVR* instance,
3581 int64_t streamId,
3582 int64_t position,
3583 int whence)
3584 {
3585 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3586 ->SeekRecordedStream(streamId, position, whence);
3587 }
3588
3589 inline static int64_t ADDON_LengthRecordedStream(const AddonInstance_PVR* instance,
3590 int64_t streamId)
3591 {
3592 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3593 ->LengthRecordedStream(streamId);
3594 }
3595
3596 inline static PVR_ERROR ADDON_IsRecordedStreamRealTime(const AddonInstance_PVR* instance,
3597 int64_t streamId,
3598 bool* isRealTime)
3599 {
3600 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3601 ->IsRecordedStreamRealTime(streamId, *isRealTime);
3602 }
3603
3604 inline static PVR_ERROR ADDON_PauseRecordedStream(const AddonInstance_PVR* instance,
3605 int64_t streamId,
3606 bool paused)
3607 {
3608 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3609 ->PauseRecordedStream(streamId, paused);
3610 }
3611
3612 inline static PVR_ERROR ADDON_GetRecordedStreamTimes(const AddonInstance_PVR* instance,
3613 int64_t streamId,
3614 PVR_STREAM_TIMES* times)
3615 {
3616 PVRStreamTimes cppTimes(times);
3617 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3618 ->GetRecordedStreamTimes(streamId, cppTimes);
3619 }
3620
3621 inline static void ADDON_DemuxReset(const AddonInstance_PVR* instance)
3622 {
3623 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxReset();
3624 }
3625
3626 inline static void ADDON_DemuxAbort(const AddonInstance_PVR* instance)
3627 {
3628 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxAbort();
3629 }
3630
3631 inline static void ADDON_DemuxFlush(const AddonInstance_PVR* instance)
3632 {
3633 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush();
3634 }
3635
3636 inline static DEMUX_PACKET* ADDON_DemuxRead(const AddonInstance_PVR* instance)
3637 {
3638 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead();
3639 }
3640
3641 inline static bool ADDON_CanPauseStream(const AddonInstance_PVR* instance)
3642 {
3643 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanPauseStream();
3644 }
3645
3646 inline static bool ADDON_CanSeekStream(const AddonInstance_PVR* instance)
3647 {
3648 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanSeekStream();
3649 }
3650
3651 inline static void ADDON_PauseStream(const AddonInstance_PVR* instance, bool bPaused)
3652 {
3653 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->PauseStream(bPaused);
3654 }
3655
3656 inline static bool ADDON_SeekTime(const AddonInstance_PVR* instance,
3657 double time,
3658 bool backwards,
3659 double* startpts)
3660 {
3661 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3662 ->SeekTime(time, backwards, *startpts);
3663 }
3664
3665 inline static void ADDON_SetSpeed(const AddonInstance_PVR* instance, int speed)
3666 {
3667 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->SetSpeed(speed);
3668 }
3669
3670 inline static void ADDON_FillBuffer(const AddonInstance_PVR* instance, bool mode)
3671 {
3672 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->FillBuffer(mode);
3673 }
3674
3675 inline static PVR_ERROR ADDON_GetStreamTimes(const AddonInstance_PVR* instance,
3676 PVR_STREAM_TIMES* times)
3677 {
3678 PVRStreamTimes cppTimes(times);
3679 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3680 ->GetStreamTimes(cppTimes);
3681 }
3682
3683 inline static PVR_ERROR ADDON_FreeString(const AddonInstance_PVR* instance, char* str)
3684 {
3685 FreeString(str);
3686 return PVR_ERROR_NO_ERROR;
3687 }
3689
3690 AddonInstance_PVR* m_instanceData = nullptr;
3691};
3692//}}}
3693//______________________________________________________________________________
3694
3695} /* namespace addon */
3696} /* namespace kodi */
3697
3698#endif /* __cplusplus */
Definition AddonBase.h:566
Definition AddonBase.h:502
Definition General.h:1077
Definition ChannelGroups.h:38
Definition ChannelGroups.h:260
Definition ChannelGroups.h:113
Definition Channels.h:39
Definition Channels.h:226
Definition Stream.h:39
Definition Channels.h:440
Definition EPG.h:40
Definition MenuHook.h:46
Definition Providers.h:189
Definition Recordings.h:39
Definition Recordings.h:654
Definition Channels.h:272
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:194
Definition demux_packet.h:46
virtual PVR_ERROR GetBackendHostname(std::string &hostname)
Get the hostname of the pvr backend server.
Definition PVR.h:618
std::string ClientPath() const
Callback to Kodi Function Get main client path of the PVR addon.
Definition PVR.h:810
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:744
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:689
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:629
virtual PVR_ERROR GetDriveSpace(uint64_t &total, uint64_t &used)
Get the disk space reported by the backend (if supported).
Definition PVR.h:656
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:778
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:507
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:797
CInstancePVRClient()
PVR client class constructor.
Definition PVR.h:463
void TriggerProvidersUpdate()
Callback to Kodi Function Request Kodi to update it's list of providers.
Definition PVR.h:902
virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus &signalStatus)
Get the signal status of the stream that's currently open.
Definition PVR.h:1062
virtual PVR_ERROR GetDescrambleInfo(int channelUid, kodi::addon::PVRDescrambleInfo &descrambleInfo)
Get the descramble information of the stream that's currently open.
Definition PVR.h:1082
void TriggerChannelUpdate()
Callback to Kodi Function Request Kodi to update it's list of channels.
Definition PVR.h:1095
virtual PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet &results)
Request the list of all channels from the backend.
Definition PVR.h:965
virtual PVR_ERROR GetProviders(kodi::addon::PVRProvidersResultSet &results)
Request the list of all providers from the backend.
Definition PVR.h:890
virtual PVR_ERROR GetProvidersAmount(int &amount)
The total amount of providers on the backend.
Definition PVR.h:850
virtual PVR_ERROR GetChannelsAmount(int &amount)
The total amount of channels on the backend.
Definition PVR.h:916
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:1011
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:1459
void TriggerEpgUpdate(unsigned int channelUid)
Callback to Kodi Function Schedule an EPG update for the given channel channel.
Definition PVR.h:1655
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:1579
virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag &tag, bool &isPlayable)
Check if the given EPG tag can be played.
Definition PVR.h:1492
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:1597
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:1557
int EpgMaxPastDays() const
Callback to Kodi Function Get the Max past days handled by Kodi.
Definition PVR.h:1631
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:1614
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:1516
virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag &tag, bool &isRecordable)
Check if the given EPG tag can be recorded.
Definition PVR.h:1477
int EpgMaxFutureDays() const
Callback to Kodi Function Get the Max future days handled by Kodi.
Definition PVR.h:1644
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:1693
virtual PVR_ERROR OnPowerSavingDeactivated()
To notify addon power saving on system is deactivated.
Definition PVR.h:2282
virtual PVR_ERROR OnPowerSavingActivated()
To notify addon power saving on system is activated.
Definition PVR.h:2274
virtual PVR_ERROR OnSystemSleep()
To notify addon about system sleep.
Definition PVR.h:2258
virtual PVR_ERROR OnSystemWake()
To notify addon about system wake up.
Definition PVR.h:2266
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:2010
virtual PVR_ERROR GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet &results)
Request the list of all recordings from the backend, if supported.
Definition PVR.h:1785
virtual PVR_ERROR RenameRecording(const kodi::addon::PVRRecording &recording)
Rename a recording on the backend.
Definition PVR.h:1839
virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording &recording, int64_t &size)
Retrieve the size of a recording on the backend.
Definition PVR.h:1946
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:1891
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:2028
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:1929
void TriggerRecordingUpdate()
Callback to Kodi Function Request Kodi to update it's list of recordings.
Definition PVR.h:2043
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:1988
virtual PVR_ERROR GetRecordingsAmount(bool deleted, int &amount)
To get amount of recording present on backend.
Definition PVR.h:1738
virtual PVR_ERROR SetRecordingLifetime(const kodi::addon::PVRRecording &recording)
Set the lifetime of a recording on the backend.
Definition PVR.h:1857
virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition PVR.h:1875
virtual PVR_ERROR UndeleteRecording(const kodi::addon::PVRRecording &recording)
Undelete a recording on the backend.
Definition PVR.h:1815
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:1908
virtual PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition PVR.h:1826
virtual PVR_ERROR DeleteRecording(const kodi::addon::PVRRecording &recording)
Delete a recording on the backend.
Definition PVR.h:1800
virtual int64_t SeekRecordedStream(int64_t streamId, int64_t position, int whence)
Seek in a recorded stream.
Definition PVR.h:2653
virtual bool OpenRecordedStream(const kodi::addon::PVRRecording &recording, int64_t &streamId)
Open a stream to a recording on the backend.
Definition PVR.h:2598
virtual PVR_ERROR GetRecordedStreamTimes(int64_t streamId, kodi::addon::PVRStreamTimes &times)
Get stream times.
Definition PVR.h:2722
virtual void CloseRecordedStream(int64_t streamId)
Close an open stream from a recording.
Definition PVR.h:2613
virtual PVR_ERROR PauseRecordedStream(int64_t streamId, bool paused)
Notify the pvr addon that Kodi (un)paused the currently playing stream.
Definition PVR.h:2702
virtual int64_t LengthRecordedStream(int64_t streamId)
Obtain the length of a recorded stream.
Definition PVR.h:2667
virtual int ReadRecordedStream(int64_t streamId, unsigned char *buffer, unsigned int size)
Read from a recording.
Definition PVR.h:2628
virtual PVR_ERROR IsRecordedStreamRealTime(int64_t streamId, bool &isRealTime)
Check for real-time streaming.
Definition PVR.h:2682
virtual PVR_ERROR StreamClosed()
The currently playing stream has been closed.
Definition PVR.h:2436
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:2422
virtual void DemuxReset()
Reset the demultiplexer in the add-on.
Definition PVR.h:2461
PVRCodec GetCodecByName(const std::string &codecName) const
Callback to Kodi Function Get the codec id used by Kodi.
Definition PVR.h:2526
DEMUX_PACKET * AllocateDemuxPacket(int iDataSize)
Callback to Kodi Function Allocate a demux packet. Free with FreeDemuxPacket().
Definition PVR.h:2542
void FreeDemuxPacket(DEMUX_PACKET *pPacket)
Callback to Kodi Function Free a packet that was allocated with AllocateDemuxPacket().
Definition PVR.h:2557
virtual DEMUX_PACKET * DemuxRead()
Read the next packet from the demultiplexer, if there is one.
Definition PVR.h:2453
virtual void DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition PVR.h:2469
virtual void DemuxFlush()
Flush all data that's currently in the demultiplexer buffer in the add-on.
Definition PVR.h:2478
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:2514
virtual void SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition PVR.h:2489
virtual void FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition PVR.h:2499
virtual void CloseLiveStream()
Close an open live stream.
Definition PVR.h:2346
virtual bool OpenLiveStream(const kodi::addon::PVRChannel &channel)
Open a live stream on the backend.
Definition PVR.h:2337
virtual int64_t SeekLiveStream(int64_t position, int whence)
Seek in a live stream on a backend that supports timeshifting.
Definition PVR.h:2379
virtual int ReadLiveStream(unsigned char *buffer, unsigned int size)
Read from an open live stream.
Definition PVR.h:2359
virtual int64_t LengthLiveStream()
Obtain the length of a live stream.
Definition PVR.h:2390
virtual PVR_ERROR GetStreamTimes(kodi::addon::PVRStreamTimes &times)
Get stream times.
Definition PVR.h:2801
virtual bool CanPauseStream()
Check if the backend support pausing the currently playing stream.
Definition PVR.h:2758
virtual bool IsRealTimeStream()
Check for real-time streaming.
Definition PVR.h:2791
virtual void PauseStream(bool paused)
Notify the pvr addon that Kodi (un)paused the currently playing stream.
Definition PVR.h:2782
virtual PVR_ERROR GetStreamReadChunkSize(int &chunksize)
Obtain the chunk size to use when reading streams.
Definition PVR.h:2818
virtual bool CanSeekStream()
Check if the backend supports seeking for the currently playing stream.
Definition PVR.h:2772
void TriggerTimerUpdate()
Callback to Kodi Function Request Kodi to update it's list of timers.
Definition PVR.h:2226
virtual PVR_ERROR UpdateTimer(const kodi::addon::PVRTimer &timer)
Update the timer information on the backend.
Definition PVR.h:2192
virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer &timer, bool forceDelete)
Delete a timer on the backend.
Definition PVR.h:2177
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:2213
virtual PVR_ERROR AddTimer(const kodi::addon::PVRTimer &timer)
Add a timer on the backend.
Definition PVR.h:2160
virtual PVR_ERROR GetTimers(kodi::addon::PVRTimersResultSet &results)
Request the list of all timers from the backend if supported.
Definition PVR.h:2145
virtual PVR_ERROR GetTimersAmount(int &amount)
To get total amount of timers on the backend or -1 on error.
Definition PVR.h:2105
virtual PVR_ERROR GetTimerTypes(std::vector< kodi::addon::PVRTimerType > &types)
Retrieve the timer types supported by the backend.
Definition PVR.h:2090
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:1345
virtual PVR_ERROR RenameChannel(const kodi::addon::PVRChannel &channel)
Rename a channel on the backend.
Definition PVR.h:1315
virtual PVR_ERROR OpenDialogChannelScan()
Show the channel scan dialog if this backend supports it.
Definition PVR.h:1359
virtual PVR_ERROR OpenDialogChannelSettings(const kodi::addon::PVRChannel &channel)
Show the channel settings dialog, if supported by the backend.
Definition PVR.h:1330
virtual PVR_ERROR DeleteChannel(const kodi::addon::PVRChannel &channel)
Delete a channel from the backend.
Definition PVR.h:1293
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:1376
virtual PVR_ERROR GetChannelGroupMembers(const kodi::addon::PVRChannelGroup &group, kodi::addon::PVRChannelGroupMembersResultSet &results)
Get a list of members on a group.
Definition PVR.h:1243
virtual PVR_ERROR GetChannelGroupsAmount(int &amount)
Get the total amount of channel groups on the backend if it supports channel groups.
Definition PVR.h:1132
void TriggerChannelGroupsUpdate()
Callback to Kodi Function Request Kodi to update it's list of channel groups.
Definition PVR.h:1256
virtual PVR_ERROR GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet &results)
Get a list of available channel groups on addon.
Definition PVR.h:1180
void ATTR_DLL_LOCAL Log(const ADDON_LOG loglevel, const char *format,...)
Add a message to Kodi's log.
Definition AddonBase.h:1939
Definition pvr.h:362
"C" PVR add-on channel group member.
Definition pvr_epg.h:623
Definition addon_base.h:269
"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