1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "../c-api/addon-instance/pvr.h"
#include "pvr/ChannelGroups.h"
#include "pvr/Channels.h"
#include "pvr/EDL.h"
#include "pvr/EPG.h"
#include "pvr/General.h"
#include "pvr/MenuHook.h"
#include "pvr/Recordings.h"
#include "pvr/Stream.h"
#include "pvr/Timers.h"
#ifdef __cplusplus
/*!
* @internal
* @brief PVR "C++" API interface
*
* In this field are the pure addon-side C++ data.
*
* @note Changes can be made without problems and have no influence on other
* PVR addons that have already been created.\n
* \n
* Therefore, @ref ADDON_INSTANCE_VERSION_PVR_MIN can be ignored for these
* fields and only the @ref ADDON_INSTANCE_VERSION_PVR needs to be increased.\n
* \n
* Only must be min version increased if a new compile of addon breaks after
* changes here.
*
* Have by add of new parts a look about **Doxygen** `\\ingroup`, so that
* added parts included in documentation.
*
* If you add addon side related documentation, where his dev need know, use `///`.
* For parts only for Kodi make it like here.
*
* @endinternal
*/
namespace kodi
{
namespace addon
{
//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// "C++" Doxygen group set for the definitions
//{{{
//==============================================================================
/// @defgroup cpp_kodi_addon_pvr_Defs Definitions, structures and enumerators
/// @ingroup cpp_kodi_addon_pvr
/// @brief **PVR client add-on instance definition values**\n
/// All PVR functions associated data structures.
///
/// Used to exchange the available options between Kodi and addon.\n
/// The groups described here correspond to the groups of functions on PVR
/// instance class.
///
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_General 1. General
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR add-on general variables**\n
/// Used to exchange the available options between Kodi and addon.
///
/// This group also includes @ref cpp_kodi_addon_pvr_Defs_PVRCapabilities with
/// which Kodi an @ref kodi::addon::CInstancePVRClient::GetCapabilities()
/// queries the supported **modules** of the addon.
///
/// The standard values are also below, once for error messages and once to
/// @ref kodi::addon::CInstancePVRClient::ConnectionStateChange() to give Kodi
/// any information.
///
///@{
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_General_Inputstream class PVRStreamProperty & definition PVR_STREAM_PROPERTY
/// @ingroup cpp_kodi_addon_pvr_Defs_General
/// @brief **Inputstream variables**\n
/// This includes values related to the outside of PVR available inputstream
/// system.
///
/// This can be by separate instance on same addon, by handling in Kodi itself
/// or to reference of another addon where support needed inputstream.
///
/// @note This is complete independent from own system included here
/// @ref cpp_kodi_addon_pvr_Streams "inputstream".
///
//------------------------------------------------------------------------------
///@}
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_Channel 2. Channel
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR add-on channel**\n
/// Used to exchange the available channel options between Kodi and addon.
///
/// Modules here are mainly intended for @ref cpp_kodi_addon_pvr_Channels "channels",
/// but are also used on other modules to identify the respective TV/radio
/// channel.
///
/// Because of @ref cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus and
/// @ref cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo is a special case at
/// this point. This is currently only used on running streams, but it may be
/// possible that this must always be usable in connection with PiP in the
/// future.
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_ChannelGroup 3. Channel Group
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR add-on channel group**\n
/// This group contains data classes and values which are used in PVR on
/// @ref cpp_kodi_addon_pvr_supportsChannelGroups "channel groups".
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_epg 4. EPG Tag
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR add-on EPG data**\n
/// Used on @ref cpp_kodi_addon_pvr_EPGTag "EPG methods in PVR instance class".
///
/// See related modules about, also below in this view are few macros where
/// default values of associated places.
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_Recording 5. Recording
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **Representation of a recording**\n
/// Used to exchange the available recording data between Kodi and addon on
/// @ref cpp_kodi_addon_pvr_Recordings "Recordings methods in PVR instance class".
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_Timer 6. Timer
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR add-on timer data**\n
/// Used to exchange the available timer data between Kodi and addon on
/// @ref cpp_kodi_addon_pvr_Timers "Timers methods in PVR instance class".
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook 7. Menuhook
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **PVR Context menu data**\n
/// Define data for the context menus available to the user
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_EDLEntry 8. Edit decision list (EDL)
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **An edit decision list or EDL is used in the post-production process
/// of film editing and video editing**\n
/// Used on @ref kodi::addon::CInstancePVRClient::GetEPGTagEdl and
/// @ref kodi::addon::CInstancePVRClient::GetRecordingEdl
///
//------------------------------------------------------------------------------
//##############################################################################
/// @defgroup cpp_kodi_addon_pvr_Defs_Stream 9. Inputstream
/// @ingroup cpp_kodi_addon_pvr_Defs
/// @brief **Inputstream**\n
/// This includes classes and values that are used in the PVR inputstream.
///
/// Used on @ref cpp_kodi_addon_pvr_Streams "Inputstream methods in PVR instance class".
///
/// @note The parts here will be removed in the future and replaced by the
/// separate @ref cpp_kodi_addon_inputstream "inputstream addon instance".
/// If there is already a possibility, new addons should do it via the
/// inputstream instance.
///
//------------------------------------------------------------------------------
//}}}
//______________________________________________________________________________
//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// "C++" PVR addon instance class
//{{{
//==============================================================================
/// @addtogroup cpp_kodi_addon_pvr
/// @brief \cpp_class{ kodi::addon::CInstancePVRClient }
/// **PVR client add-on instance**
///
/// Kodi features powerful [Live TV](https://kodi.wiki/view/Live_TV) and
/// [video recording (DVR/PVR)](http://en.wikipedia.org/wiki/Digital_video_recorder)
/// abilities using a very flexible distributed application structure. That is, by
/// leveraging other existing third-party
/// [PVR backend applications](https://kodi.wiki/view/PVR_backend) or
/// [DVR devices](https://kodi.wiki/view/PVR_backend)
/// that specialize in receiving television signals and also support the same type
/// of [client–server model](http://en.wikipedia.org/wiki/client%E2%80%93server_model)
/// which Kodi uses, (following a [frontend-backend](http://en.wikipedia.org/wiki/Front_and_back_ends)
/// design principle for [separation of concerns](http://en.wikipedia.org/wiki/Separation_of_concerns)),
/// these PVR features in Kodi allow you to watch Live TV, listen to radio, view an EPG TV-Guide
/// and schedule recordings, and also enables many other TV related features, all using
/// Kodi as your primary interface once the initial pairing connection and
/// configuration have been done.
///
/// @note It is very important to understand that with "Live TV" in the reference
/// to PVR in Kodi, we do not mean [streaming video](http://en.wikipedia.org/wiki/Streaming_media)
/// from the internet via websites providing [free content](https://kodi.wiki/view/Free_content)
/// or online services such as Netflix, Hulu, Vudu and similar, no matter if that
/// content is actually streamed live or not. If that is what you are looking for
/// then you might want to look into [Video Addons](https://kodi.wiki/view/Add-ons)
/// for Kodi instead, (which again is not the same as the "PVR" or "Live TV" we
/// discuss in this article), but remember that [Kodi does not provide any video
/// content or video streaming services](https://kodi.wiki/view/Free_content).
///
/// The use of the PVR is based on the @ref CInstancePVRClient.
///
/// Include the header @ref PVR.h "#include <kodi/addon-instance/PVR.h>"
/// to use this class.
///
///
/// ----------------------------------------------------------------------------
///
/// Here is an example of what the <b>`addon.xml.in`</b> would look like for an PVR addon:
///
/// ~~~~~~~~~~~~~{.xml}
/// <?xml version="1.0" encoding="UTF-8"?>
/// <addon
/// id="pvr.myspecialnamefor"
/// version="1.0.0"
/// name="My special PVR addon"
/// provider-name="Your Name">
/// <requires>@ADDON_DEPENDS@</requires>
/// <extension
/// point="kodi.pvrclient"
/// library_@PLATFORM@="@LIBRARY_FILENAME@"/>
/// <extension point="xbmc.addon.metadata">
/// <summary lang="en_GB">My PVR addon addon</summary>
/// <description lang="en_GB">My PVR addon description</description>
/// <platform>@PLATFORM@</platform>
/// </extension>
/// </addon>
/// ~~~~~~~~~~~~~
///
///
/// At <b>`<extension point="kodi.pvrclient" ...>`</b> the basic instance definition is declared, this is intended to identify the addon as an PVR and to see its supported types:
/// | Name | Description
/// |------|----------------------
/// | <b>`point`</b> | The identification of the addon instance to inputstream is mandatory <b>`kodi.pvrclient`</b>. In addition, the instance declared in the first <b>`<extension ... />`</b> is also the main type of addon.
/// | <b>`library_@PLATFORM@`</b> | The runtime library used for the addon. This is usually declared by cmake and correctly displayed in the translated `addon.xml`.
///
///
/// @remark For more detailed description of the <b>`addon.xml`</b>, see also https://kodi.wiki/view/Addon.xml.
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
///
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
///
/// class CMyPVRClient : public ::kodi::addon::CInstancePVRClient
/// {
/// public:
/// CMyPVRClient(KODI_HANDLE instance, const std::string& kodiVersion);
///
/// PVR_ERROR GetCapabilities(kodi::addon::PVRCapabilities& capabilities) override;
/// PVR_ERROR GetBackendName(std::string& name) override;
/// PVR_ERROR GetBackendVersion(std::string& version) override;
///
/// PVR_ERROR GetChannelsAmount(int& amount) override;
/// PVR_ERROR GetChannels(bool radio, std::vector<kodi::addon::PVRChannel>& channels) override;
/// PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel& channel,
/// std::vector<kodi::addon::PVRStreamProperty>& properties) override;
///
/// private:
/// std::vector<kodi::addon::PVRChannel> m_myChannels;
/// };
///
/// CMyPVRClient::CMyPVRClient(KODI_HANDLE instance, const std::string& kodiVersion)
/// : CInstancePVRClient(instance, kodiVersion)
/// {
/// kodi::addon::PVRChannel channel;
/// channel.SetUniqueId(123);
/// channel.SetChannelNumber(1);
/// channel.SetChannelName("My test channel");
/// m_myChannels.push_back(channel);
/// }
///
/// PVR_ERROR CMyPVRClient::GetCapabilities(kodi::addon::PVRCapabilities& capabilities)
/// {
/// capabilities.SetSupportsTV(true);
/// return PVR_ERROR_NO_ERROR;
/// }
///
/// PVR_ERROR CMyPVRClient::GetBackendName(std::string& name)
/// {
/// name = "My special PVR client";
/// return PVR_ERROR_NO_ERROR;
/// }
///
/// PVR_ERROR CMyPVRClient::GetBackendVersion(std::string& version)
/// {
/// version = "1.0.0";
/// return PVR_ERROR_NO_ERROR;
/// }
///
/// PVR_ERROR CMyInstance::GetChannelsAmount(int& amount)
/// {
/// amount = m_myChannels.size();
/// return PVR_ERROR_NO_ERROR;
/// }
///
/// PVR_ERROR CMyPVRClient::GetChannels(bool radio, std::vector<kodi::addon::PVRChannel>& channels)
/// {
/// channels = m_myChannels;
/// return PVR_ERROR_NO_ERROR;
/// }
///
/// PVR_ERROR CMyPVRClient::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel,
/// std::vector<kodi::addon::PVRStreamProperty>& properties)
/// {
/// if (channel.GetUniqueId() == 123)
/// {
/// properties.push_back(PVR_STREAM_PROPERTY_STREAMURL, "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4");
/// properties.push_back(PVR_STREAM_PROPERTY_ISREALTIMESTREAM, "true");
/// return PVR_ERROR_NO_ERROR;
/// }
/// return PVR_ERROR_UNKNOWN;
/// }
///
/// ...
///
/// //----------------------------------------------------------------------
///
/// class CMyAddon : public ::kodi::addon::CAddonBase
/// {
/// public:
/// CMyAddon() = default;
/// ADDON_STATUS CreateInstance(int instanceType,
/// const std::string& instanceID,
/// KODI_HANDLE instance,
/// const std::string& version,
/// KODI_HANDLE& addonInstance) override;
/// };
///
/// // If you use only one instance in your add-on, can be instanceType and
/// // instanceID ignored
/// ADDON_STATUS CMyAddon::CreateInstance(int instanceType,
/// const std::string& instanceID,
/// KODI_HANDLE instance,
/// const std::string& version,
/// KODI_HANDLE& addonInstance)
/// {
/// if (instanceType == ADDON_INSTANCE_PVR)
/// {
/// kodi::Log(ADDON_LOG_INFO, "Creating my PVR client instance");
/// addonInstance = new CMyPVRClient(instance, version);
/// return ADDON_STATUS_OK;
/// }
/// else if (...)
/// {
/// ...
/// }
/// return ADDON_STATUS_UNKNOWN;
/// }
///
/// ADDONCREATOR(CMyAddon)
/// ~~~~~~~~~~~~~
///
/// The destruction of the example class `CMyPVRClient` is called from
/// Kodi's header. Manually deleting the add-on instance is not required.
///
class ATTRIBUTE_HIDDEN CInstancePVRClient : public IAddonInstance
{
public:
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Base 1. Basic functions
/// @ingroup cpp_kodi_addon_pvr
/// @brief **Functions to manage the addon and get basic information about it**\n
/// These are e.g. @ref GetCapabilities to know supported groups at
/// this addon or the others to get information about the source of the PVR
/// stream.
///
/// The with "Valid implementation required." declared functions are mandatory,
/// all others are an option.
///
///
///---------------------------------------------------------------------------
///
/// **Basic parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Base_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Base_source_addon_auto_check
///
///@{
//============================================================================
/// @brief PVR client class constructor.
///
/// Used by an add-on that only supports only PVR and only in one instance.
///
///
/// --------------------------------------------------------------------------
///
/// **Here's example about the use of this:**
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
/// ...
///
/// class ATTRIBUTE_HIDDEN CPVRExample
/// : public kodi::addon::CAddonBase,
/// public kodi::addon::CInstancePVRClient
/// {
/// public:
/// CPVRExample()
/// {
/// }
///
/// ~CPVRExample() override;
/// {
/// }
///
/// ...
/// };
///
/// ADDONCREATOR(CPVRExample)
/// ~~~~~~~~~~~~~
///
CInstancePVRClient() : IAddonInstance(ADDON_INSTANCE_PVR, GetKodiTypeVersion(ADDON_INSTANCE_PVR))
{
if (CAddonBase::m_interface->globalSingleInstance != nullptr)
throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of more as one in single "
"instance way is not allowed!");
SetAddonStruct(CAddonBase::m_interface->firstKodiInstance, m_kodiVersion);
CAddonBase::m_interface->globalSingleInstance = this;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief PVR client class constructor used to support multiple instance
/// types.
///
/// @param[in] instance The instance value given to
/// <b>`kodi::addon::CAddonBase::CreateInstance(...)`</b>.
/// @param[in] kodiVersion [opt] Version used in Kodi for this instance, to
/// allow compatibility to older Kodi versions.
///
/// @note Recommended to set <b>`kodiVersion`</b>.
///
///
/// --------------------------------------------------------------------------
///
/// **Here's example about the use of this:**
/// ~~~~~~~~~~~~~{.cpp}
/// class CMyPVRClient : public ::kodi::addon::CInstancePVRClient
/// {
/// public:
/// CMyPVRClient(KODI_HANDLE instance, const std::string& kodiVersion)
/// : CInstancePVRClient(instance, kodiVersion)
/// {
/// ...
/// }
///
/// ...
/// };
///
/// ADDON_STATUS CMyAddon::CreateInstance(int instanceType,
/// const std::string& instanceID,
/// KODI_HANDLE instance,
/// const std::string& version,
/// KODI_HANDLE& addonInstance)
/// {
/// kodi::Log(ADDON_LOG_INFO, "Creating my PVR client instance");
/// addonInstance = new CMyPVRClient(instance, version);
/// return ADDON_STATUS_OK;
/// }
/// ~~~~~~~~~~~~~
///
explicit CInstancePVRClient(KODI_HANDLE instance, const std::string& kodiVersion = "")
: IAddonInstance(ADDON_INSTANCE_PVR,
!kodiVersion.empty() ? kodiVersion : GetKodiTypeVersion(ADDON_INSTANCE_PVR))
{
if (CAddonBase::m_interface->globalSingleInstance != nullptr)
throw std::logic_error("kodi::addon::CInstancePVRClient: Creation of multiple together with "
"single instance way is not allowed!");
SetAddonStruct(instance, m_kodiVersion);
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Destructor
///
~CInstancePVRClient() override = default;
//----------------------------------------------------------------------------
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @brief Get the list of features that this add-on provides.
///
/// Called by Kodi to query the add-on's capabilities.
/// Used to check which options should be presented in the UI, which methods to call, etc.
/// All capabilities that the add-on supports should be set to true.
///
/// @param capabilities The with @ref cpp_kodi_addon_pvr_Defs_PVRCapabilities defined add-on's capabilities.
/// @return @ref PVR_ERROR_NO_ERROR if the properties were fetched successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_PVRCapabilities_Help
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// PVR_ERROR CMyPVRClient::GetCapabilities(kodi::addon::PVRCapabilities& capabilities)
/// {
/// capabilities.SetSupportsTV(true);
/// capabilities.SetSupportsEPG(true);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ~~~~~~~~~~~~~
///
/// --------------------------------------------------------------------------
///
/// @note Valid implementation required.
///
virtual PVR_ERROR GetCapabilities(kodi::addon::PVRCapabilities& capabilities) = 0;
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the name reported by the backend that will be displayed in the UI.
///
/// @param[out] name The name reported by the backend that will be displayed in the UI.
/// @return @ref PVR_ERROR_NO_ERROR if successfully done
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// PVR_ERROR CMyPVRClient::GetBackendName(std::string& name)
/// {
/// name = "My special PVR client";
/// return PVR_ERROR_NO_ERROR;
/// }
/// ~~~~~~~~~~~~~
///
/// --------------------------------------------------------------------------
///
/// @note Valid implementation required.
///
virtual PVR_ERROR GetBackendName(std::string& name) = 0;
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the version string reported by the backend that will be
/// displayed in the UI.
///
/// @param[out] version The version string reported by the backend that will be
/// displayed in the UI.
/// @return @ref PVR_ERROR_NO_ERROR if successfully done
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// PVR_ERROR CMyPVRClient::GetBackendVersion(std::string& version)
/// {
/// version = "1.0.0";
/// return PVR_ERROR_NO_ERROR;
/// }
/// ~~~~~~~~~~~~~
///
/// --------------------------------------------------------------------------
///
/// @note Valid implementation required.
///
virtual PVR_ERROR GetBackendVersion(std::string& version) = 0;
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the hostname of the pvr backend server
///
/// @param[out] hostname Hostname as ip address or alias. If backend does not
/// utilize a server, return empty string.
/// @return @ref PVR_ERROR_NO_ERROR if successfully done
///
virtual PVR_ERROR GetBackendHostname(std::string& hostname) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief To get the connection string reported by the backend that will be
/// displayed in the UI.
///
/// @param[out] connection The connection string reported by the backend that
/// will be displayed in the UI.
/// @return @ref PVR_ERROR_NO_ERROR if successfully done
///
virtual PVR_ERROR GetConnectionString(std::string& connection)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the disk space reported by the backend (if supported).
///
/// @param[in] total The total disk space in KiB.
/// @param[in] used The used disk space in KiB.
/// @return @ref PVR_ERROR_NO_ERROR if the drive space has been fetched
/// successfully.
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// PVR_ERROR CMyPVRClient::GetDriveSpace(uint64_t& total, uint64_t& used)
/// {
/// total = 100 * 1024 * 1024; // To set complete size of drive in KiB (100GB)
/// used = 12232424; // To set the used amount
/// return PVR_ERROR_NO_ERROR;
/// }
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetDriveSpace(uint64_t& total, uint64_t& used)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Call one of the settings related menu hooks (if supported).
///
/// Supported @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook "menu hook "
/// instances have to be added in `constructor()`, by calling @ref AddMenuHook()
/// on the callback.
///
/// @param[in] menuhook The hook to call.
/// @return @ref PVR_ERROR_NO_ERROR if the hook was called successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
///
/// --------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// PVR_ERROR CMyPVRClient::CallSettingsMenuHook(const kodi::addon::PVRMenuhook& menuhook)
/// {
/// if (menuhook.GetHookId() == 2)
/// kodi::QueueNotification(QUEUE_INFO, "", kodi::GetLocalizedString(menuhook.GetLocalizedStringId()));
/// return PVR_ERROR_NO_ERROR;
/// }
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR CallSettingsMenuHook(const kodi::addon::PVRMenuhook& menuhook)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\nAdd or replace a menu hook for the context menu for this add-on
///
/// This is a callback function, called from addon to give Kodi his context menu's.
///
/// @param[in] menuhook The with @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook defined hook to add
///
/// @remarks Only called from addon itself
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
///
/// --------------------------------------------------------------------------
///
/// **Here's an example of the use of it:**
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
/// ...
///
/// {
/// kodi::addon::PVRMenuhook hook;
/// hook.SetHookId(1);
/// hook.SetCategory(PVR_MENUHOOK_CHANNEL);
/// hook.SetLocalizedStringId(30000);
/// AddMenuHook(hook);
/// }
///
/// {
/// kodi::addon::PVRMenuhook hook;
/// hook.SetHookId(2);
/// hook.SetCategory(PVR_MENUHOOK_SETTING);
/// hook.SetLocalizedStringId(30001);
/// AddMenuHook(hook);
/// }
/// ...
/// ~~~~~~~~~~~~~
///
/// **Here another way:**
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
/// ...
///
/// AddMenuHook(kodi::addon::PVRMenuhook(1, 30000, PVR_MENUHOOK_CHANNEL));
/// AddMenuHook(kodi::addon::PVRMenuhook(2, 30001, PVR_MENUHOOK_SETTING));
/// ...
/// ~~~~~~~~~~~~~
///
inline void AddMenuHook(const kodi::addon::PVRMenuhook& hook)
{
m_instanceData->toKodi->AddMenuHook(m_instanceData->toKodi->kodiInstance, hook);
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Notify a state change for a PVR backend connection.
///
/// @param[in] connectionString The connection string reported by the backend
/// that can be displayed in the UI.
/// @param[in] newState The by @ref PVR_CONNECTION_STATE defined new state.
/// @param[in] message A localized addon-defined string representing the new
/// state, that can be displayed in the UI or **empty** if
/// the Kodi-defined default string for the new state
/// shall be displayed.
///
/// @remarks Only called from addon itself
///
///
/// --------------------------------------------------------------------------
///
///
/// **Here's an example of the use of it:**
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
/// #include <kodi/General.h> /* for kodi::GetLocalizedString(...) */
/// ...
///
/// ConnectionStateChange("PVR demo connection lost", PVR_CONNECTION_STATE_DISCONNECTED, kodi::GetLocalizedString(30005, "Lost connection to Server"););
/// ...
/// ~~~~~~~~~~~~~
///
inline void ConnectionStateChange(const std::string& connectionString,
PVR_CONNECTION_STATE newState,
const std::string& message)
{
m_instanceData->toKodi->ConnectionStateChange(
m_instanceData->toKodi->kodiInstance, connectionString.c_str(), newState, message.c_str());
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Get user data path of the PVR addon.
///
/// @return Path of current Kodi user
///
/// @remarks Only called from addon itself
///
/// @note Alternatively, @ref kodi::GetAddonPath() can be used for this.
///
inline std::string UserPath() const { return m_instanceData->props->strUserPath; }
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Get main client path of the PVR addon.
///
/// @return Path of addon client
///
/// @remarks Only called from addon itself.
///
/// @note Alternatively, @ref kodi::GetBaseUserPath() can be used for this.
///
inline std::string ClientPath() const { return m_instanceData->props->strClientPath; }
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Channels 2. Channels (required)
/// @ingroup cpp_kodi_addon_pvr
/// @brief **Functions to get available TV or Radio channels**\n
/// These are mandatory functions for using this addon to get the available
/// channels.
///
/// @remarks Either @ref PVRCapabilities::SetSupportsTV "SetSupportsTV()" or
/// @ref PVRCapabilities::SetSupportsRadio "SetSupportsRadio()" is required to
/// be set to <b>`true`</b>.\n
/// If a channel changes after the initial import, or if a new one was added,
/// then the add-on should call @ref TriggerChannelUpdate().
///
///
///---------------------------------------------------------------------------
///
/// **Channel parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Channels_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Channels_source_addon_auto_check
///
///@{
//============================================================================
/// @brief The total amount of channels on the backend
///
/// @param[out] amount The total amount of channels on the backend
/// @return @ref PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
///
/// @remarks Valid implementation required.
///
virtual PVR_ERROR GetChannelsAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Request the list of all channels from the backend.
///
/// @param[in] radio True to get the radio channels, false to get the TV channels.
/// @param[out] results The channels defined with @ref cpp_kodi_addon_pvr_Defs_Channel_PVRChannel
/// and available at the addon, them transferred with
/// @ref cpp_kodi_addon_pvr_Defs_Channel_PVRChannelsResultSet.
/// @return @ref PVR_ERROR_NO_ERROR if the list has been fetched successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRChannel_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks
/// If @ref PVRCapabilities::SetSupportsTV() is set to
/// <b>`true`</b>, a valid result set needs to be provided for <b>`radio = false`</b>.\n
/// If @ref PVRCapabilities::SetSupportsRadio() is set to
/// <b>`true`</b>, a valid result set needs to be provided for <b>`radio = true`</b>.
/// At least one of these two must provide a valid result set.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetChannels(bool radio, kodi::addon::PVRChannelsResultSet& results)
/// {
/// // Minimal demo example, in reality bigger and loop to transfer all
/// kodi::addon::PVRChannel channel;
/// channel.SetUniqueId(123);
/// channel.SetIsRadio(false);
/// channel.SetChannelNumber(1);
/// channel.SetChannelName("My channel name");
/// ...
///
/// // Give it now to Kodi
/// results.Add(channel);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the stream properties for a channel from the backend.
///
/// @param[in] channel The channel to get the stream properties for.
/// @param[out] properties the properties required to play the stream.
/// @return @ref PVR_ERROR_NO_ERROR if the stream is available.
///
/// @remarks If @ref PVRCapabilities::SetSupportsTV "SetSupportsTV" or
/// @ref PVRCapabilities::SetSupportsRadio "SetSupportsRadio" are set to true
/// and @ref PVRCapabilities::SetHandlesInputStream "SetHandlesInputStream" is
/// set to false.\n\n
/// In this case the implementation must fill the property @ref PVR_STREAM_PROPERTY_STREAMURL
/// with the URL Kodi should resolve to playback the channel.
///
/// @note The value directly related to inputstream must always begin with the
/// name of the associated add-on, e.g. <b>`"inputstream.adaptive.manifest_update_parameter"`</b>.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel,
/// std::vector<kodi::addon::PVRStreamProperty>& properties)
/// {
/// ...
/// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive");
/// properties.emplace_back("inputstream.adaptive.manifest_type", "mpd");
/// properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
/// properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/xml+dash");
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetChannelStreamProperties(
const kodi::addon::PVRChannel& channel,
std::vector<kodi::addon::PVRStreamProperty>& properties)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the signal status of the stream that's currently open.
///
/// @param[out] signalStatus The signal status.
/// @return @ref PVR_ERROR_NO_ERROR if the signal status has been read successfully, false otherwise.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetHandlesInputStream "SetHandlesInputStream"
/// is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRSignalStatus_Help
///
///
/// --------------------------------------------------------------------------
///
///
/// **Here's example about the use of this:**
/// ~~~~~~~~~~~~~{.cpp}
/// #include <kodi/addon-instance/PVR.h>
/// ...
///
/// class ATTRIBUTE_HIDDEN CPVRExample
/// : public kodi::addon::CAddonBase,
/// public kodi::addon::CInstancePVRClient
/// {
/// public:
/// ...
/// PVR_ERROR SignalStatus(PVRSignalStatus &signalStatus) override
/// {
/// signalStatus.SetAapterName("Example adapter 1");
/// signalStatus.SetAdapterStatus("OK");
/// signalStatus.SetSignal(0xFFFF); // 100%
///
/// return PVR_ERROR_NO_ERROR;
/// }
/// };
///
/// ADDONCREATOR(CPVRExample)
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus& signalStatus)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the descramble information of the stream that's currently open.
///
/// @param[out] descrambleInfo The descramble information.
/// @return @ref PVR_ERROR_NO_ERROR if the descramble information has been
/// read successfully, false otherwise.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsDescrambleInfo "supportsDescrambleInfo"
/// is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRDescrambleInfo_Help
///
virtual PVR_ERROR GetDescrambleInfo(int channelUid,
kodi::addon::PVRDescrambleInfo& descrambleInfo)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Request Kodi to update it's list of channels.
///
/// @remarks Only called from addon itself.
///
inline void TriggerChannelUpdate()
{
m_instanceData->toKodi->TriggerChannelUpdate(m_instanceData->toKodi->kodiInstance);
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_supportsChannelGroups 3. Channel Groups (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief <b>Bring in this functions if you have set @ref PVRCapabilities::SetSupportsChannelGroups "supportsChannelGroups"
/// to true</b>\n
/// This is used to divide available addon channels into groups, which can
/// then be selected by the user.
///
///
///---------------------------------------------------------------------------
///
/// **Channel group parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_supportsChannelGroups_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_supportsChannelGroups_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Get the total amount of channel groups on the backend if it supports channel groups.
///
/// @param[out] amount The total amount of channel groups on the backend
/// @return @ref PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelGroups "supportsChannelGroups" is set to true.
///
virtual PVR_ERROR GetChannelGroupsAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get a list of available channel groups on addon
///
/// Request the list of all channel groups from the backend if it supports
/// channel groups.
///
/// @param[in] radio True to get the radio channel groups, false to get the
/// TV channel groups.
/// @param[out] results List of available groups on addon defined with
/// @ref cpp_kodi_addon_pvr_Defs_ChannelGroup_PVRChannelGroup,
/// them transferred with
/// @ref cpp_kodi_addon_pvr_Defs_ChannelGroup_PVRChannelGroupsResultSet.
/// @return @ref PVR_ERROR_NO_ERROR if the list has been fetched successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_ChannelGroup_PVRChannelGroup_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelGroups "supportsChannelGroups"
/// is set to true.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet& groups)
/// {
/// kodi::addon::PVRChannelGroup group;
/// group.SetIsRadio(false);
/// group.SetGroupName("My group name");
/// group.SetPosition(1);
/// ...
///
/// // Give it now to Kodi
/// results.Add(group);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get a list of members on a group
///
/// Request the list of all group members of a group from the backend if it
/// supports channel groups.
///
/// @param[in] group The group to get the members for.
/// @param[out] results List of available group member channels defined with
/// @ref cpp_kodi_addon_pvr_Defs_ChannelGroup_PVRChannelGroupMember,
/// them transferred with
/// @ref PVRChannelGroupMembersResultSet.
/// @return @ref PVR_ERROR_NO_ERROR if the list has been fetched successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_ChannelGroup_PVRChannelGroupMember_Help
///
/// --------------------------------------------------------------------------
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelGroups "supportsChannelGroups"
/// is set to true.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetChannelGroupMembers(const kodi::addon::PVRChannelGroup& group,
/// kodi::addon::PVRChannelGroupMembersResultSet& results)
/// {
/// for (const auto& myGroup : m_myGroups)
/// {
/// if (myGroup.strGroupName == group.GetGroupName())
/// {
/// for (unsigned int iChannelPtr = 0; iChannelPtr < myGroup.members.size(); iChannelPtr++)
/// {
/// int iId = myGroup.members.at(iChannelPtr) - 1;
/// if (iId < 0 || iId > (int)m_channels.size() - 1)
/// continue;
///
/// PVRDemoChannel &channel = m_channels.at(iId);
/// kodi::addon::PVRChannelGroupMember kodiGroupMember;
/// kodiGroupMember.SetGroupName(group.GetGroupName());
/// kodiGroupMember.SetChannelUniqueId(channel.iUniqueId);
/// kodiGroupMember.SetChannelNumber(channel.iChannelNumber);
/// kodiGroupMember.SetSubChannelNumber(channel.iSubChannelNumber);
///
/// results.Add(kodiGroupMember);
/// }
/// }
/// }
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetChannelGroupMembers(const kodi::addon::PVRChannelGroup& group,
kodi::addon::PVRChannelGroupMembersResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Request Kodi to update it's list of channel groups.
///
/// @remarks Only called from addon itself
///
inline void TriggerChannelGroupsUpdate()
{
m_instanceData->toKodi->TriggerChannelGroupsUpdate(m_instanceData->toKodi->kodiInstance);
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_supportsChannelEdit 4. Channel edit (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief <b>Bring in this functions if you have set @ref PVRCapabilities::SetSupportsChannelSettings "supportsChannelSettings"
/// to true or for @ref OpenDialogChannelScan() set @ref PVRCapabilities::SetSupportsChannelScan "supportsChannelScan"
/// to true</b>\n
/// The support of this is a pure option and not mandatory.
///
///
///---------------------------------------------------------------------------
///
/// **Channel edit parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_supportsChannelEdit_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_supportsChannelEdit_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Delete a channel from the backend.
///
/// @param[in] channel The channel to delete.
/// @return @ref PVR_ERROR_NO_ERROR if the channel has been deleted successfully.
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelSettings "supportsChannelSettings"
/// is set to true.
///
virtual PVR_ERROR DeleteChannel(const kodi::addon::PVRChannel& channel)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Rename a channel on the backend.
///
/// @param[in] channel The channel to rename, containing the new channel name.
/// @return @ref PVR_ERROR_NO_ERROR if the channel has been renamed successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRChannel_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsChannelSettings "supportsChannelSettings"
/// is set to true.
///
virtual PVR_ERROR RenameChannel(const kodi::addon::PVRChannel& channel)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Show the channel settings dialog, if supported by the backend.
///
/// @param[in] channel The channel to show the dialog for.
/// @return @ref PVR_ERROR_NO_ERROR if the dialog has been displayed successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelSettings "supportsChannelSettings" is set to true.
/// @note Use @ref cpp_kodi_gui_CWindow "kodi::gui::CWindow" to create dialog for them.
///
virtual PVR_ERROR OpenDialogChannelSettings(const kodi::addon::PVRChannel& channel)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Show the dialog to add a channel on the backend, if supported by the backend.
///
/// @param[in] channel The channel to add.
/// @return @ref PVR_ERROR_NO_ERROR if the channel has been added successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelSettings "supportsChannelSettings" is set to true.
/// @note Use @ref cpp_kodi_gui_CWindow "kodi::gui::CWindow" to create dialog for them.
///
virtual PVR_ERROR OpenDialogChannelAdd(const kodi::addon::PVRChannel& channel)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Show the channel scan dialog if this backend supports it.
///
/// @return @ref PVR_ERROR_NO_ERROR if the dialog was displayed successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsChannelScan "supportsChannelScan" is set to true.
/// @note Use @ref cpp_kodi_gui_CWindow "kodi::gui::CWindow" to create dialog for them.
///
virtual PVR_ERROR OpenDialogChannelScan() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Call one of the channel related menu hooks (if supported).
///
/// Supported @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook instances have to be added in
/// `constructor()`, by calling @ref AddMenuHook() on the callback.
///
/// @param[in] menuhook The hook to call.
/// @param[in] item The selected channel item for which the hook was called.
/// @return @ref PVR_ERROR_NO_ERROR if the hook was called successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
virtual PVR_ERROR CallChannelMenuHook(const kodi::addon::PVRMenuhook& menuhook,
const kodi::addon::PVRChannel& item)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_EPGTag 4. EPG methods (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief **PVR EPG methods**\n
/// These C ++ class functions of are intended for processing EPG information
/// and for giving it to Kodi.
///
/// The necessary data is transferred with @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag.
///
/// @remarks Only used by Kodi if @ref PVRCapabilities::SetSupportsEPG "supportsEPG"
/// is set to true.\n\n
///
///
///---------------------------------------------------------------------------
///
/// **EPG parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_EPGTag_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_EPGTag_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Request the EPG for a channel from the backend.
///
/// @param[in] channelUid The UID of the channel to get the EPG table for.
/// @param[in] start Get events after this time (UTC).
/// @param[in] end Get events before this time (UTC).
/// @param[out] results List where available EPG information becomes
/// transferred with @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag
/// and given to Kodi
/// @return @ref PVR_ERROR_NO_ERROR if the table has been fetched successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_epg_PVREPGTag_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsEPG "supportsEPG" is set to true.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetEPGForChannel(int channelUid,
/// time_t start,
/// time_t end,
/// kodi::addon::PVREPGTagsResultSet& results)
/// {
/// // Minimal demo example, in reality bigger, loop to transfer all and to
/// // match wanted times.
/// kodi::addon::PVREPGTag tag;
/// tag.SetUniqueBroadcastId(123);
/// tag.SetUniqueChannelId(123);
/// tag.SetTitle("My epg entry name");
/// tag.SetGenreType(EPG_EVENT_CONTENTMASK_MOVIEDRAMA);
/// tag.SetStartTime(1589148283); // Seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
/// tag.SetEndTime(1589151913);
/// ...
///
/// // Give it now to Kodi
/// results.Add(tag);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetEPGForChannel(int channelUid,
time_t start,
time_t end,
kodi::addon::PVREPGTagsResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Check if the given EPG tag can be recorded.
///
/// @param[in] tag the @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "epg tag" to check.
/// @param[out] isRecordable Set to true if the tag can be recorded.
/// @return @ref PVR_ERROR_NO_ERROR if bIsRecordable has been set successfully.
///
/// @remarks Optional, it return @ref PVR_ERROR_NOT_IMPLEMENTED by parent to let Kodi decide.
///
virtual PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Check if the given EPG tag can be played.
///
/// @param[in] tag the @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "epg tag" to check.
/// @param[out] isPlayable Set to true if the tag can be played.
/// @return @ref PVR_ERROR_NO_ERROR if bIsPlayable has been set successfully.
///
/// @remarks Required if add-on supports playing epg tags.
///
virtual PVR_ERROR IsEPGTagPlayable(const kodi::addon::PVREPGTag& tag, bool& isPlayable)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Retrieve the edit decision list (EDL) of an EPG tag on the backend.
///
/// @param[in] tag The @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "epg tag".
/// @param[out] edl The function has to write the EDL into this array.
/// @return @ref PVR_ERROR_NO_ERROR if the EDL was successfully read or no EDL exists.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsEPGEdl "supportsEPGEdl" is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_EDLEntry_PVREDLEntry_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsEPGEdl "supportsEPGEdl" is set to true.
///
virtual PVR_ERROR GetEPGTagEdl(const kodi::addon::PVREPGTag& tag,
std::vector<kodi::addon::PVREDLEntry>& edl)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the stream properties for an epg tag from the backend.
///
/// @param[in] tag The @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "epg tag" to get the stream properties for.
/// @param[out] properties the properties required to play the stream.
/// @return @ref PVR_ERROR_NO_ERROR if the stream is available.
///
/// @remarks Required if add-on supports playing epg tags.
/// In this case your implementation must fill the property @ref PVR_STREAM_PROPERTY_STREAMURL
/// with the URL Kodi should resolve to playback the epg tag.
/// It return @ref PVR_ERROR_NOT_IMPLEMENTED from parent if this add-on won't provide this function.
///
/// @note The value directly related to inputstream must always begin with the
/// name of the associated add-on, e.g. <b>`"inputstream.adaptive.manifest_update_parameter"`</b>.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetEPGTagStreamProperties(const kodi::addon::PVREPGTag& tag,
/// std::vector<kodi::addon::PVRStreamProperty>& properties)
/// {
/// ...
/// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive");
/// properties.emplace_back("inputstream.adaptive.manifest_type", "mpd");
/// properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
/// properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/xml+dash");
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetEPGTagStreamProperties(
const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVRStreamProperty>& properties)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Tell the client the time frame to use when notifying epg events back to Kodi
///
/// The client might push epg events asynchronously to Kodi using the callback function
/// @ref EpgEventStateChange. To be able to only push events that are actually of
/// interest for Kodi, client needs to know about the epg time frame Kodi uses. Kodi
/// supplies the current epg time frame value in @ref EpgMaxDays() when creating the
/// addon and calls @ref SetEPGTimeFrame later whenever Kodi's epg time frame value
/// changes.
///
/// @param[in] days number of days from "now". @ref EPG_TIMEFRAME_UNLIMITED means that Kodi
/// is interested in all epg events, regardless of event times.
/// @return @ref PVR_ERROR_NO_ERROR if new value was successfully set.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsEPG "supportsEPG" is set to true.
///
virtual PVR_ERROR SetEPGTimeFrame(int days) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Call one of the EPG related menu hooks (if supported).
///
/// Supported @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook instances have to be added in
/// `constructor()`, by calling @ref AddMenuHook() on the callback.
///
/// @param[in] menuhook The hook to call.
/// @param[in] tag The selected EPG item for which the hook was called.
/// @return @ref PVR_ERROR_NO_ERROR if the hook was called successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
virtual PVR_ERROR CallEPGMenuHook(const kodi::addon::PVRMenuhook& menuhook,
const kodi::addon::PVREPGTag& tag)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Get the Max days handled by Kodi.
///
/// If > @ref EPG_TIMEFRAME_UNLIMITED, in async epg mode, deliver only events
/// in the range from 'end time > now' to 'start time < now + EpgMaxDays().
/// @ref EPG_TIMEFRAME_UNLIMITED, notify all events.
///
/// @return The Max days handled by Kodi
///
inline int EpgMaxDays() const { return m_instanceData->props->iEpgMaxDays; }
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Schedule an EPG update for the given channel channel.
///
/// @param[in] channelUid The unique id of the channel for this add-on
///
/// @remarks Only called from addon itself
///
inline void TriggerEpgUpdate(unsigned int channelUid)
{
m_instanceData->toKodi->TriggerEpgUpdate(m_instanceData->toKodi->kodiInstance, channelUid);
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief **Callback to Kodi Function**\n
/// Notify a state change for an EPG event.
///
/// @param[in] tag The @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag "EPG tag" where have event.
/// @param[in] newState The new state.
/// - For @ref EPG_EVENT_CREATED and @ref EPG_EVENT_UPDATED, tag must be filled with all available event data, not just a delta.
/// - For @ref EPG_EVENT_DELETED, it is sufficient to fill @ref kodi::addon::PVREPGTag::SetUniqueBroadcastId
///
/// @remarks Only called from addon itself,
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
///
/// void CMyPVRInstance::MyProcessFunction()
/// {
/// ...
/// kodi::addon::PVREPGTag tag; // Here as mini add, in real it should be a complete tag
/// tag.SetUniqueId(123);
///
/// // added namespace here not needed to have, only to have more clear for where is
/// kodi::addon::CInstancePVRClient::EpgEventStateChange(tag, EPG_EVENT_UPDATED);
/// ...
/// }
///
/// ...
/// ~~~~~~~~~~~~~
///
inline void EpgEventStateChange(kodi::addon::PVREPGTag& tag, EPG_EVENT_STATE newState)
{
m_instanceData->toKodi->EpgEventStateChange(m_instanceData->toKodi->kodiInstance, tag.GetTag(),
newState);
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Recordings 5. Recordings (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief **PVR recording methods**\n
/// To transfer available recordings of the PVR backend and to allow possible
/// playback.
///
/// @remarks Only used by Kodi if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings"
/// is set to true.\n\n
/// If a recordings changes after the initial import, or if a new one was added,
/// then the add-on should call @ref TriggerRecordingUpdate().
///
///
///---------------------------------------------------------------------------
///
/// **Recordings parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Recordings_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Recordings_source_addon_auto_check
///
///@{
//============================================================================
/// @brief To get amount of recording present on backend
///
/// @param[in] deleted if set return deleted recording (called if
/// @ref PVRCapabilities::SetSupportsRecordingsUndelete "supportsRecordingsUndelete"
/// set to true)
/// @param[out] amount The total amount of recordings on the backend
/// @return @ref PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings" is set to true.
///
virtual PVR_ERROR GetRecordingsAmount(bool deleted, int& amount)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Request the list of all recordings from the backend, if supported.
///
/// Recording entries are added to Kodi by calling TransferRecordingEntry() on the callback.
///
/// @param[in] deleted if set return deleted recording (called if
/// @ref PVRCapabilities::SetSupportsRecordingsUndelete "supportsRecordingsUndelete"
/// set to true)
/// @param[out] results List of available recordings with @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// becomes transferred with @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecordingsResultSet
/// and given to Kodi
/// @return @ref PVR_ERROR_NO_ERROR if the recordings have been fetched successfully.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings"
/// is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Recording_PVRRecording_Help
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet& results)
/// {
/// // Minimal demo example, in reality bigger and loop to transfer all
/// kodi::addon::PVRRecording recording;
/// recording.SetRecordingId(123);
/// recording.SetTitle("My recording name");
/// ...
///
/// // Give it now to Kodi
/// results.Add(recording);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Delete a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording to delete.
/// @return @ref PVR_ERROR_NO_ERROR if the recording has been deleted successfully.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings"
/// is set to true.
///
virtual PVR_ERROR DeleteRecording(const kodi::addon::PVRRecording& recording)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Undelete a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording to undelete.
/// @return @ref PVR_ERROR_NO_ERROR if the recording has been undeleted successfully.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordingsUndelete "supportsRecordingsUndelete"
/// is set to true.
///
virtual PVR_ERROR UndeleteRecording(const kodi::addon::PVRRecording& recording)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Delete all recordings permanent which in the deleted folder on the backend.
///
/// @return @ref PVR_ERROR_NO_ERROR if the recordings has been deleted successfully.
///
virtual PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Rename a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// to rename, containing the new name.
/// @return @ref PVR_ERROR_NO_ERROR if the recording has been renamed successfully.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings"
/// is set to true.
///
virtual PVR_ERROR RenameRecording(const kodi::addon::PVRRecording& recording)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Set the lifetime of a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// to change the lifetime for. recording.iLifetime
/// contains the new lieftime value.
/// @return @ref PVR_ERROR_NO_ERROR if the recording's lifetime has been set
/// successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordingsLifetimeChange "supportsRecordingsLifetimeChange"
/// is set to true.
///
virtual PVR_ERROR SetRecordingLifetime(const kodi::addon::PVRRecording& recording)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Set the play count of a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// to change the play count.
/// @param[in] count Play count.
/// @return @ref PVR_ERROR_NO_ERROR if the recording's play count has been set
/// successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordingPlayCount "supportsRecordingPlayCount"
/// is set to true.
///
virtual PVR_ERROR SetRecordingPlayCount(const kodi::addon::PVRRecording& recording, int count)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Set the last watched position of a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording.
/// @param[in] lastplayedposition The last watched position in seconds
/// @return @ref PVR_ERROR_NO_ERROR if the position has been stored successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsLastPlayedPosition "supportsLastPlayedPosition"
/// is set to true.
///
virtual PVR_ERROR SetRecordingLastPlayedPosition(const kodi::addon::PVRRecording& recording,
int lastplayedposition)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Retrieve the last watched position of a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording.
/// @param[out] position The last watched position in seconds
/// @return @ref PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordingPlayCount "supportsRecordingPlayCount"
/// is set to true.
///
virtual PVR_ERROR GetRecordingLastPlayedPosition(const kodi::addon::PVRRecording& recording,
int& position)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Retrieve the edit decision list (EDL) of a recording on the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording.
/// @param[out] edl The function has to write the EDL into this array.
/// @return @ref PVR_ERROR_NO_ERROR if the EDL was successfully read or no EDL exists.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordingEdl "supportsRecordingEdl"
/// is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_EDLEntry_PVREDLEntry_Help
///
virtual PVR_ERROR GetRecordingEdl(const kodi::addon::PVRRecording& recording,
std::vector<kodi::addon::PVREDLEntry>& edl)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Retrieve the size of a recording on the backend.
///
/// @param[in] recording The recording to get the size in bytes for.
/// @param[out] size The size in bytes of the recording
/// @return @ref PVR_ERROR_NO_ERROR if the recording's size has been set successfully.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordingSize "supportsRecordingSize"
/// is set to true.
///
virtual PVR_ERROR GetRecordingSize(const kodi::addon::PVRRecording& recording, int64_t& size)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Get the stream properties for a recording from the backend.
///
/// @param[in] recording The @ref cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// to get the stream properties for.
/// @param[out] properties The properties required to play the stream.
/// @return @ref PVR_ERROR_NO_ERROR if the stream is available.
///
/// @remarks Required if @ref PVRCapabilities::SetSupportsRecordings "supportsRecordings"
/// is set to true and the add-on does not implement recording stream functions
/// (@ref OpenRecordedStream, ...).\n
/// In this case your implementation must fill the property @ref PVR_STREAM_PROPERTY_STREAMURL
/// with the URL Kodi should resolve to playback the recording.
///
/// @note The value directly related to inputstream must always begin with the
/// name of the associated add-on, e.g. <b>`"inputstream.adaptive.manifest_update_parameter"`</b>.
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetRecordingStreamProperties(const kodi::addon::PVRRecording& recording,
/// std::vector<kodi::addon::PVRStreamProperty>& properties)
/// {
/// ...
/// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive");
/// properties.emplace_back("inputstream.adaptive.manifest_type", "mpd");
/// properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
/// properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/xml+dash");
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetRecordingStreamProperties(
const kodi::addon::PVRRecording& recording,
std::vector<kodi::addon::PVRStreamProperty>& properties)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//==========================================================================
/// @brief Call one of the recording related menu hooks (if supported).
///
/// Supported @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook instances have to be added in
/// `constructor()`, by calling @ref AddMenuHook() on the callback.
///
/// @param[in] menuhook The hook to call.
/// @param[in] item The selected recording item for which the hook was called.
/// @return @ref PVR_ERROR_NO_ERROR if the hook was called successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
virtual PVR_ERROR CallRecordingMenuHook(const kodi::addon::PVRMenuhook& menuhook,
const kodi::addon::PVRRecording& item)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Display a notification in Kodi that a recording started or stopped on the
/// server.
///
/// @param[in] recordingName The name of the recording to display
/// @param[in] fileName The filename of the recording
/// @param[in] on True when recording started, false when it stopped
///
/// @remarks Only called from addon itself
///
inline void RecordingNotification(const std::string& recordingName,
const std::string& fileName,
bool on)
{
m_instanceData->toKodi->RecordingNotification(m_instanceData->toKodi->kodiInstance,
recordingName.c_str(), fileName.c_str(), on);
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Request Kodi to update it's list of recordings.
///
/// @remarks Only called from addon itself
///
inline void TriggerRecordingUpdate()
{
m_instanceData->toKodi->TriggerRecordingUpdate(m_instanceData->toKodi->kodiInstance);
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Timers 6. Timers (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief **PVR timer methods**\n
/// For editing and displaying timed work, such as video recording.
///
/// @remarks Only used by Kodi if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.\n\n
/// If a timer changes after the initial import, or if a new one was added,
/// then the add-on should call @ref TriggerTimerUpdate().
///
///
///---------------------------------------------------------------------------
///
/// **Timer parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Timers_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Timers_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Retrieve the timer types supported by the backend.
///
/// @param[out] types The function has to write the definition of the
/// @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimerType types
/// into this array.
/// @return @ref PVR_ERROR_NO_ERROR if the types were successfully written to
/// the array.
///
/// @note Maximal 32 entries are allowed inside.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Timer_PVRTimerType_Help
///
virtual PVR_ERROR GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief To get total amount of timers on the backend or -1 on error.
///
/// @param[out] amount The total amount of timers on the backend
/// @return @ref PVR_ERROR_NO_ERROR if the amount has been fetched successfully.
///
/// @note Required to use if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.
///
virtual PVR_ERROR GetTimersAmount(int& amount) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Request the list of all timers from the backend if supported.
///
/// @param[out] results List of available timers with @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimer
/// becomes transferred with @ref cpp_kodi_addon_pvr_Defs_Timer_PVRTimersResultSet
/// and given to Kodi
/// @return @ref PVR_ERROR_NO_ERROR if the list has been fetched successfully.
///
/// @note Required to use if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Timer_PVRTimer_Help
///
///
///---------------------------------------------------------------------------
///
/// **Example:**
/// ~~~~~~~~~~~~~{.cpp}
/// ...
/// PVR_ERROR CMyPVRInstance::GetTimers(kodi::addon::PVRTimersResultSet& results)
/// {
/// // Minimal demo example, in reality bigger and loop to transfer all
/// kodi::addon::PVRTimer timer;
/// timer.SetClientIndex(123);
/// timer.SetState(PVR_TIMER_STATE_SCHEDULED);
/// timer.SetTitle("My timer name");
/// ...
///
/// // Give it now to Kodi
/// results.Add(timer);
/// return PVR_ERROR_NO_ERROR;
/// }
/// ...
/// ~~~~~~~~~~~~~
///
virtual PVR_ERROR GetTimers(kodi::addon::PVRTimersResultSet& results)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Add a timer on the backend.
///
/// @param[in] timer The timer to add.
/// @return @ref PVR_ERROR_NO_ERROR if the timer has been added successfully.
///
/// @note Required to use if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.
///
virtual PVR_ERROR AddTimer(const kodi::addon::PVRTimer& timer)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Delete a timer on the backend.
///
/// @param[in] timer The timer to delete.
/// @param[in] forceDelete Set to true to delete a timer that is currently
/// recording a program.
/// @return @ref PVR_ERROR_NO_ERROR if the timer has been deleted successfully.
///
/// @note Required to use if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.
///
virtual PVR_ERROR DeleteTimer(const kodi::addon::PVRTimer& timer, bool forceDelete)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Update the timer information on the backend.
///
/// @param[in] timer The timer to update.
/// @return @ref PVR_ERROR_NO_ERROR if the timer has been updated successfully.
///
/// @note Required to use if @ref PVRCapabilities::SetSupportsTimers "supportsTimers"
/// is set to true.
///
virtual PVR_ERROR UpdateTimer(const kodi::addon::PVRTimer& timer)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Call one of the timer related menu hooks (if supported).
///
/// Supported @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook instances have
/// to be added in `constructor()`, by calling @ref AddMenuHook() on the
/// callback.
///
/// @param[in] menuhook The hook to call.
/// @param[in] item The selected timer item for which the hook was called.
/// @return @ref PVR_ERROR_NO_ERROR if the hook was called successfully.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
virtual PVR_ERROR CallTimerMenuHook(const kodi::addon::PVRMenuhook& menuhook,
const kodi::addon::PVRTimer& item)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Request Kodi to update it's list of timers.
///
/// @remarks Only called from addon itself
///
inline void TriggerTimerUpdate()
{
m_instanceData->toKodi->TriggerTimerUpdate(m_instanceData->toKodi->kodiInstance);
}
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_PowerManagement 7. Power management events (optional)
/// @ingroup cpp_kodi_addon_pvr
/// @brief **Used to notify the pvr addon for power management events**\n
/// Used to allow any energy savings.
///
///
///---------------------------------------------------------------------------
///
/// **Power management events in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_PowerManagement_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_PowerManagement_source_addon_auto_check
///
///@{
//============================================================================
/// @brief To notify addon about system sleep
///
/// @return @ref PVR_ERROR_NO_ERROR If successfully done.
///
virtual PVR_ERROR OnSystemSleep() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief To notify addon about system wake up
///
/// @return @ref PVR_ERROR_NO_ERROR If successfully done.
///
virtual PVR_ERROR OnSystemWake() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief To notify addon power saving on system is activated
///
/// @return @ref PVR_ERROR_NO_ERROR If successfully done.
///
virtual PVR_ERROR OnPowerSavingActivated() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief To notify addon power saving on system is deactivated
///
/// @return @ref PVR_ERROR_NO_ERROR If successfully done.
///
virtual PVR_ERROR OnPowerSavingDeactivated() { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Streams 8. Inputstream
/// @ingroup cpp_kodi_addon_pvr
/// @brief **PVR Inputstream**\n
/// This includes functions that are used in the PVR inputstream.
///
/// @warning The parts here will be removed in the future and replaced by the
/// separate @ref cpp_kodi_addon_inputstream "inputstream addon instance".
/// If there is already a possibility, new addons should do it via the
/// inputstream instance.
///
///@{
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Streams_TV 8.1. TV stream
/// @ingroup cpp_kodi_addon_pvr_Streams
/// @brief **PVR TV stream**\n
/// Stream processing regarding live TV.
///
///
///---------------------------------------------------------------------------
///
/// **TV stream parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Streams_TV_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Streams_TV_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Open a live stream on the backend.
///
/// @param[in] channel The channel to stream.
/// @return True if the stream has been opened successfully, false otherwise.
///
/// --------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Channel_PVRChannel_Help
///
///
/// --------------------------------------------------------------------------
///
/// @remarks Required if @ref PVRCapabilities::SetHandlesInputStream() or
/// @ref PVRCapabilities::SetHandlesDemuxing() is set to true.
/// @ref CloseLiveStream() will always be called by Kodi prior to calling this
/// function.
///
virtual bool OpenLiveStream(const kodi::addon::PVRChannel& channel) { return false; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Close an open live stream.
///
/// @remarks Required if @ref PVRCapabilities::SetHandlesInputStream() or
/// @ref PVRCapabilities::SetHandlesDemuxing() is set to true.
///
virtual void CloseLiveStream() {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Read from an open live stream.
///
/// @param[in] pBuffer The buffer to store the data in.
/// @param[in] iBufferSize The amount of bytes to read.
/// @return The amount of bytes that were actually read from the stream.
///
/// @remarks Required if @ref PVRCapabilities::SetHandlesInputStream() is set
/// to true.
///
virtual int ReadLiveStream(unsigned char* buffer, unsigned int size) { return 0; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Seek in a live stream on a backend that supports timeshifting.
///
/// @param[in] position The position to seek to.
/// @param[in] whence [optional] offset relative to
/// You can set the value of whence to one of three things:
/// | Value | int | Description |
/// |:--------:|:---:|:----------------------------------------------------|
/// | SEEK_SET | 0 | position is relative to the beginning of the file. This is probably what you had in mind anyway, and is the most commonly used value for whence.
/// | SEEK_CUR | 1 | position is relative to the current file pointer position. So, in effect, you can say, "Move to my current position plus 30 bytes," or, "move to my current position minus 20 bytes."
/// | SEEK_END | 2 | position is relative to the end of the file. Just like SEEK_SET except from the other end of the file. Be sure to use negative values for offset if you want to back up from the end of the file, instead of going past the end into oblivion.
///
/// @return The new position.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetHandlesInputStream()
/// is set to true.
///
virtual int64_t SeekLiveStream(int64_t position, int whence) { return 0; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Obtain the length of a live stream.
///
/// @return The total length of the stream that's currently being read.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetHandlesInputStream()
/// is set to true.
///
virtual int64_t LengthLiveStream() { return 0; }
//----------------------------------------------------------------------------
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Streams_TV_Demux 8.1.1. Stream demuxing
/// @ingroup cpp_kodi_addon_pvr_Streams_TV
/// @brief **PVR stream demuxing**\n
/// Read TV streams with own demux within addon.
///
/// This is only on Live TV streams and only if @ref PVRCapabilities::SetHandlesDemuxing()
/// has been set to "true".
///
///
///---------------------------------------------------------------------------
///
/// **Stream demuxing parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Streams_TV_Demux_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Streams_TV_Demux_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Get the stream properties of the stream that's currently being read.
///
/// @param[in] properties The properties of the currently playing stream.
/// @return @ref PVR_ERROR_NO_ERROR if the properties have been fetched successfully.
///
/// @remarks Required, and only used if addon has its own demuxer.
///
virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Read the next packet from the demultiplexer, if there is one.
///
/// @return The next packet.
/// If there is no next packet, then the add-on should return the packet
/// created by calling @ref AllocateDemuxPacket(0) on the callback.
/// If the stream changed and Kodi's player needs to be reinitialised, then,
/// the add-on should call @ref AllocateDemuxPacket(0) on the callback, and set
/// the streamid to @ref DMX_SPECIALID_STREAMCHANGE and return the value.
/// The add-on should return `nullptr` if an error occurred.
///
/// @remarks Required, and only used if addon has its own demuxer.
/// Return `nullptr` if this add-on won't provide this function.
///
virtual DemuxPacket* DemuxRead() { return nullptr; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Reset the demultiplexer in the add-on.
///
/// @remarks Required, and only used if addon has its own demuxer.
///
virtual void DemuxReset() {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Abort the demultiplexer thread in the add-on.
///
/// @remarks Required, and only used if addon has its own demuxer.
///
virtual void DemuxAbort() {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Flush all data that's currently in the demultiplexer buffer in the
/// add-on.
///
/// @remarks Required, and only used if addon has its own demuxer.
///
virtual void DemuxFlush() {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Notify the pvr addon/demuxer that Kodi wishes to change playback
/// speed.
///
/// @param[in] speed The requested playback speed
///
/// @remarks Optional, and only used if addon has its own demuxer.
///
virtual void SetSpeed(int speed) {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
///
/// @param[in] mode The requested filling mode
///
/// @remarks Optional, and only used if addon has its own demuxer.
///
virtual void FillBuffer(bool mode) {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Notify the pvr addon/demuxer that Kodi wishes to seek the stream by
/// time.
///
/// @param[in] time The absolute time since stream start
/// @param[in] backwards True to seek to keyframe BEFORE time, else AFTER
/// @param[in] startpts can be updated to point to where display should start
/// @return True if the seek operation was possible
///
/// @remarks Optional, and only used if addon has its own demuxer.
/// Return False if this add-on won't provide this function.
///
virtual bool SeekTime(double time, bool backwards, double& startpts) { return false; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Get the codec id used by Kodi.
///
/// @param[in] codecName The name of the codec
/// @return The codec_id, or a codec_id with 0 values when not supported
///
/// @remarks Only called from addon itself
///
inline PVRCodec GetCodecByName(const std::string& codecName) const
{
return PVRCodec(m_instanceData->toKodi->GetCodecByName(m_instanceData->toKodi->kodiInstance,
codecName.c_str()));
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Allocate a demux packet. Free with @ref FreeDemuxPacket().
///
/// @param[in] iDataSize The size of the data that will go into the packet
/// @return The allocated packet
///
/// @remarks Only called from addon itself
///
inline DemuxPacket* AllocateDemuxPacket(int iDataSize)
{
return m_instanceData->toKodi->AllocateDemuxPacket(m_instanceData->toKodi->kodiInstance,
iDataSize);
}
//----------------------------------------------------------------------------
//============================================================================
/// @brief **Callback to Kodi Function**\n
/// Free a packet that was allocated with @ref AllocateDemuxPacket().
///
/// @param[in] pPacket The packet to free
///
/// @remarks Only called from addon itself.
///
inline void FreeDemuxPacket(DemuxPacket* pPacket)
{
m_instanceData->toKodi->FreeDemuxPacket(m_instanceData->toKodi->kodiInstance, pPacket);
}
//----------------------------------------------------------------------------
///@}
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Streams_Recording 8.2. Recording stream
/// @ingroup cpp_kodi_addon_pvr_Streams
/// @brief **PVR Recording stream**\n
/// Stream processing regarding recordings.
///
/// @note Demuxing is not possible with the recordings.
///
///
///---------------------------------------------------------------------------
///
/// **Recording stream parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Streams_Recording_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Streams_Recording_source_addon_auto_check
///
///@{
//============================================================================
/// @brief Open a stream to a recording on the backend.
///
/// @param[in] recording The recording to open.
/// @return True if the stream has been opened successfully, false otherwise.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings()
/// is set to true. @ref CloseRecordedStream() will always be called by Kodi
/// prior to calling this function.
///
virtual bool OpenRecordedStream(const kodi::addon::PVRRecording& recording) { return false; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Close an open stream from a recording.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings()
/// is set to true.
///
virtual void CloseRecordedStream() {}
//----------------------------------------------------------------------------
//============================================================================
/// @brief Read from a recording.
///
/// @param[in] buffer The buffer to store the data in.
/// @param[in] size The amount of bytes to read.
/// @return The amount of bytes that were actually read from the stream.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings()
/// is set to true.
///
virtual int ReadRecordedStream(unsigned char* buffer, unsigned int size) { return 0; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Seek in a recorded stream.
///
/// @param[in] position The position to seek to.
/// @param[in] whence [optional] offset relative to
/// You can set the value of whence to one of three things:
/// | Value | int | Description |
/// |:--------:|:---:|:----------------------------------------------------|
/// | SEEK_SET | 0 | position is relative to the beginning of the file. This is probably what you had in mind anyway, and is the most commonly used value for whence.
/// | SEEK_CUR | 1 | position is relative to the current file pointer position. So, in effect, you can say, "Move to my current position plus 30 bytes," or, "move to my current position minus 20 bytes."
/// | SEEK_END | 2 | position is relative to the end of the file. Just like SEEK_SET except from the other end of the file. Be sure to use negative values for offset if you want to back up from the end of the file, instead of going past the end into oblivion.
///
/// @return The new position.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings()
/// is set to true.
///
virtual int64_t SeekRecordedStream(int64_t position, int whence) { return 0; }
//----------------------------------------------------------------------------
//============================================================================
/// @brief Obtain the length of a recorded stream.
///
/// @return The total length of the stream that's currently being read.
///
/// @remarks Optional, and only used if @ref PVRCapabilities::SetSupportsRecordings()
/// is true (=> @ref ReadRecordedStream).
///
virtual int64_t LengthRecordedStream() { return 0; }
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
//============================================================================
/// @defgroup cpp_kodi_addon_pvr_Streams_Various 8.3. Various functions
/// @ingroup cpp_kodi_addon_pvr_Streams
/// @brief **Various other PVR stream related functions**\n
/// These apply to all other groups in inputstream and are therefore declared
/// as several.
///
///
///---------------------------------------------------------------------------
///
/// **Various stream parts in interface:**\n
/// Copy this to your project and extend with your parts or leave functions
/// complete away where not used or supported.
///
/// @copydetails cpp_kodi_addon_pvr_Streams_Various_header_addon_auto_check
/// @copydetails cpp_kodi_addon_pvr_Streams_Various_source_addon_auto_check
///
///@{
//============================================================================
///
/// @brief Check if the backend support pausing the currently playing stream.
///
/// This will enable/disable the pause button in Kodi based on the return
/// value.
///
/// @return false if the PVR addon/backend does not support pausing, true if
/// possible
///
virtual bool CanPauseStream() { return false; }
//----------------------------------------------------------------------------
//============================================================================
///
/// @brief Check if the backend supports seeking for the currently playing
/// stream.
///
/// This will enable/disable the rewind/forward buttons in Kodi based on the
/// return value.
///
/// @return false if the PVR addon/backend does not support seeking, true if
/// possible
///
virtual bool CanSeekStream() { return false; }
//----------------------------------------------------------------------------
//============================================================================
///
/// @brief Notify the pvr addon that Kodi (un)paused the currently playing
/// stream.
///
/// @param[in] paused To inform by `true` is paused and with `false` playing
///
virtual void PauseStream(bool paused) {}
//----------------------------------------------------------------------------
//============================================================================
///
/// @brief Check for real-time streaming.
///
/// @return true if current stream is real-time
///
virtual bool IsRealTimeStream() { return false; }
//----------------------------------------------------------------------------
//============================================================================
///
/// @brief Get stream times.
///
/// @param[out] times A pointer to the data to be filled by the implementation.
/// @return @ref PVR_ERROR_NO_ERROR on success.
///
virtual PVR_ERROR GetStreamTimes(kodi::addon::PVRStreamTimes& times)
{
return PVR_ERROR_NOT_IMPLEMENTED;
}
//----------------------------------------------------------------------------
//============================================================================
///
/// @brief Obtain the chunk size to use when reading streams.
///
/// @param[out] chunksize must be filled with the chunk size in bytes.
/// @return @ref PVR_ERROR_NO_ERROR if the chunk size has been fetched successfully.
///
/// @remarks Optional, and only used if not reading from demuxer (=> @ref DemuxRead) and
/// @ref PVRCapabilities::SetSupportsRecordings() is true (=> @ref ReadRecordedStream) or
/// @ref PVRCapabilities::SetHandlesInputStream() is true (=> @ref ReadLiveStream).
///
virtual PVR_ERROR GetStreamReadChunkSize(int& chunksize) { return PVR_ERROR_NOT_IMPLEMENTED; }
//----------------------------------------------------------------------------
///@}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
private:
void SetAddonStruct(KODI_HANDLE instance, const std::string& kodiVersion)
{
if (instance == nullptr)
throw std::logic_error("kodi::addon::CInstancePVRClient: Creation with empty addon "
"structure not allowed, table must be given from Kodi!");
m_instanceData = static_cast<AddonInstance_PVR*>(instance);
m_instanceData->toAddon->addonInstance = this;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetCapabilities = ADDON_GetCapabilities;
m_instanceData->toAddon->GetConnectionString = ADDON_GetConnectionString;
m_instanceData->toAddon->GetBackendName = ADDON_GetBackendName;
m_instanceData->toAddon->GetBackendVersion = ADDON_GetBackendVersion;
m_instanceData->toAddon->GetBackendHostname = ADDON_GetBackendHostname;
m_instanceData->toAddon->GetDriveSpace = ADDON_GetDriveSpace;
m_instanceData->toAddon->CallSettingsMenuHook = ADDON_CallSettingsMenuHook;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetChannelsAmount = ADDON_GetChannelsAmount;
m_instanceData->toAddon->GetChannels = ADDON_GetChannels;
m_instanceData->toAddon->GetChannelStreamProperties = ADDON_GetChannelStreamProperties;
m_instanceData->toAddon->GetSignalStatus = ADDON_GetSignalStatus;
m_instanceData->toAddon->GetDescrambleInfo = ADDON_GetDescrambleInfo;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetChannelGroupsAmount = ADDON_GetChannelGroupsAmount;
m_instanceData->toAddon->GetChannelGroups = ADDON_GetChannelGroups;
m_instanceData->toAddon->GetChannelGroupMembers = ADDON_GetChannelGroupMembers;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->DeleteChannel = ADDON_DeleteChannel;
m_instanceData->toAddon->RenameChannel = ADDON_RenameChannel;
m_instanceData->toAddon->OpenDialogChannelSettings = ADDON_OpenDialogChannelSettings;
m_instanceData->toAddon->OpenDialogChannelAdd = ADDON_OpenDialogChannelAdd;
m_instanceData->toAddon->OpenDialogChannelScan = ADDON_OpenDialogChannelScan;
m_instanceData->toAddon->CallChannelMenuHook = ADDON_CallChannelMenuHook;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetEPGForChannel = ADDON_GetEPGForChannel;
m_instanceData->toAddon->IsEPGTagRecordable = ADDON_IsEPGTagRecordable;
m_instanceData->toAddon->IsEPGTagPlayable = ADDON_IsEPGTagPlayable;
m_instanceData->toAddon->GetEPGTagEdl = ADDON_GetEPGTagEdl;
m_instanceData->toAddon->GetEPGTagStreamProperties = ADDON_GetEPGTagStreamProperties;
m_instanceData->toAddon->SetEPGTimeFrame = ADDON_SetEPGTimeFrame;
m_instanceData->toAddon->CallEPGMenuHook = ADDON_CallEPGMenuHook;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetRecordingsAmount = ADDON_GetRecordingsAmount;
m_instanceData->toAddon->GetRecordings = ADDON_GetRecordings;
m_instanceData->toAddon->DeleteRecording = ADDON_DeleteRecording;
m_instanceData->toAddon->UndeleteRecording = ADDON_UndeleteRecording;
m_instanceData->toAddon->DeleteAllRecordingsFromTrash = ADDON_DeleteAllRecordingsFromTrash;
m_instanceData->toAddon->RenameRecording = ADDON_RenameRecording;
m_instanceData->toAddon->SetRecordingLifetime = ADDON_SetRecordingLifetime;
m_instanceData->toAddon->SetRecordingPlayCount = ADDON_SetRecordingPlayCount;
m_instanceData->toAddon->SetRecordingLastPlayedPosition = ADDON_SetRecordingLastPlayedPosition;
m_instanceData->toAddon->GetRecordingLastPlayedPosition = ADDON_GetRecordingLastPlayedPosition;
m_instanceData->toAddon->GetRecordingEdl = ADDON_GetRecordingEdl;
m_instanceData->toAddon->GetRecordingSize = ADDON_GetRecordingSize;
m_instanceData->toAddon->GetRecordingStreamProperties = ADDON_GetRecordingStreamProperties;
m_instanceData->toAddon->CallRecordingMenuHook = ADDON_CallRecordingMenuHook;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->GetTimerTypes = ADDON_GetTimerTypes;
m_instanceData->toAddon->GetTimersAmount = ADDON_GetTimersAmount;
m_instanceData->toAddon->GetTimers = ADDON_GetTimers;
m_instanceData->toAddon->AddTimer = ADDON_AddTimer;
m_instanceData->toAddon->DeleteTimer = ADDON_DeleteTimer;
m_instanceData->toAddon->UpdateTimer = ADDON_UpdateTimer;
m_instanceData->toAddon->CallTimerMenuHook = ADDON_CallTimerMenuHook;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->OnSystemSleep = ADDON_OnSystemSleep;
m_instanceData->toAddon->OnSystemWake = ADDON_OnSystemWake;
m_instanceData->toAddon->OnPowerSavingActivated = ADDON_OnPowerSavingActivated;
m_instanceData->toAddon->OnPowerSavingDeactivated = ADDON_OnPowerSavingDeactivated;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->OpenLiveStream = ADDON_OpenLiveStream;
m_instanceData->toAddon->CloseLiveStream = ADDON_CloseLiveStream;
m_instanceData->toAddon->ReadLiveStream = ADDON_ReadLiveStream;
m_instanceData->toAddon->SeekLiveStream = ADDON_SeekLiveStream;
m_instanceData->toAddon->LengthLiveStream = ADDON_LengthLiveStream;
m_instanceData->toAddon->GetStreamProperties = ADDON_GetStreamProperties;
m_instanceData->toAddon->GetStreamReadChunkSize = ADDON_GetStreamReadChunkSize;
m_instanceData->toAddon->IsRealTimeStream = ADDON_IsRealTimeStream;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->OpenRecordedStream = ADDON_OpenRecordedStream;
m_instanceData->toAddon->CloseRecordedStream = ADDON_CloseRecordedStream;
m_instanceData->toAddon->ReadRecordedStream = ADDON_ReadRecordedStream;
m_instanceData->toAddon->SeekRecordedStream = ADDON_SeekRecordedStream;
m_instanceData->toAddon->LengthRecordedStream = ADDON_LengthRecordedStream;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->DemuxReset = ADDON_DemuxReset;
m_instanceData->toAddon->DemuxAbort = ADDON_DemuxAbort;
m_instanceData->toAddon->DemuxFlush = ADDON_DemuxFlush;
m_instanceData->toAddon->DemuxRead = ADDON_DemuxRead;
//--==----==----==----==----==----==----==----==----==----==----==----==----==
m_instanceData->toAddon->CanPauseStream = ADDON_CanPauseStream;
m_instanceData->toAddon->PauseStream = ADDON_PauseStream;
m_instanceData->toAddon->CanSeekStream = ADDON_CanSeekStream;
m_instanceData->toAddon->SeekTime = ADDON_SeekTime;
m_instanceData->toAddon->SetSpeed = ADDON_SetSpeed;
m_instanceData->toAddon->FillBuffer = ADDON_FillBuffer;
m_instanceData->toAddon->GetStreamTimes = ADDON_GetStreamTimes;
}
inline static PVR_ERROR ADDON_GetCapabilities(const AddonInstance_PVR* instance,
PVR_ADDON_CAPABILITIES* capabilities)
{
PVRCapabilities cppCapabilities(capabilities);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetCapabilities(cppCapabilities);
}
inline static PVR_ERROR ADDON_GetBackendName(const AddonInstance_PVR* instance,
char* str,
int memSize)
{
std::string backendName;
PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetBackendName(backendName);
if (err == PVR_ERROR_NO_ERROR)
strncpy(str, backendName.c_str(), memSize);
return err;
}
inline static PVR_ERROR ADDON_GetBackendVersion(const AddonInstance_PVR* instance,
char* str,
int memSize)
{
std::string backendVersion;
PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetBackendVersion(backendVersion);
if (err == PVR_ERROR_NO_ERROR)
strncpy(str, backendVersion.c_str(), memSize);
return err;
}
inline static PVR_ERROR ADDON_GetBackendHostname(const AddonInstance_PVR* instance,
char* str,
int memSize)
{
std::string backendHostname;
PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetBackendHostname(backendHostname);
if (err == PVR_ERROR_NO_ERROR)
strncpy(str, backendHostname.c_str(), memSize);
return err;
}
inline static PVR_ERROR ADDON_GetConnectionString(const AddonInstance_PVR* instance,
char* str,
int memSize)
{
std::string connectionString;
PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetConnectionString(connectionString);
if (err == PVR_ERROR_NO_ERROR)
strncpy(str, connectionString.c_str(), memSize);
return err;
}
inline static PVR_ERROR ADDON_GetDriveSpace(const AddonInstance_PVR* instance,
uint64_t* total,
uint64_t* used)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetDriveSpace(*total, *used);
}
inline static PVR_ERROR ADDON_CallSettingsMenuHook(const AddonInstance_PVR* instance,
const PVR_MENUHOOK* menuhook)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->CallSettingsMenuHook(menuhook);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_GetChannelsAmount(const AddonInstance_PVR* instance, int* amount)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannelsAmount(*amount);
}
inline static PVR_ERROR ADDON_GetChannels(const AddonInstance_PVR* instance,
ADDON_HANDLE handle,
bool radio)
{
PVRChannelsResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannels(radio, result);
}
inline static PVR_ERROR ADDON_GetChannelStreamProperties(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel,
PVR_NAMED_VALUE* properties,
unsigned int* propertiesCount)
{
*propertiesCount = 0;
std::vector<PVRStreamProperty> propertiesList;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannelStreamProperties(channel, propertiesList);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& property : propertiesList)
{
strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
sizeof(properties[*propertiesCount].strName) - 1);
strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
sizeof(properties[*propertiesCount].strValue) - 1);
++*propertiesCount;
if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
break;
}
}
return error;
}
inline static PVR_ERROR ADDON_GetSignalStatus(const AddonInstance_PVR* instance,
int channelUid,
PVR_SIGNAL_STATUS* signalStatus)
{
PVRSignalStatus cppSignalStatus(signalStatus);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetSignalStatus(channelUid, cppSignalStatus);
}
inline static PVR_ERROR ADDON_GetDescrambleInfo(const AddonInstance_PVR* instance,
int channelUid,
PVR_DESCRAMBLE_INFO* descrambleInfo)
{
PVRDescrambleInfo cppDescrambleInfo(descrambleInfo);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetDescrambleInfo(channelUid, cppDescrambleInfo);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_GetChannelGroupsAmount(const AddonInstance_PVR* instance,
int* amount)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannelGroupsAmount(*amount);
}
inline static PVR_ERROR ADDON_GetChannelGroups(const AddonInstance_PVR* instance,
ADDON_HANDLE handle,
bool radio)
{
PVRChannelGroupsResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannelGroups(radio, result);
}
inline static PVR_ERROR ADDON_GetChannelGroupMembers(const AddonInstance_PVR* instance,
ADDON_HANDLE handle,
const PVR_CHANNEL_GROUP* group)
{
PVRChannelGroupMembersResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetChannelGroupMembers(group, result);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_DeleteChannel(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->DeleteChannel(channel);
}
inline static PVR_ERROR ADDON_RenameChannel(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->RenameChannel(channel);
}
inline static PVR_ERROR ADDON_OpenDialogChannelSettings(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OpenDialogChannelSettings(channel);
}
inline static PVR_ERROR ADDON_OpenDialogChannelAdd(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OpenDialogChannelAdd(channel);
}
inline static PVR_ERROR ADDON_OpenDialogChannelScan(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OpenDialogChannelScan();
}
inline static PVR_ERROR ADDON_CallChannelMenuHook(const AddonInstance_PVR* instance,
const PVR_MENUHOOK* menuhook,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->CallChannelMenuHook(menuhook, channel);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_GetEPGForChannel(const AddonInstance_PVR* instance,
ADDON_HANDLE handle,
int channelUid,
time_t start,
time_t end)
{
PVREPGTagsResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetEPGForChannel(channelUid, start, end, result);
}
inline static PVR_ERROR ADDON_IsEPGTagRecordable(const AddonInstance_PVR* instance,
const EPG_TAG* tag,
bool* isRecordable)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->IsEPGTagRecordable(tag, *isRecordable);
}
inline static PVR_ERROR ADDON_IsEPGTagPlayable(const AddonInstance_PVR* instance,
const EPG_TAG* tag,
bool* isPlayable)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->IsEPGTagPlayable(tag, *isPlayable);
}
inline static PVR_ERROR ADDON_GetEPGTagEdl(const AddonInstance_PVR* instance,
const EPG_TAG* tag,
PVR_EDL_ENTRY* edl,
int* size)
{
*size = 0;
std::vector<PVREDLEntry> edlList;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetEPGTagEdl(tag, edlList);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& edlEntry : edlList)
{
edl[*size] = *edlEntry;
++*size;
}
}
return error;
}
inline static PVR_ERROR ADDON_GetEPGTagStreamProperties(const AddonInstance_PVR* instance,
const EPG_TAG* tag,
PVR_NAMED_VALUE* properties,
unsigned int* propertiesCount)
{
*propertiesCount = 0;
std::vector<PVRStreamProperty> propertiesList;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetEPGTagStreamProperties(tag, propertiesList);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& property : propertiesList)
{
strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
sizeof(properties[*propertiesCount].strName) - 1);
strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
sizeof(properties[*propertiesCount].strValue) - 1);
++*propertiesCount;
if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
break;
}
}
return error;
}
inline static PVR_ERROR ADDON_SetEPGTimeFrame(const AddonInstance_PVR* instance, int days)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SetEPGTimeFrame(days);
}
inline static PVR_ERROR ADDON_CallEPGMenuHook(const AddonInstance_PVR* instance,
const PVR_MENUHOOK* menuhook,
const EPG_TAG* tag)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->CallEPGMenuHook(menuhook, tag);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_GetRecordingsAmount(const AddonInstance_PVR* instance,
bool deleted,
int* amount)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordingsAmount(deleted, *amount);
}
inline static PVR_ERROR ADDON_GetRecordings(const AddonInstance_PVR* instance,
ADDON_HANDLE handle,
bool deleted)
{
PVRRecordingsResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordings(deleted, result);
}
inline static PVR_ERROR ADDON_DeleteRecording(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->DeleteRecording(recording);
}
inline static PVR_ERROR ADDON_UndeleteRecording(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->UndeleteRecording(recording);
}
inline static PVR_ERROR ADDON_DeleteAllRecordingsFromTrash(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->DeleteAllRecordingsFromTrash();
}
inline static PVR_ERROR ADDON_RenameRecording(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->RenameRecording(recording);
}
inline static PVR_ERROR ADDON_SetRecordingLifetime(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SetRecordingLifetime(recording);
}
inline static PVR_ERROR ADDON_SetRecordingPlayCount(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
int count)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SetRecordingPlayCount(recording, count);
}
inline static PVR_ERROR ADDON_SetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
int lastplayedposition)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SetRecordingLastPlayedPosition(recording, lastplayedposition);
}
inline static PVR_ERROR ADDON_GetRecordingLastPlayedPosition(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
int* position)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordingLastPlayedPosition(recording, *position);
}
inline static PVR_ERROR ADDON_GetRecordingEdl(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
PVR_EDL_ENTRY* edl,
int* size)
{
*size = 0;
std::vector<PVREDLEntry> edlList;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordingEdl(recording, edlList);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& edlEntry : edlList)
{
edl[*size] = *edlEntry;
++*size;
}
}
return error;
}
inline static PVR_ERROR ADDON_GetRecordingSize(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
int64_t* size)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordingSize(recording, *size);
}
inline static PVR_ERROR ADDON_GetRecordingStreamProperties(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording,
PVR_NAMED_VALUE* properties,
unsigned int* propertiesCount)
{
*propertiesCount = 0;
std::vector<PVRStreamProperty> propertiesList;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetRecordingStreamProperties(recording, propertiesList);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& property : propertiesList)
{
strncpy(properties[*propertiesCount].strName, property.GetCStructure()->strName,
sizeof(properties[*propertiesCount].strName) - 1);
strncpy(properties[*propertiesCount].strValue, property.GetCStructure()->strValue,
sizeof(properties[*propertiesCount].strValue) - 1);
++*propertiesCount;
if (*propertiesCount > STREAM_MAX_PROPERTY_COUNT)
break;
}
}
return error;
}
inline static PVR_ERROR ADDON_CallRecordingMenuHook(const AddonInstance_PVR* instance,
const PVR_MENUHOOK* menuhook,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->CallRecordingMenuHook(menuhook, recording);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_GetTimerTypes(const AddonInstance_PVR* instance,
PVR_TIMER_TYPE* types,
int* typesCount)
{
*typesCount = 0;
std::vector<PVRTimerType> timerTypes;
PVR_ERROR error = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetTimerTypes(timerTypes);
if (error == PVR_ERROR_NO_ERROR)
{
for (const auto& timerType : timerTypes)
{
types[*typesCount] = *timerType;
++*typesCount;
if (*typesCount >= PVR_ADDON_TIMERTYPE_ARRAY_SIZE)
break;
}
}
return error;
}
inline static PVR_ERROR ADDON_GetTimersAmount(const AddonInstance_PVR* instance, int* amount)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetTimersAmount(*amount);
}
inline static PVR_ERROR ADDON_GetTimers(const AddonInstance_PVR* instance, ADDON_HANDLE handle)
{
PVRTimersResultSet result(instance, handle);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->GetTimers(result);
}
inline static PVR_ERROR ADDON_AddTimer(const AddonInstance_PVR* instance, const PVR_TIMER* timer)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->AddTimer(timer);
}
inline static PVR_ERROR ADDON_DeleteTimer(const AddonInstance_PVR* instance,
const PVR_TIMER* timer,
bool forceDelete)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->DeleteTimer(timer, forceDelete);
}
inline static PVR_ERROR ADDON_UpdateTimer(const AddonInstance_PVR* instance,
const PVR_TIMER* timer)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->UpdateTimer(timer);
}
inline static PVR_ERROR ADDON_CallTimerMenuHook(const AddonInstance_PVR* instance,
const PVR_MENUHOOK* menuhook,
const PVR_TIMER* timer)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->CallTimerMenuHook(menuhook, timer);
}
//--==----==----==----==----==----==----==----==----==----==----==----==----==
inline static PVR_ERROR ADDON_OnSystemSleep(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemSleep();
}
inline static PVR_ERROR ADDON_OnSystemWake(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->OnSystemWake();
}
inline static PVR_ERROR ADDON_OnPowerSavingActivated(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OnPowerSavingActivated();
}
inline static PVR_ERROR ADDON_OnPowerSavingDeactivated(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OnPowerSavingDeactivated();
}
// obsolete parts below
///@{
inline static bool ADDON_OpenLiveStream(const AddonInstance_PVR* instance,
const PVR_CHANNEL* channel)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OpenLiveStream(channel);
}
inline static void ADDON_CloseLiveStream(const AddonInstance_PVR* instance)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseLiveStream();
}
inline static int ADDON_ReadLiveStream(const AddonInstance_PVR* instance,
unsigned char* buffer,
unsigned int size)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->ReadLiveStream(buffer, size);
}
inline static int64_t ADDON_SeekLiveStream(const AddonInstance_PVR* instance,
int64_t position,
int whence)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SeekLiveStream(position, whence);
}
inline static int64_t ADDON_LengthLiveStream(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->LengthLiveStream();
}
inline static PVR_ERROR ADDON_GetStreamProperties(const AddonInstance_PVR* instance,
PVR_STREAM_PROPERTIES* properties)
{
properties->iStreamCount = 0;
std::vector<PVRStreamProperties> cppProperties;
PVR_ERROR err = static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetStreamProperties(cppProperties);
if (err == PVR_ERROR_NO_ERROR)
{
for (unsigned int i = 0; i < cppProperties.size(); ++i)
{
memcpy(&properties->stream[i],
static_cast<PVR_STREAM_PROPERTIES::PVR_STREAM*>(cppProperties[i]),
sizeof(PVR_STREAM_PROPERTIES::PVR_STREAM));
++properties->iStreamCount;
if (properties->iStreamCount >= PVR_STREAM_MAX_STREAMS)
{
kodi::Log(
ADDON_LOG_ERROR,
"CInstancePVRClient::%s: Addon given with '%li' more allowed streams where '%i'",
__func__, cppProperties.size(), PVR_STREAM_MAX_STREAMS);
break;
}
}
}
return err;
}
inline static PVR_ERROR ADDON_GetStreamReadChunkSize(const AddonInstance_PVR* instance,
int* chunksize)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetStreamReadChunkSize(*chunksize);
}
inline static bool ADDON_IsRealTimeStream(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->IsRealTimeStream();
}
inline static bool ADDON_OpenRecordedStream(const AddonInstance_PVR* instance,
const PVR_RECORDING* recording)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->OpenRecordedStream(recording);
}
inline static void ADDON_CloseRecordedStream(const AddonInstance_PVR* instance)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CloseRecordedStream();
}
inline static int ADDON_ReadRecordedStream(const AddonInstance_PVR* instance,
unsigned char* buffer,
unsigned int size)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->ReadRecordedStream(buffer, size);
}
inline static int64_t ADDON_SeekRecordedStream(const AddonInstance_PVR* instance,
int64_t position,
int whence)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SeekRecordedStream(position, whence);
}
inline static int64_t ADDON_LengthRecordedStream(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->LengthRecordedStream();
}
inline static void ADDON_DemuxReset(const AddonInstance_PVR* instance)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxReset();
}
inline static void ADDON_DemuxAbort(const AddonInstance_PVR* instance)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxAbort();
}
inline static void ADDON_DemuxFlush(const AddonInstance_PVR* instance)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxFlush();
}
inline static DemuxPacket* ADDON_DemuxRead(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->DemuxRead();
}
inline static bool ADDON_CanPauseStream(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanPauseStream();
}
inline static bool ADDON_CanSeekStream(const AddonInstance_PVR* instance)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->CanSeekStream();
}
inline static void ADDON_PauseStream(const AddonInstance_PVR* instance, bool bPaused)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->PauseStream(bPaused);
}
inline static bool ADDON_SeekTime(const AddonInstance_PVR* instance,
double time,
bool backwards,
double* startpts)
{
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->SeekTime(time, backwards, *startpts);
}
inline static void ADDON_SetSpeed(const AddonInstance_PVR* instance, int speed)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->SetSpeed(speed);
}
inline static void ADDON_FillBuffer(const AddonInstance_PVR* instance, bool mode)
{
static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)->FillBuffer(mode);
}
inline static PVR_ERROR ADDON_GetStreamTimes(const AddonInstance_PVR* instance,
PVR_STREAM_TIMES* times)
{
PVRStreamTimes cppTimes(times);
return static_cast<CInstancePVRClient*>(instance->toAddon->addonInstance)
->GetStreamTimes(cppTimes);
}
///@}
AddonInstance_PVR* m_instanceData = nullptr;
};
//}}}
//______________________________________________________________________________
} /* namespace addon */
} /* namespace kodi */
#endif /* __cplusplus */
|