Kodi Development 19.0
for Binary and Script based Add-Ons
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/Recordings.h"
19#include "pvr/Stream.h"
20#include "pvr/Timers.h"
21
22#ifdef __cplusplus
23
48namespace kodi
49{
50namespace addon
51{
52
53//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
54// "C++" Doxygen group set for the definitions
55//{{{
56
57//==============================================================================
67
68//##############################################################################
83//##############################################################################
96//------------------------------------------------------------------------------
98
99//##############################################################################
115//------------------------------------------------------------------------------
116
117//##############################################################################
124//------------------------------------------------------------------------------
125
126//##############################################################################
135//------------------------------------------------------------------------------
136
137//##############################################################################
144//------------------------------------------------------------------------------
145
146//##############################################################################
153//------------------------------------------------------------------------------
154
155//##############################################################################
161//------------------------------------------------------------------------------
162
163//##############################################################################
171//------------------------------------------------------------------------------
172
173//##############################################################################
186//------------------------------------------------------------------------------
187
188//}}}
189//______________________________________________________________________________
190
191//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
192// "C++" PVR addon instance class
193//{{{
194
195//==============================================================================
384class ATTRIBUTE_HIDDEN CInstancePVRClient : public IAddonInstance
385{
386public:
387 //============================================================================
409
410 //============================================================================
443 {
444 if (CAddonBase::m_interface->globalSingleInstance != nullptr)
445 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of more as one in single "
446 "instance way is not allowed!");
447
448 SetAddonStruct(CAddonBase::m_interface->firstKodiInstance, m_kodiVersion);
449 CAddonBase::m_interface->globalSingleInstance = this;
450 }
451 //----------------------------------------------------------------------------
452
453 //============================================================================
493 explicit CInstancePVRClient(KODI_HANDLE instance, const std::string& kodiVersion = "")
495 !kodiVersion.empty() ? kodiVersion : GetKodiTypeVersion(ADDON_INSTANCE_PVR))
496 {
497 if (CAddonBase::m_interface->globalSingleInstance != nullptr)
498 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of multiple together with "
499 "single instance way is not allowed!");
500
501 SetAddonStruct(instance, m_kodiVersion);
502 }
503 //----------------------------------------------------------------------------
504
505 //============================================================================
508 ~CInstancePVRClient() override = default;
509 //----------------------------------------------------------------------------
510
511 //--==----==----==----==----==----==----==----==----==----==----==----==----==
512
513 //============================================================================
545 //----------------------------------------------------------------------------
546
547 //============================================================================
569 virtual PVR_ERROR GetBackendName(std::string& name) = 0;
570 //----------------------------------------------------------------------------
571
572 //============================================================================
596 virtual PVR_ERROR GetBackendVersion(std::string& version) = 0;
597 //----------------------------------------------------------------------------
598
599 //============================================================================
606 virtual PVR_ERROR GetBackendHostname(std::string& hostname) { return PVR_ERROR_NOT_IMPLEMENTED; }
607 //----------------------------------------------------------------------------
608
609 //============================================================================
617 virtual PVR_ERROR GetConnectionString(std::string& connection)
618 {
620 }
621 //----------------------------------------------------------------------------
622
623 //============================================================================
644 virtual PVR_ERROR GetDriveSpace(uint64_t& total, uint64_t& used)
645 {
647 }
648 //----------------------------------------------------------------------------
649
650 //============================================================================
678 {
680 }
681 //----------------------------------------------------------------------------
682
683 //==========================================================================
732 inline void AddMenuHook(const kodi::addon::PVRMenuhook& hook)
733 {
734 m_instanceData->toKodi->AddMenuHook(m_instanceData->toKodi->kodiInstance, hook);
735 }
736 //----------------------------------------------------------------------------
737
738 //==========================================================================
766 inline void ConnectionStateChange(const std::string& connectionString,
767 PVR_CONNECTION_STATE newState,
768 const std::string& message)
769 {
770 m_instanceData->toKodi->ConnectionStateChange(
771 m_instanceData->toKodi->kodiInstance, connectionString.c_str(), newState, message.c_str());
772 }
773 //----------------------------------------------------------------------------
774
775 //==========================================================================
785 inline std::string UserPath() const { return m_instanceData->props->strUserPath; }
786 //----------------------------------------------------------------------------
787
788 //==========================================================================
798 inline std::string ClientPath() const { return m_instanceData->props->strClientPath; }
799 //----------------------------------------------------------------------------
800
802 //--==----==----==----==----==----==----==----==----==----==----==----==----==
803
804 //============================================================================
828
829 //============================================================================
838 //----------------------------------------------------------------------------
839
840 //============================================================================
887 {
889 }
890 //----------------------------------------------------------------------------
891
892 //============================================================================
929 const kodi::addon::PVRChannel& channel,
930 std::vector<kodi::addon::PVRStreamProperty>& properties)
931 {
933 }
934 //----------------------------------------------------------------------------
935
936 //============================================================================
977 virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus& signalStatus)
978 {
980 }
981 //----------------------------------------------------------------------------
982
983 //============================================================================
997 virtual PVR_ERROR GetDescrambleInfo(int channelUid,
998 kodi::addon::PVRDescrambleInfo& descrambleInfo)
999 {
1001 }
1002 //----------------------------------------------------------------------------
1003
1004 //============================================================================
1011 {
1012 m_instanceData->toKodi->TriggerChannelUpdate(m_instanceData->toKodi->kodiInstance);
1013 }
1014 //----------------------------------------------------------------------------
1015
1017 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1018
1019 //============================================================================
1038
1039 //============================================================================
1048 //----------------------------------------------------------------------------
1049
1050 //============================================================================
1096 {
1098 }
1099 //----------------------------------------------------------------------------
1100
1101 //============================================================================
1160 {
1162 }
1163 //----------------------------------------------------------------------------
1164
1165 //============================================================================
1172 {
1173 m_instanceData->toKodi->TriggerChannelGroupsUpdate(m_instanceData->toKodi->kodiInstance);
1174 }
1175 //----------------------------------------------------------------------------
1176
1178 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1179
1180 //============================================================================
1199
1200 //============================================================================
1209 {
1211 }
1212 //----------------------------------------------------------------------------
1213
1214 //==========================================================================
1231 {
1233 }
1234 //----------------------------------------------------------------------------
1235
1236 //==========================================================================
1246 {
1248 }
1249 //----------------------------------------------------------------------------
1250
1251 //==========================================================================
1261 {
1263 }
1264 //----------------------------------------------------------------------------
1265
1266 //==========================================================================
1275 //----------------------------------------------------------------------------
1276
1277 //==========================================================================
1292 const kodi::addon::PVRChannel& item)
1293 {
1295 }
1296 //----------------------------------------------------------------------------
1297
1299 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1300
1301 //============================================================================
1324
1325 //============================================================================
1374 virtual PVR_ERROR GetEPGForChannel(int channelUid,
1375 time_t start,
1376 time_t end,
1378 {
1380 }
1381 //----------------------------------------------------------------------------
1382
1383 //============================================================================
1392 virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable)
1393 {
1395 }
1396 //----------------------------------------------------------------------------
1397
1398 //============================================================================
1407 virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag& tag, bool& isPlayable)
1408 {
1410 }
1411 //----------------------------------------------------------------------------
1412
1413 //============================================================================
1432 std::vector<kodi::addon::PVREDLEntry>& edl)
1433 {
1435 }
1436 //----------------------------------------------------------------------------
1437
1438 //============================================================================
1473 const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVRStreamProperty>& properties)
1474 {
1476 }
1477 //----------------------------------------------------------------------------
1478
1479 //============================================================================
1495 //----------------------------------------------------------------------------
1496
1497 //============================================================================
1512 virtual PVR_ERROR SetEPGMaxFutureDays(int futureDays) { return PVR_ERROR_NOT_IMPLEMENTED; }
1513 //----------------------------------------------------------------------------
1514
1515 //==========================================================================
1530 const kodi::addon::PVREPGTag& tag)
1531 {
1533 }
1534 //----------------------------------------------------------------------------
1535
1536 //==========================================================================
1546 inline int EpgMaxPastDays() const { return m_instanceData->props->iEpgMaxPastDays; }
1547 //----------------------------------------------------------------------------
1548
1549 //==========================================================================
1559 inline int EpgMaxFutureDays() const { return m_instanceData->props->iEpgMaxFutureDays; }
1560 //----------------------------------------------------------------------------
1561
1562 //==========================================================================
1570 inline void TriggerEpgUpdate(unsigned int channelUid)
1571 {
1572 m_instanceData->toKodi->TriggerEpgUpdate(m_instanceData->toKodi->kodiInstance, channelUid);
1573 }
1574 //----------------------------------------------------------------------------
1575
1576 //==========================================================================
1609 {
1610 m_instanceData->toKodi->EpgEventStateChange(m_instanceData->toKodi->kodiInstance, tag.GetTag(),
1611 newState);
1612 }
1613 //----------------------------------------------------------------------------
1614
1616 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1617
1618 //============================================================================
1641
1642 //============================================================================
1653 virtual PVR_ERROR GetRecordingsAmount(bool deleted, int& amount)
1654 {
1656 }
1657 //----------------------------------------------------------------------------
1658
1659 //============================================================================
1701 {
1703 }
1704 //----------------------------------------------------------------------------
1705
1706 //============================================================================
1716 {
1718 }
1719 //----------------------------------------------------------------------------
1720
1721 //============================================================================
1731 {
1733 }
1734 //----------------------------------------------------------------------------
1735
1736 //============================================================================
1742 //----------------------------------------------------------------------------
1743
1744 //============================================================================
1755 {
1757 }
1758 //----------------------------------------------------------------------------
1759
1760 //============================================================================
1773 {
1775 }
1776 //----------------------------------------------------------------------------
1777
1778 //============================================================================
1790 virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording& recording, int count)
1791 {
1793 }
1794 //----------------------------------------------------------------------------
1795
1796 //============================================================================
1807 int lastplayedposition)
1808 {
1810 }
1811 //----------------------------------------------------------------------------
1812
1813 //============================================================================
1824 int& position)
1825 {
1827 }
1828 //----------------------------------------------------------------------------
1829
1830 //============================================================================
1845 std::vector<kodi::addon::PVREDLEntry>& edl)
1846 {
1848 }
1849 //----------------------------------------------------------------------------
1850
1851 //============================================================================
1861 virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording& recording, int64_t& size)
1862 {
1864 }
1865 //----------------------------------------------------------------------------
1866
1867 //============================================================================
1904 const kodi::addon::PVRRecording& recording,
1905 std::vector<kodi::addon::PVRStreamProperty>& properties)
1906 {
1908 }
1909 //----------------------------------------------------------------------------
1910
1911 //==========================================================================
1926 const kodi::addon::PVRRecording& item)
1927 {
1929 }
1930 //----------------------------------------------------------------------------
1931
1932 //============================================================================
1943 inline void RecordingNotification(const std::string& recordingName,
1944 const std::string& fileName,
1945 bool on)
1946 {
1947 m_instanceData->toKodi->RecordingNotification(m_instanceData->toKodi->kodiInstance,
1948 recordingName.c_str(), fileName.c_str(), on);
1949 }
1950 //----------------------------------------------------------------------------
1951
1952 //============================================================================
1959 {
1960 m_instanceData->toKodi->TriggerRecordingUpdate(m_instanceData->toKodi->kodiInstance);
1961 }
1962 //----------------------------------------------------------------------------
1963
1965 //--==----==----==----==----==----==----==----==----==----==----==----==----==
1966
1967 //============================================================================
1989
1990 //============================================================================
2005 virtual PVR_ERROR GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
2006 {
2008 }
2009 //----------------------------------------------------------------------------
2010
2011 //============================================================================
2020 virtual PVR_ERROR GetTimersAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
2021 //----------------------------------------------------------------------------
2022
2023 //============================================================================
2061 {
2063 }
2064 //----------------------------------------------------------------------------
2065
2066 //============================================================================
2076 {
2078 }
2079 //----------------------------------------------------------------------------
2080
2081 //============================================================================
2092 virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer& timer, bool forceDelete)
2093 {
2095 }
2096 //----------------------------------------------------------------------------
2097
2098 //============================================================================
2108 {
2110 }
2111 //----------------------------------------------------------------------------
2112
2113 //============================================================================
2129 const kodi::addon::PVRTimer& item)
2130 {
2132 }
2133 //----------------------------------------------------------------------------
2134
2135 //============================================================================
2142 {
2143 m_instanceData->toKodi->TriggerTimerUpdate(m_instanceData->toKodi->kodiInstance);
2144 }
2145 //----------------------------------------------------------------------------
2146
2148 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2149
2150 //============================================================================
2167
2168 //============================================================================
2174 //----------------------------------------------------------------------------
2175
2176 //============================================================================
2182 //----------------------------------------------------------------------------
2183
2184 //============================================================================
2190 //----------------------------------------------------------------------------
2191
2192 //============================================================================
2198 //----------------------------------------------------------------------------
2199
2201 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2202
2203 //============================================================================
2215
2216 //============================================================================
2233
2234 //============================================================================
2252 virtual bool OpenLiveStream(const kodi::addon::PVRChannel& channel) { return false; }
2253 //----------------------------------------------------------------------------
2254
2255 //============================================================================
2261 virtual void CloseLiveStream() {}
2262 //----------------------------------------------------------------------------
2263
2264 //============================================================================
2274 virtual int ReadLiveStream(unsigned char* buffer, unsigned int size) { return 0; }
2275 //----------------------------------------------------------------------------
2276
2277 //============================================================================
2294 virtual int64_t SeekLiveStream(int64_t position, int whence) { return 0; }
2295 //----------------------------------------------------------------------------
2296
2297 //============================================================================
2305 virtual int64_t LengthLiveStream() { return 0; }
2306 //----------------------------------------------------------------------------
2307
2308 //============================================================================
2328
2329 //============================================================================
2337 virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
2338 {
2340 }
2341 //----------------------------------------------------------------------------
2342
2343 //============================================================================
2357 virtual DEMUX_PACKET* DemuxRead() { return nullptr; }
2358 //----------------------------------------------------------------------------
2359
2360 //============================================================================
2365 virtual void DemuxReset() {}
2366 //----------------------------------------------------------------------------
2367
2368 //============================================================================
2373 virtual void DemuxAbort() {}
2374 //----------------------------------------------------------------------------
2375
2376 //============================================================================
2382 virtual void DemuxFlush() {}
2383 //----------------------------------------------------------------------------
2384
2385 //============================================================================
2393 virtual void SetSpeed(int speed) {}
2394 //----------------------------------------------------------------------------
2395
2396 //============================================================================
2403 virtual void FillBuffer(bool mode) {}
2404 //----------------------------------------------------------------------------
2405
2406 //============================================================================
2418 virtual bool SeekTime(double time, bool backwards, double& startpts) { return false; }
2419 //----------------------------------------------------------------------------
2420
2421 //============================================================================
2430 inline PVRCodec GetCodecByName(const std::string& codecName) const
2431 {
2432 return PVRCodec(m_instanceData->toKodi->GetCodecByName(m_instanceData->toKodi->kodiInstance,
2433 codecName.c_str()));
2434 }
2435 //----------------------------------------------------------------------------
2436
2437 //============================================================================
2446 inline DEMUX_PACKET* AllocateDemuxPacket(int iDataSize)
2447 {
2448 return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance,
2449 iDataSize);
2450 }
2451 //----------------------------------------------------------------------------
2452
2453 //============================================================================
2461 inline void FreeDemuxPacket(DEMUX_PACKET* pPacket)
2462 {
2463 m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket);
2464 }
2465 //----------------------------------------------------------------------------
2467
2469 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2470
2471 //============================================================================
2490
2491 //============================================================================
2501 virtual bool OpenRecordedStream(const kodi::addon::PVRRecording& recording) { return false; }
2502 //----------------------------------------------------------------------------
2503
2504 //============================================================================
2510 virtual void CloseRecordedStream() {}
2511 //----------------------------------------------------------------------------
2512
2513 //============================================================================
2523 virtual int ReadRecordedStream(unsigned char* buffer, unsigned int size) { return 0; }
2524 //----------------------------------------------------------------------------
2525
2526 //============================================================================
2543 virtual int64_t SeekRecordedStream(int64_t position, int whence) { return 0; }
2544 //----------------------------------------------------------------------------
2545
2546 //============================================================================
2554 virtual int64_t LengthRecordedStream() { return 0; }
2555 //----------------------------------------------------------------------------
2556
2558 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2559
2560 //============================================================================
2578
2579 //============================================================================
2589 virtual bool CanPauseStream() { return false; }
2590 //----------------------------------------------------------------------------
2591
2592 //============================================================================
2603 virtual bool CanSeekStream() { return false; }
2604 //----------------------------------------------------------------------------
2605
2606 //============================================================================
2613 virtual void PauseStream(bool paused) {}
2614 //----------------------------------------------------------------------------
2615
2616 //============================================================================
2622 virtual bool IsRealTimeStream() { return false; }
2623 //----------------------------------------------------------------------------
2624
2625 //============================================================================
2633 {
2635 }
2636 //----------------------------------------------------------------------------
2637
2638 //============================================================================
2650 //----------------------------------------------------------------------------
2651
2653 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2654
2655private:
2656 void SetAddonStruct(KODI_HANDLE instance, const std::string& kodiVersion)
2657 {
2658 if (instance == nullptr)
2659 throw std::logic_error("kodi::addon::CInstancePVRClient: Creation with empty addon "
2660 "structure not allowed, table must be given from Kodi!");
2661
2662 m_instanceData = static_cast<AddonInstance_PVR*>(instance);
2663 m_instanceData->toAddon->addonInstance = this;
2664 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2665 m_instanceData->toAddon->GetCapabilities = ADDON_GetCapabilities;
2666 m_instanceData->toAddon->GetConnectionString = ADDON_GetConnectionString;
2667 m_instanceData->toAddon->GetBackendName = ADDON_GetBackendName;
2668 m_instanceData->toAddon->GetBackendVersion = ADDON_GetBackendVersion;
2669 m_instanceData->toAddon->GetBackendHostname = ADDON_GetBackendHostname;
2670 m_instanceData->toAddon->GetDriveSpace = ADDON_GetDriveSpace;
2671 m_instanceData->toAddon->CallSettingsMenuHook = ADDON_CallSettingsMenuHook;
2672 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2673 m_instanceData->toAddon->GetChannelsAmount = ADDON_GetChannelsAmount;
2674 m_instanceData->toAddon->GetChannels = ADDON_GetChannels;
2675 m_instanceData->toAddon->GetChannelStreamProperties = ADDON_GetChannelStreamProperties;
2676 m_instanceData->toAddon->GetSignalStatus = ADDON_GetSignalStatus;
2677 m_instanceData->toAddon->GetDescrambleInfo = ADDON_GetDescrambleInfo;
2678 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2679 m_instanceData->toAddon->GetChannelGroupsAmount = ADDON_GetChannelGroupsAmount;
2680 m_instanceData->toAddon->GetChannelGroups = ADDON_GetChannelGroups;
2681 m_instanceData->toAddon->GetChannelGroupMembers = ADDON_GetChannelGroupMembers;
2682 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2683 m_instanceData->toAddon->DeleteChannel = ADDON_DeleteChannel;
2684 m_instanceData->toAddon->RenameChannel = ADDON_RenameChannel;
2685 m_instanceData->toAddon->OpenDialogChannelSettings = ADDON_OpenDialogChannelSettings;
2686 m_instanceData->toAddon->OpenDialogChannelAdd = ADDON_OpenDialogChannelAdd;
2687 m_instanceData->toAddon->OpenDialogChannelScan = ADDON_OpenDialogChannelScan;
2688 m_instanceData->toAddon->CallChannelMenuHook = ADDON_CallChannelMenuHook;
2689 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2690 m_instanceData->toAddon->GetEPGForChannel = ADDON_GetEPGForChannel;
2691 m_instanceData->toAddon->IsEPGTagRecordable = ADDON_IsEPGTagRecordable;
2692 m_instanceData->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable;
2693 m_instanceData->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl;
2694 m_instanceData->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties;
2695 m_instanceData->toAddon->SetEPGMaxPastDays = ADDON_SetEPGMaxPastDays;
2696 m_instanceData->toAddon->SetEPGMaxFutureDays = ADDON_SetEPGMaxFutureDays;
2697 m_instanceData->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook;
2698 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2699 m_instanceData->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount;
2700 m_instanceData->toAddon->GetRecordings = ADDON_GetRecordings;
2701 m_instanceData->toAddon->DeleteRecording = ADDON_DeleteRecording;
2702 m_instanceData->toAddon->UndeleteRecording = ADDON_UndeleteRecording;
2703 m_instanceData->toAddon->DeleteAllRecordingsFromTrash = ADDON_DeleteAllRecordingsFromTrash;
2704 m_instanceData->toAddon->RenameRecording = ADDON_RenameRecording;
2705 m_instanceData->toAddon->SetRecordingLifetime = ADDON_SetRecordingLifetime;
2706 m_instanceData->toAddon->SetRecordingPlayCount = ADDON_SetRecordingPlayCount;
2707 m_instanceData->toAddon->SetRecordingLastPlayedPosition = ADDON_SetRecordingLastPlayedPosition;
2708 m_instanceData->toAddon->GetRecordingLastPlayedPosition = ADDON_GetRecordingLastPlayedPosition;
2709 m_instanceData->toAddon->GetRecordingEdl = ADDON_GetRecordingEdl;
2710 m_instanceData->toAddon->GetRecordingSize = ADDON_GetRecordingSize;
2711 m_instanceData->toAddon->GetRecordingStreamProperties = ADDON_GetRecordingStreamProperties;
2712 m_instanceData->toAddon->CallRecordingMenuHook = ADDON_CallRecordingMenuHook;
2713 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2714 m_instanceData->toAddon->GetTimerTypes = ADDON_GetTimerTypes;
2715 m_instanceData->toAddon->GetTimersAmount = ADDON_GetTimersAmount;
2716 m_instanceData->toAddon->GetTimers = ADDON_GetTimers;
2717 m_instanceData->toAddon->AddTimer = ADDON_AddTimer;
2718 m_instanceData->toAddon->DeleteTimer = ADDON_DeleteTimer;
2719 m_instanceData->toAddon->UpdateTimer = ADDON_UpdateTimer;
2720 m_instanceData->toAddon->CallTimerMenuHook = ADDON_CallTimerMenuHook;
2721 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2722 m_instanceData->toAddon->OnSystemSleep = ADDON_OnSystemSleep;
2723 m_instanceData->toAddon->OnSystemWake = ADDON_OnSystemWake;
2724 m_instanceData->toAddon->OnPowerSavingActivated = ADDON_OnPowerSavingActivated;
2725 m_instanceData->toAddon->OnPowerSavingDeactivated = ADDON_OnPowerSavingDeactivated;
2726 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2727 m_instanceData->toAddon->OpenLiveStream = ADDON_OpenLiveStream;
2728 m_instanceData->toAddon->CloseLiveStream = ADDON_CloseLiveStream;
2729 m_instanceData->toAddon->ReadLiveStream = ADDON_ReadLiveStream;
2730 m_instanceData->toAddon->SeekLiveStream = ADDON_SeekLiveStream;
2731 m_instanceData->toAddon->LengthLiveStream = ADDON_LengthLiveStream;
2732 m_instanceData->toAddon->GetStreamProperties = ADDON_GetStreamProperties;
2733 m_instanceData->toAddon->GetStreamReadChunkSize = ADDON_GetStreamReadChunkSize;
2734 m_instanceData->toAddon->IsRealTimeStream = ADDON_IsRealTimeStream;
2735 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2736 m_instanceData->toAddon->OpenRecordedStream = ADDON_OpenRecordedStream;
2737 m_instanceData->toAddon->CloseRecordedStream = ADDON_CloseRecordedStream;
2738 m_instanceData->toAddon->ReadRecordedStream = ADDON_ReadRecordedStream;
2739 m_instanceData->toAddon->SeekRecordedStream = ADDON_SeekRecordedStream;
2740 m_instanceData->toAddon->LengthRecordedStream = ADDON_LengthRecordedStream;
2741 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2742 m_instanceData->toAddon->DemuxReset = ADDON_DemuxReset;
2743 m_instanceData->toAddon->DemuxAbort = ADDON_DemuxAbort;
2744 m_instanceData->toAddon->DemuxFlush = ADDON_DemuxFlush;
2745 m_instanceData->toAddon->DemuxRead = ADDON_DemuxRead;
2746 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2747 m_instanceData->toAddon->CanPauseStream = ADDON_CanPauseStream;
2748 m_instanceData->toAddon->PauseStream = ADDON_PauseStream;
2749 m_instanceData->toAddon->CanSeekStream = ADDON_CanSeekStream;
2750 m_instanceData->toAddon->SeekTime = ADDON_SeekTime;
2751 m_instanceData->toAddon->SetSpeed = ADDON_SetSpeed;
2752 m_instanceData->toAddon->FillBuffer = ADDON_FillBuffer;
2753 m_instanceData->toAddon->GetStreamTimes = ADDON_GetStreamTimes;
2754 }
2755
2756 inline static PVR_ERROR ADDON_GetCapabilities(const AddonInstance_PVR* instance,
2757 PVR_ADDON_CAPABILITIES* capabilities)
2758 {
2759 PVRCapabilities cppCapabilities(capabilities);
2760 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2761 ->GetCapabilities(cppCapabilities);
2762 }
2763
2764 inline static PVR_ERROR ADDON_GetBackendName(const AddonInstance_PVR* instance,
2765 char* str,
2766 int memSize)
2767 {
2768 std::string backendName;
2769 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2770 ->GetBackendName(backendName);
2771 if (err == PVR_ERROR_NO_ERROR)
2772 strncpy(str, backendName.c_str(), memSize);
2773 return err;
2774 }
2775
2776 inline static PVR_ERROR ADDON_GetBackendVersion(const AddonInstance_PVR* instance,
2777 char* str,
2778 int memSize)
2779 {
2780 std::string backendVersion;
2781 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2782 ->GetBackendVersion(backendVersion);
2783 if (err == PVR_ERROR_NO_ERROR)
2784 strncpy(str, backendVersion.c_str(), memSize);
2785 return err;
2786 }
2787
2788 inline static PVR_ERROR ADDON_GetBackendHostname(const AddonInstance_PVR* instance,
2789 char* str,
2790 int memSize)
2791 {
2792 std::string backendHostname;
2793 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2794 ->GetBackendHostname(backendHostname);
2795 if (err == PVR_ERROR_NO_ERROR)
2796 strncpy(str, backendHostname.c_str(), memSize);
2797 return err;
2798 }
2799
2800 inline static PVR_ERROR ADDON_GetConnectionString(const AddonInstance_PVR* instance,
2801 char* str,
2802 int memSize)
2803 {
2804 std::string connectionString;
2805 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2806 ->GetConnectionString(connectionString);
2807 if (err == PVR_ERROR_NO_ERROR)
2808 strncpy(str, connectionString.c_str(), memSize);
2809 return err;
2810 }
2811
2812 inline static PVR_ERROR ADDON_GetDriveSpace(const AddonInstance_PVR* instance,
2813 uint64_t* total,
2814 uint64_t* used)
2815 {
2816 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2817 ->GetDriveSpace(*total, *used);
2818 }
2819
2820 inline static PVR_ERROR ADDON_CallSettingsMenuHook(const AddonInstance_PVR* instance,
2821 const PVR_MENUHOOK* menuhook)
2822 {
2823 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2824 ->CallSettingsMenuHook(menuhook);
2825 }
2826
2827 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2828
2829 inline static PVR_ERROR ADDON_GetChannelsAmount(const AddonInstance_PVR* instance, int* amount)
2830 {
2831 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2832 ->GetChannelsAmount(*amount);
2833 }
2834
2835 inline static PVR_ERROR ADDON_GetChannels(const AddonInstance_PVR* instance,
2836 ADDON_HANDLE handle,
2837 bool radio)
2838 {
2839 PVRChannelsResultSet result(instance, handle);
2840 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2841 ->GetChannels(radio, result);
2842 }
2843
2844 inline static PVR_ERROR ADDON_GetChannelStreamProperties(const AddonInstance_PVR* instance,
2845 const PVR_CHANNEL* channel,
2846 PVR_NAMED_VALUE* properties,
2847 unsigned int* propertiesCount)
2848 {
2849 *propertiesCount = 0;
2850 std::vector<PVRStreamProperty> propertiesList;
2851 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2852 ->GetChannelStreamProperties(channel, propertiesList);
2853 if (error == PVR_ERROR_NO_ERROR)
2854 {
2855 for (const auto& property : propertiesList)
2856 {
2857 strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
2858 sizeof(properties[*propertiesCount].strName) - 1);
2859 strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
2860 sizeof(properties[*propertiesCount].strValue) - 1);
2861 ++*propertiesCount;
2862 if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
2863 break;
2864 }
2865 }
2866 return error;
2867 }
2868
2869 inline static PVR_ERROR ADDON_GetSignalStatus(const AddonInstance_PVR* instance,
2870 int channelUid,
2871 PVR_SIGNAL_STATUS* signalStatus)
2872 {
2873 PVRSignalStatus cppSignalStatus(signalStatus);
2874 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2875 ->GetSignalStatus(channelUid, cppSignalStatus);
2876 }
2877
2878 inline static PVR_ERROR ADDON_GetDescrambleInfo(const AddonInstance_PVR* instance,
2879 int channelUid,
2880 PVR_DESCRAMBLE_INFO* descrambleInfo)
2881 {
2882 PVRDescrambleInfo cppDescrambleInfo(descrambleInfo);
2883 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2884 ->GetDescrambleInfo(channelUid, cppDescrambleInfo);
2885 }
2886
2887 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2888
2889 inline static PVR_ERROR ADDON_GetChannelGroupsAmount(const AddonInstance_PVR* instance,
2890 int* amount)
2891 {
2892 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2893 ->GetChannelGroupsAmount(*amount);
2894 }
2895
2896 inline static PVR_ERROR ADDON_GetChannelGroups(const AddonInstance_PVR* instance,
2897 ADDON_HANDLE handle,
2898 bool radio)
2899 {
2900 PVRChannelGroupsResultSet result(instance, handle);
2901 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2902 ->GetChannelGroups(radio, result);
2903 }
2904
2905 inline static PVR_ERROR ADDON_GetChannelGroupMembers(const AddonInstance_PVR* instance,
2906 ADDON_HANDLE handle,
2907 const PVR_CHANNEL_GROUP* group)
2908 {
2909 PVRChannelGroupMembersResultSet result(instance, handle);
2910 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2911 ->GetChannelGroupMembers(group, result);
2912 }
2913
2914 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2915
2916 inline static PVR_ERROR ADDON_DeleteChannel(const AddonInstance_PVR* instance,
2917 const PVR_CHANNEL* channel)
2918 {
2919 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2920 ->DeleteChannel(channel);
2921 }
2922
2923 inline static PVR_ERROR ADDON_RenameChannel(const AddonInstance_PVR* instance,
2924 const PVR_CHANNEL* channel)
2925 {
2926 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2927 ->RenameChannel(channel);
2928 }
2929
2930 inline static PVR_ERROR ADDON_OpenDialogChannelSettings(const AddonInstance_PVR* instance,
2931 const PVR_CHANNEL* channel)
2932 {
2933 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2934 ->OpenDialogChannelSettings(channel);
2935 }
2936
2937 inline static PVR_ERROR ADDON_OpenDialogChannelAdd(const AddonInstance_PVR* instance,
2938 const PVR_CHANNEL* channel)
2939 {
2940 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2941 ->OpenDialogChannelAdd(channel);
2942 }
2943
2944 inline static PVR_ERROR ADDON_OpenDialogChannelScan(const AddonInstance_PVR* instance)
2945 {
2946 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2947 ->OpenDialogChannelScan();
2948 }
2949
2950 inline static PVR_ERROR ADDON_CallChannelMenuHook(const AddonInstance_PVR* instance,
2951 const PVR_MENUHOOK* menuhook,
2952 const PVR_CHANNEL* channel)
2953 {
2954 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2955 ->CallChannelMenuHook(menuhook, channel);
2956 }
2957
2958 //--==----==----==----==----==----==----==----==----==----==----==----==----==
2959
2960 inline static PVR_ERROR ADDON_GetEPGForChannel(const AddonInstance_PVR* instance,
2961 ADDON_HANDLE handle,
2962 int channelUid,
2963 time_t start,
2964 time_t end)
2965 {
2966 PVREPGTagsResultSet result(instance, handle);
2967 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2968 ->GetEPGForChannel(channelUid, start, end, result);
2969 }
2970
2971 inline static PVR_ERROR ADDON_IsEPGTagRecordable(const AddonInstance_PVR* instance,
2972 const EPG_TAG* tag,
2973 bool* isRecordable)
2974 {
2975 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2976 ->IsEPGTagRecordable(tag, *isRecordable);
2977 }
2978
2979 inline static PVR_ERROR ADDON_IsEPGTagPlayable(const AddonInstance_PVR* instance,
2980 const EPG_TAG* tag,
2981 bool* isPlayable)
2982 {
2983 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2984 ->IsEPGTagPlayable(tag, *isPlayable);
2985 }
2986
2987 inline static PVR_ERROR ADDON_GetEPGTagEdl(const AddonInstance_PVR* instance,
2988 const EPG_TAG* tag,
2989 PVR_EDL_ENTRY* edl,
2990 int* size)
2991 {
2992 *size = 0;
2993 std::vector<PVREDLEntry> edlList;
2994 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
2995 ->GetEPGTagEdl(tag, edlList);
2996 if (error == PVR_ERROR_NO_ERROR)
2997 {
2998 for (const auto& edlEntry : edlList)
2999 {
3000 edl[*size] = *edlEntry;
3001 ++*size;
3002 }
3003 }
3004 return error;
3005 }
3006
3007 inline static PVR_ERROR ADDON_GetEPGTagStreamProperties(const AddonInstance_PVR* instance,
3008 const EPG_TAG* tag,
3009 PVR_NAMED_VALUE* properties,
3010 unsigned int* propertiesCount)
3011 {
3012 *propertiesCount = 0;
3013 std::vector<PVRStreamProperty> propertiesList;
3014 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3015 ->GetEPGTagStreamProperties(tag, propertiesList);
3016 if (error == PVR_ERROR_NO_ERROR)
3017 {
3018 for (const auto& property : propertiesList)
3019 {
3020 strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
3021 sizeof(properties[*propertiesCount].strName) - 1);
3022 strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
3023 sizeof(properties[*propertiesCount].strValue) - 1);
3024 ++*propertiesCount;
3025 if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
3026 break;
3027 }
3028 }
3029 return error;
3030 }
3031
3032 inline static PVR_ERROR ADDON_SetEPGMaxPastDays(const AddonInstance_PVR* instance, int pastDays)
3033 {
3034 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3035 ->SetEPGMaxPastDays(pastDays);
3036 }
3037
3038 inline static PVR_ERROR ADDON_SetEPGMaxFutureDays(const AddonInstance_PVR* instance,
3039 int futureDays)
3040 {
3041 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3042 ->SetEPGMaxFutureDays(futureDays);
3043 }
3044
3045 inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance,
3046 const PVR_MENUHOOK* menuhook,
3047 const EPG_TAG* tag)
3048 {
3049 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3050 ->CallEPGMenuHook(menuhook, tag);
3051 }
3052
3053 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3054
3055 inline static PVR_ERROR ADDON_GetRecordingsAmount(const AddonInstance_PVR* instance,
3056 bool deleted,
3057 int* amount)
3058 {
3059 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3060 ->GetRecordingsAmount(deleted, *amount);
3061 }
3062
3063 inline static PVR_ERROR ADDON_GetRecordings(const AddonInstance_PVR* instance,
3064 ADDON_HANDLE handle,
3065 bool deleted)
3066 {
3067 PVRRecordingsResultSet result(instance, handle);
3068 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3069 ->GetRecordings(deleted, result);
3070 }
3071
3072 inline static PVR_ERROR ADDON_DeleteRecording(const AddonInstance_PVR* instance,
3073 const PVR_RECORDING* recording)
3074 {
3075 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3076 ->DeleteRecording(recording);
3077 }
3078
3079 inline static PVR_ERROR ADDON_UndeleteRecording(const AddonInstance_PVR* instance,
3080 const PVR_RECORDING* recording)
3081 {
3082 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3083 ->UndeleteRecording(recording);
3084 }
3085
3086 inline static PVR_ERROR ADDON_DeleteAllRecordingsFromTrash(const AddonInstance_PVR* instance)
3087 {
3088 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3089 ->DeleteAllRecordingsFromTrash();
3090 }
3091
3092 inline static PVR_ERROR ADDON_RenameRecording(const AddonInstance_PVR* instance,
3093 const PVR_RECORDING* recording)
3094 {
3095 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3096 ->RenameRecording(recording);
3097 }
3098
3099 inline static PVR_ERROR ADDON_SetRecordingLifetime(const AddonInstance_PVR* instance,
3100 const PVR_RECORDING* recording)
3101 {
3102 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3103 ->SetRecordingLifetime(recording);
3104 }
3105
3106 inline static PVR_ERROR ADDON_SetRecordingPlayCount(const AddonInstance_PVR* instance,
3107 const PVR_RECORDING* recording,
3108 int count)
3109 {
3110 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3111 ->SetRecordingPlayCount(recording, count);
3112 }
3113
3114 inline static PVR_ERROR ADDON_SetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3115 const PVR_RECORDING* recording,
3116 int lastplayedposition)
3117 {
3118 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3119 ->SetRecordingLastPlayedPosition(recording, lastplayedposition);
3120 }
3121
3122 inline static PVR_ERROR ADDON_GetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
3123 const PVR_RECORDING* recording,
3124 int* position)
3125 {
3126 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3127 ->GetRecordingLastPlayedPosition(recording, *position);
3128 }
3129
3130 inline static PVR_ERROR ADDON_GetRecordingEdl(const AddonInstance_PVR* instance,
3131 const PVR_RECORDING* recording,
3132 PVR_EDL_ENTRY* edl,
3133 int* size)
3134 {
3135 *size = 0;
3136 std::vector<PVREDLEntry> edlList;
3137 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3138 ->GetRecordingEdl(recording, edlList);
3139 if (error == PVR_ERROR_NO_ERROR)
3140 {
3141 for (const auto& edlEntry : edlList)
3142 {
3143 edl[*size] = *edlEntry;
3144 ++*size;
3145 }
3146 }
3147 return error;
3148 }
3149
3150 inline static PVR_ERROR ADDON_GetRecordingSize(const AddonInstance_PVR* instance,
3151 const PVR_RECORDING* recording,
3152 int64_t* size)
3153 {
3154 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3155 ->GetRecordingSize(recording, *size);
3156 }
3157
3158 inline static PVR_ERROR ADDON_GetRecordingStreamProperties(const AddonInstance_PVR* instance,
3159 const PVR_RECORDING* recording,
3160 PVR_NAMED_VALUE* properties,
3161 unsigned int* propertiesCount)
3162 {
3163 *propertiesCount = 0;
3164 std::vector<PVRStreamProperty> propertiesList;
3165 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3166 ->GetRecordingStreamProperties(recording, propertiesList);
3167 if (error == PVR_ERROR_NO_ERROR)
3168 {
3169 for (const auto& property : propertiesList)
3170 {
3171 strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
3172 sizeof(properties[*propertiesCount].strName) - 1);
3173 strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
3174 sizeof(properties[*propertiesCount].strValue) - 1);
3175 ++*propertiesCount;
3176 if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
3177 break;
3178 }
3179 }
3180 return error;
3181 }
3182
3183 inline static PVR_ERROR ADDON_CallRecordingMenuHook(const AddonInstance_PVR* instance,
3184 const PVR_MENUHOOK* menuhook,
3185 const PVR_RECORDING* recording)
3186 {
3187 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3188 ->CallRecordingMenuHook(menuhook, recording);
3189 }
3190
3191 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3192
3193
3194 inline static PVR_ERROR ADDON_GetTimerTypes(const AddonInstance_PVR* instance,
3195 PVR_TIMER_TYPE* types,
3196 int* typesCount)
3197 {
3198 *typesCount = 0;
3199 std::vector<PVRTimerType> timerTypes;
3200 PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3201 ->GetTimerTypes(timerTypes);
3202 if (error == PVR_ERROR_NO_ERROR)
3203 {
3204 for (const auto& timerType : timerTypes)
3205 {
3206 types[*typesCount] = *timerType;
3207 ++*typesCount;
3208 if (*typesCount >= PVR_ADDON_TIMERTYPE_ARRAY_SIZE)
3209 break;
3210 }
3211 }
3212 return error;
3213 }
3214
3215 inline static PVR_ERROR ADDON_GetTimersAmount(const AddonInstance_PVR* instance, int* amount)
3216 {
3217 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3218 ->GetTimersAmount(*amount);
3219 }
3220
3221 inline static PVR_ERROR ADDON_GetTimers(const AddonInstance_PVR* instance, ADDON_HANDLE handle)
3222 {
3223 PVRTimersResultSet result(instance, handle);
3224 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetTimers(result);
3225 }
3226
3227 inline static PVR_ERROR ADDON_AddTimer(const AddonInstance_PVR* instance, const PVR_TIMER* timer)
3228 {
3229 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->AddTimer(timer);
3230 }
3231
3232 inline static PVR_ERROR ADDON_DeleteTimer(const AddonInstance_PVR* instance,
3233 const PVR_TIMER* timer,
3234 bool forceDelete)
3235 {
3236 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3237 ->DeleteTimer(timer, forceDelete);
3238 }
3239
3240 inline static PVR_ERROR ADDON_UpdateTimer(const AddonInstance_PVR* instance,
3241 const PVR_TIMER* timer)
3242 {
3243 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->UpdateTimer(timer);
3244 }
3245
3246 inline static PVR_ERROR ADDON_CallTimerMenuHook(const AddonInstance_PVR* instance,
3247 const PVR_MENUHOOK* menuhook,
3248 const PVR_TIMER* timer)
3249 {
3250 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3251 ->CallTimerMenuHook(menuhook, timer);
3252 }
3253
3254 //--==----==----==----==----==----==----==----==----==----==----==----==----==
3255
3256 inline static PVR_ERROR ADDON_OnSystemSleep(const AddonInstance_PVR* instance)
3257 {
3258 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemSleep();
3259 }
3260
3261 inline static PVR_ERROR ADDON_OnSystemWake(const AddonInstance_PVR* instance)
3262 {
3263 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemWake();
3264 }
3265
3266 inline static PVR_ERROR ADDON_OnPowerSavingActivated(const AddonInstance_PVR* instance)
3267 {
3268 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3269 ->OnPowerSavingActivated();
3270 }
3271
3272 inline static PVR_ERROR ADDON_OnPowerSavingDeactivated(const AddonInstance_PVR* instance)
3273 {
3274 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3275 ->OnPowerSavingDeactivated();
3276 }
3277
3278 // obsolete parts below
3280
3281 inline static bool ADDON_OpenLiveStream(const AddonInstance_PVR* instance,
3282 const PVR_CHANNEL* channel)
3283 {
3284 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3285 ->OpenLiveStream(channel);
3286 }
3287
3288 inline static void ADDON_CloseLiveStream(const AddonInstance_PVR* instance)
3289 {
3290 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseLiveStream();
3291 }
3292
3293 inline static int ADDON_ReadLiveStream(const AddonInstance_PVR* instance,
3294 unsigned char* buffer,
3295 unsigned int size)
3296 {
3297 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3298 ->ReadLiveStream(buffer, size);
3299 }
3300
3301 inline static int64_t ADDON_SeekLiveStream(const AddonInstance_PVR* instance,
3302 int64_t position,
3303 int whence)
3304 {
3305 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3306 ->SeekLiveStream(position, whence);
3307 }
3308
3309 inline static int64_t ADDON_LengthLiveStream(const AddonInstance_PVR* instance)
3310 {
3311 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->LengthLiveStream();
3312 }
3313
3314 inline static PVR_ERROR ADDON_GetStreamProperties(const AddonInstance_PVR* instance,
3315 PVR_STREAM_PROPERTIES* properties)
3316 {
3317 properties->iStreamCount = 0;
3318 std::vector<PVRStreamProperties> cppProperties;
3319 PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3320 ->GetStreamProperties(cppProperties);
3321 if (err == PVR_ERROR_NO_ERROR)
3322 {
3323 for (unsigned int i = 0; i < cppProperties.size(); ++i)
3324 {
3325 memcpy(&properties->stream[i],
3326 static_cast<PVR_STREAM_PROPERTIES::PVR_STREAM*>(cppProperties[i]),
3328 ++properties->iStreamCount;
3329
3330 if (properties->iStreamCount >= PVR_STREAM_MAX_STREAMS)
3331 {
3332 kodi::Log(
3334 "CInstancePVRClient::%s: Addon given with '%li' more allowed streams where '%i'",
3335 __func__, cppProperties.size(), PVR_STREAM_MAX_STREAMS);
3336 break;
3337 }
3338 }
3339 }
3340
3341 return err;
3342 }
3343
3344 inline static PVR_ERROR ADDON_GetStreamReadChunkSize(const AddonInstance_PVR* instance,
3345 int* chunksize)
3346 {
3347 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3348 ->GetStreamReadChunkSize(*chunksize);
3349 }
3350
3351 inline static bool ADDON_IsRealTimeStream(const AddonInstance_PVR* instance)
3352 {
3353 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->IsRealTimeStream();
3354 }
3355
3356 inline static bool ADDON_OpenRecordedStream(const AddonInstance_PVR* instance,
3357 const PVR_RECORDING* recording)
3358 {
3359 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3360 ->OpenRecordedStream(recording);
3361 }
3362
3363 inline static void ADDON_CloseRecordedStream(const AddonInstance_PVR* instance)
3364 {
3365 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseRecordedStream();
3366 }
3367
3368 inline static int ADDON_ReadRecordedStream(const AddonInstance_PVR* instance,
3369 unsigned char* buffer,
3370 unsigned int size)
3371 {
3372 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3373 ->ReadRecordedStream(buffer, size);
3374 }
3375
3376 inline static int64_t ADDON_SeekRecordedStream(const AddonInstance_PVR* instance,
3377 int64_t position,
3378 int whence)
3379 {
3380 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3381 ->SeekRecordedStream(position, whence);
3382 }
3383
3384 inline static int64_t ADDON_LengthRecordedStream(const AddonInstance_PVR* instance)
3385 {
3386 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3387 ->LengthRecordedStream();
3388 }
3389
3390 inline static void ADDON_DemuxReset(const AddonInstance_PVR* instance)
3391 {
3392 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxReset();
3393 }
3394
3395 inline static void ADDON_DemuxAbort(const AddonInstance_PVR* instance)
3396 {
3397 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxAbort();
3398 }
3399
3400 inline static void ADDON_DemuxFlush(const AddonInstance_PVR* instance)
3401 {
3402 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush();
3403 }
3404
3405 inline static DEMUX_PACKET* ADDON_DemuxRead(const AddonInstance_PVR* instance)
3406 {
3407 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead();
3408 }
3409
3410 inline static bool ADDON_CanPauseStream(const AddonInstance_PVR* instance)
3411 {
3412 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanPauseStream();
3413 }
3414
3415 inline static bool ADDON_CanSeekStream(const AddonInstance_PVR* instance)
3416 {
3417 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanSeekStream();
3418 }
3419
3420 inline static void ADDON_PauseStream(const AddonInstance_PVR* instance, bool bPaused)
3421 {
3422 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->PauseStream(bPaused);
3423 }
3424
3425 inline static bool ADDON_SeekTime(const AddonInstance_PVR* instance,
3426 double time,
3427 bool backwards,
3428 double* startpts)
3429 {
3430 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3431 ->SeekTime(time, backwards, *startpts);
3432 }
3433
3434 inline static void ADDON_SetSpeed(const AddonInstance_PVR* instance, int speed)
3435 {
3436 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->SetSpeed(speed);
3437 }
3438
3439 inline static void ADDON_FillBuffer(const AddonInstance_PVR* instance, bool mode)
3440 {
3441 static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->FillBuffer(mode);
3442 }
3443
3444 inline static PVR_ERROR ADDON_GetStreamTimes(const AddonInstance_PVR* instance,
3445 PVR_STREAM_TIMES* times)
3446 {
3447 PVRStreamTimes cppTimes(times);
3448 return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
3449 ->GetStreamTimes(cppTimes);
3450 }
3452
3453 AddonInstance_PVR* m_instanceData = nullptr;
3454};
3455//}}}
3456//______________________________________________________________________________
3457
3458} /* namespace addon */
3459} /* namespace kodi */
3460
3461#endif /* __cplusplus */
Definition: PVR.h:385
Definition: AddonBase.h:186
Definition: General.h:116
Definition: ChannelGroups.h:38
Definition: ChannelGroups.h:238
Definition: ChannelGroups.h:103
Definition: Channels.h:39
Definition: Channels.h:191
Definition: Stream.h:39
Definition: Channels.h:376
Definition: EPG.h:40
Definition: MenuHook.h:46
Definition: Recordings.h:39
Definition: Recordings.h:487
Definition: Channels.h:236
Definition: Stream.h:262
Definition: Timers.h:39
Definition: Timers.h:487
@ ADDON_LOG_ERROR
3 : To report error messages in the log file.
Definition: addon_base.h:160
@ ADDON_INSTANCE_PVR
Game instance, see kodi::addon::CInstancePVRClient.
Definition: versions.h:231
Definition: demux_packet.h:46
#define STREAM_MAX_PROPERTY_COUNT
Max number of properties that can be sent to an Inputstream addon.
Definition: stream_constants.h:47
virtual PVR_ERROR GetBackendHostname(std::string &hostname)
Get the hostname of the pvr backend server.
Definition: PVR.h:606
std::string ClientPath() const
Callback to Kodi Function Get main client path of the PVR addon.
Definition: PVR.h:798
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:732
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:677
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:617
virtual PVR_ERROR GetDriveSpace(uint64_t &total, uint64_t &used)
Get the disk space reported by the backend (if supported).
Definition: PVR.h:644
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:766
CInstancePVRClient(KODI_HANDLE instance, const std::string &kodiVersion="")
PVR client class constructor used to support multiple instance types.
Definition: PVR.h:493
virtual PVR_ERROR GetCapabilities(kodi::addon::PVRCapabilities &capabilities)=0
Get the list of features that this add-on provides.
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:785
CInstancePVRClient()
PVR client class constructor.
Definition: PVR.h:442
virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus &signalStatus)
Get the signal status of the stream that's currently open.
Definition: PVR.h:977
virtual PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel &channel, std::vector< kodi::addon::PVRStreamProperty > &properties)
Get the stream properties for a channel from the backend.
Definition: PVR.h:928
virtual PVR_ERROR GetDescrambleInfo(int channelUid, kodi::addon::PVRDescrambleInfo &descrambleInfo)
Get the descramble information of the stream that's currently open.
Definition: PVR.h:997
void TriggerChannelUpdate()
Callback to Kodi Function Request Kodi to update it's list of channels.
Definition: PVR.h:1010
virtual PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet &results)
Request the list of all channels from the backend.
Definition: PVR.h:886
virtual PVR_ERROR GetChannelsAmount(int &amount)
The total amount of channels on the backend.
Definition: PVR.h:837
PVR_CONNECTION_STATE
Definition: pvr_general.h:82
PVR_ERROR
Definition: pvr_general.h:35
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition: pvr_general.h:43
@ PVR_ERROR_NO_ERROR
0 : No error occurred.
Definition: pvr_general.h:37
#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:1374
void TriggerEpgUpdate(unsigned int channelUid)
Callback to Kodi Function Schedule an EPG update for the given channel channel.
Definition: PVR.h:1570
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:1494
virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag &tag, bool &isPlayable)
Check if the given EPG tag can be played.
Definition: PVR.h:1407
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:1512
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:1472
int EpgMaxPastDays() const
Callback to Kodi Function Get the Max past days handled by Kodi.
Definition: PVR.h:1546
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:1529
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:1431
virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag &tag, bool &isRecordable)
Check if the given EPG tag can be recorded.
Definition: PVR.h:1392
int EpgMaxFutureDays() const
Callback to Kodi Function Get the Max future days handled by Kodi.
Definition: PVR.h:1559
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:1608
virtual PVR_ERROR OnPowerSavingDeactivated()
To notify addon power saving on system is deactivated.
Definition: PVR.h:2197
virtual PVR_ERROR OnPowerSavingActivated()
To notify addon power saving on system is activated.
Definition: PVR.h:2189
virtual PVR_ERROR OnSystemSleep()
To notify addon about system sleep.
Definition: PVR.h:2173
virtual PVR_ERROR OnSystemWake()
To notify addon about system wake up.
Definition: PVR.h:2181
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:1925
virtual PVR_ERROR GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet &results)
Request the list of all recordings from the backend, if supported.
Definition: PVR.h:1700
virtual PVR_ERROR RenameRecording(const kodi::addon::PVRRecording &recording)
Rename a recording on the backend.
Definition: PVR.h:1754
virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording &recording, int64_t &size)
Retrieve the size of a recording on the backend.
Definition: PVR.h:1861
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:1806
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:1943
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:1844
void TriggerRecordingUpdate()
Callback to Kodi Function Request Kodi to update it's list of recordings.
Definition: PVR.h:1958
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:1903
virtual PVR_ERROR GetRecordingsAmount(bool deleted, int &amount)
To get amount of recording present on backend.
Definition: PVR.h:1653
virtual PVR_ERROR SetRecordingLifetime(const kodi::addon::PVRRecording &recording)
Set the lifetime of a recording on the backend.
Definition: PVR.h:1772
virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition: PVR.h:1790
virtual PVR_ERROR UndeleteRecording(const kodi::addon::PVRRecording &recording)
Undelete a recording on the backend.
Definition: PVR.h:1730
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:1823
virtual PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition: PVR.h:1741
virtual PVR_ERROR DeleteRecording(const kodi::addon::PVRRecording &recording)
Delete a recording on the backend.
Definition: PVR.h:1715
virtual int ReadRecordedStream(unsigned char *buffer, unsigned int size)
Read from a recording.
Definition: PVR.h:2523
virtual bool OpenRecordedStream(const kodi::addon::PVRRecording &recording)
Open a stream to a recording on the backend.
Definition: PVR.h:2501
virtual int64_t LengthRecordedStream()
Obtain the length of a recorded stream.
Definition: PVR.h:2554
virtual void CloseRecordedStream()
Close an open stream from a recording.
Definition: PVR.h:2510
virtual int64_t SeekRecordedStream(int64_t position, int whence)
Seek in a recorded stream.
Definition: PVR.h:2543
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:2337
virtual void DemuxReset()
Reset the demultiplexer in the add-on.
Definition: PVR.h:2365
PVRCodec GetCodecByName(const std::string &codecName) const
Callback to Kodi Function Get the codec id used by Kodi.
Definition: PVR.h:2430
DEMUX_PACKET * AllocateDemuxPacket(int iDataSize)
Callback to Kodi Function Allocate a demux packet. Free with FreeDemuxPacket().
Definition: PVR.h:2446
void FreeDemuxPacket(DEMUX_PACKET *pPacket)
Callback to Kodi Function Free a packet that was allocated with AllocateDemuxPacket().
Definition: PVR.h:2461
virtual DEMUX_PACKET * DemuxRead()
Read the next packet from the demultiplexer, if there is one.
Definition: PVR.h:2357
virtual void DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition: PVR.h:2373
virtual void DemuxFlush()
Flush all data that's currently in the demultiplexer buffer in the add-on.
Definition: PVR.h:2382
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:2418
virtual void SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition: PVR.h:2393
virtual void FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition: PVR.h:2403
virtual void CloseLiveStream()
Close an open live stream.
Definition: PVR.h:2261
virtual bool OpenLiveStream(const kodi::addon::PVRChannel &channel)
Open a live stream on the backend.
Definition: PVR.h:2252
virtual int64_t SeekLiveStream(int64_t position, int whence)
Seek in a live stream on a backend that supports timeshifting.
Definition: PVR.h:2294
virtual int ReadLiveStream(unsigned char *buffer, unsigned int size)
Read from an open live stream.
Definition: PVR.h:2274
virtual int64_t LengthLiveStream()
Obtain the length of a live stream.
Definition: PVR.h:2305
virtual PVR_ERROR GetStreamTimes(kodi::addon::PVRStreamTimes &times)
Get stream times.
Definition: PVR.h:2632
virtual bool CanPauseStream()
Check if the backend support pausing the currently playing stream.
Definition: PVR.h:2589
virtual bool IsRealTimeStream()
Check for real-time streaming.
Definition: PVR.h:2622
virtual void PauseStream(bool paused)
Notify the pvr addon that Kodi (un)paused the currently playing stream.
Definition: PVR.h:2613
virtual PVR_ERROR GetStreamReadChunkSize(int &chunksize)
Obtain the chunk size to use when reading streams.
Definition: PVR.h:2649
virtual bool CanSeekStream()
Check if the backend supports seeking for the currently playing stream.
Definition: PVR.h:2603
void TriggerTimerUpdate()
Callback to Kodi Function Request Kodi to update it's list of timers.
Definition: PVR.h:2141
virtual PVR_ERROR UpdateTimer(const kodi::addon::PVRTimer &timer)
Update the timer information on the backend.
Definition: PVR.h:2107
virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer &timer, bool forceDelete)
Delete a timer on the backend.
Definition: PVR.h:2092
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:2128
virtual PVR_ERROR AddTimer(const kodi::addon::PVRTimer &timer)
Add a timer on the backend.
Definition: PVR.h:2075
virtual PVR_ERROR GetTimers(kodi::addon::PVRTimersResultSet &results)
Request the list of all timers from the backend if supported.
Definition: PVR.h:2060
virtual PVR_ERROR GetTimersAmount(int &amount)
To get total amount of timers on the backend or -1 on error.
Definition: PVR.h:2020
virtual PVR_ERROR GetTimerTypes(std::vector< kodi::addon::PVRTimerType > &types)
Retrieve the timer types supported by the backend.
Definition: PVR.h:2005
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:1260
virtual PVR_ERROR RenameChannel(const kodi::addon::PVRChannel &channel)
Rename a channel on the backend.
Definition: PVR.h:1230
virtual PVR_ERROR OpenDialogChannelScan()
Show the channel scan dialog if this backend supports it.
Definition: PVR.h:1274
virtual PVR_ERROR OpenDialogChannelSettings(const kodi::addon::PVRChannel &channel)
Show the channel settings dialog, if supported by the backend.
Definition: PVR.h:1245
virtual PVR_ERROR DeleteChannel(const kodi::addon::PVRChannel &channel)
Delete a channel from the backend.
Definition: PVR.h:1208
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:1291
virtual PVR_ERROR GetChannelGroupMembers(const kodi::addon::PVRChannelGroup &group, kodi::addon::PVRChannelGroupMembersResultSet &results)
Get a list of members on a group.
Definition: PVR.h:1158
virtual PVR_ERROR GetChannelGroupsAmount(int &amount)
Get the total amount of channel groups on the backend if it supports channel groups.
Definition: PVR.h:1047
void TriggerChannelGroupsUpdate()
Callback to Kodi Function Request Kodi to update it's list of channel groups.
Definition: PVR.h:1171
virtual PVR_ERROR GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet &results)
Get a list of available channel groups on addon.
Definition: PVR.h:1095
std::string ATTRIBUTE_HIDDEN GetKodiTypeVersion(int type)
To get used version inside Kodi itself about asked type.
Definition: AddonBase.h:630
void ATTRIBUTE_HIDDEN Log(const AddonLog loglevel, const char *format,...)
Add a message to Kodi's log.
Definition: AddonBase.h:749
Definition: pvr.h:322
"C" PVR add-on channel group member.
Definition: pvr_epg.h:623
"C" PVR add-on capabilities.
Definition: pvr_general.h:258
"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:91
"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:55
"C" PVR add-on recording.
Definition: pvr_recordings.h:110
"C" PVR add-on signal status information.
Definition: pvr_channels.h:63
"C" Stream properties
Definition: pvr_stream.h:112
Definition: pvr_stream.h:115
"C" Times of playing stream (Live TV and recordings)
Definition: pvr_stream.h:142
"C" PVR add-on timer event type.
Definition: pvr_timers.h:380
"C" PVR add-on timer event.
Definition: pvr_timers.h:341