Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
General.h
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../../AddonBase.h"
12#include "../../c-api/addon-instance/pvr/pvr_general.h"
13
14//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
15// "C++" Definitions group 1 - General PVR
16#ifdef __cplusplus
17
18namespace kodi
19{
20namespace addon
21{
22
23//==============================================================================
34class PVRTypeIntValue : public DynamicCStructHdl<PVRTypeIntValue, PVR_ATTRIBUTE_INT_VALUE>
35{
36 friend class CInstancePVRClient;
37
38public:
53
56
58 PVRTypeIntValue() = default;
59
64 PVRTypeIntValue(int value, const std::string& description)
65 {
66 SetValue(value);
67 SetDescription(description);
68 }
69
71 void SetValue(int value) { m_cStructure->iValue = value; }
72
74 int GetValue() const { return m_cStructure->iValue; }
75
77 void SetDescription(const std::string& description)
78 {
79 ReallocAndCopyString(&m_cStructure->strDescription, description.c_str());
80 }
81
83 std::string GetDescription() const
84 {
85 return m_cStructure->strDescription ? m_cStructure->strDescription : "";
86 }
88
89 static PVR_ATTRIBUTE_INT_VALUE* AllocAndCopyData(const std::vector<PVRTypeIntValue>& source)
90 {
91 PVR_ATTRIBUTE_INT_VALUE* values = new PVR_ATTRIBUTE_INT_VALUE[source.size()]{};
92 for (unsigned int i = 0; i < source.size(); ++i)
93 {
94 values[i].iValue = source[i].GetCStructure()->iValue;
95 AllocResources(source[i].GetCStructure(), &values[i]); // handles strDescription
96 }
97 return values;
98 }
99
100 static PVR_ATTRIBUTE_INT_VALUE* AllocAndCopyData(const PVR_ATTRIBUTE_INT_VALUE* source,
101 unsigned int size)
102 {
104 for (unsigned int i = 0; i < size; ++i)
105 {
106 values[i].iValue = source[i].iValue;
107 AllocResources(&source[i], &values[i]); // handles strDescription
108 }
109 return values;
110 }
111
112 static void AllocResources(const PVR_ATTRIBUTE_INT_VALUE* source, PVR_ATTRIBUTE_INT_VALUE* target)
113 {
114 target->strDescription = AllocAndCopyString(source->strDescription);
115 }
116
117 static void FreeResources(PVR_ATTRIBUTE_INT_VALUE* target)
118 {
119 FreeString(target->strDescription);
120 target->strDescription = nullptr;
121 }
122
123 static void FreeResources(PVR_ATTRIBUTE_INT_VALUE* values, unsigned int size)
124 {
125 for (unsigned int i = 0; i < size; ++i)
126 {
127 FreeResources(&values[i]);
128 }
129 delete[] values;
130 }
131
132 static void ReallocAndCopyData(PVR_ATTRIBUTE_INT_VALUE** source,
133 unsigned int* size,
134 const std::vector<PVRTypeIntValue>& values)
135 {
136 FreeResources(*source, *size);
137 *source = nullptr;
138 *size = static_cast<unsigned int>(values.size());
139 if (*size)
140 *source = AllocAndCopyData(values);
141 }
142
143private:
144 PVRTypeIntValue(const PVR_ATTRIBUTE_INT_VALUE* data) : DynamicCStructHdl(data) {}
145 PVRTypeIntValue(PVR_ATTRIBUTE_INT_VALUE* data) : DynamicCStructHdl(data) {}
146};
148//------------------------------------------------------------------------------
149
150//==============================================================================
161class PVRTypeStringValue : public DynamicCStructHdl<PVRTypeStringValue, PVR_ATTRIBUTE_STRING_VALUE>
162{
163 friend class CInstancePVRClient;
164
165public:
180
183
186
191 PVRTypeStringValue(const std::string& value, const std::string& description)
192 {
193 SetValue(value);
194 SetDescription(description);
195 }
196
198 void SetValue(const std::string& value)
199 {
200 ReallocAndCopyString(&m_cStructure->strValue, value.c_str());
201 }
202
204 std::string GetValue() const { return m_cStructure->strValue ? m_cStructure->strValue : ""; }
205
207 void SetDescription(const std::string& description)
208 {
209 ReallocAndCopyString(&m_cStructure->strDescription, description.c_str());
210 }
211
213 std::string GetDescription() const
214 {
215 return m_cStructure->strDescription ? m_cStructure->strDescription : "";
216 }
218
219 static PVR_ATTRIBUTE_STRING_VALUE* AllocAndCopyData(const std::vector<PVRTypeStringValue>& source)
220 {
221 PVR_ATTRIBUTE_STRING_VALUE* values = new PVR_ATTRIBUTE_STRING_VALUE[source.size()]{};
222 for (unsigned int i = 0; i < source.size(); ++i)
223 AllocResources(source[i].GetCStructure(), &values[i]); // handles strValue, strDescription
224 return values;
225 }
226
227 static PVR_ATTRIBUTE_STRING_VALUE* AllocAndCopyData(const PVR_ATTRIBUTE_STRING_VALUE* source,
228 unsigned int size)
229 {
231 for (unsigned int i = 0; i < size; ++i)
232 AllocResources(&source[i], &values[i]); // handles strValue, strDescription
233 return values;
234 }
235
236 static void AllocResources(const PVR_ATTRIBUTE_STRING_VALUE* source,
238 {
239 target->strValue = AllocAndCopyString(source->strValue);
240 target->strDescription = AllocAndCopyString(source->strDescription);
241 }
242
243 static void FreeResources(PVR_ATTRIBUTE_STRING_VALUE* target)
244 {
245 FreeString(target->strValue);
246 target->strValue = nullptr;
247 FreeString(target->strDescription);
248 target->strDescription = nullptr;
249 }
250
251 static void FreeResources(PVR_ATTRIBUTE_STRING_VALUE* values, unsigned int size)
252 {
253 for (unsigned int i = 0; i < size; ++i)
254 FreeResources(&values[i]);
255 delete[] values;
256 }
257
258 static void ReallocAndCopyData(PVR_ATTRIBUTE_STRING_VALUE** source,
259 unsigned int* size,
260 const std::vector<PVRTypeStringValue>& values)
261 {
262 FreeResources(*source, *size);
263 *source = nullptr;
264 *size = static_cast<unsigned int>(values.size());
265 if (*size)
266 *source = AllocAndCopyData(values);
267 }
268
269private:
270 PVRTypeStringValue(const PVR_ATTRIBUTE_STRING_VALUE* data) : DynamicCStructHdl(data) {}
271 PVRTypeStringValue(PVR_ATTRIBUTE_STRING_VALUE* data) : DynamicCStructHdl(data) {}
272};
274//------------------------------------------------------------------------------
275
276//==============================================================================
288 : public DynamicCStructHdl<PVRIntSettingDefinition, PVR_INT_SETTING_DEFINITION>
289{
290 friend class CInstancePVRClient;
291
292public:
294 PVRIntSettingDefinition() { m_cStructure->iStep = 1; }
311
314
322 PVRIntSettingDefinition(const std::vector<PVRTypeIntValue>& settingValues,
323 int defaultValue,
324 int minValue,
325 int step,
326 int maxValue)
327 {
328 SetValues(settingValues);
329 SetDefaultValue(defaultValue);
330 SetMinValue(minValue);
331 SetStep(step);
332 SetMaxValue(maxValue);
333 }
334
347 void SetValues(const std::vector<PVRTypeIntValue>& values, int defaultValue = -1)
348 {
349 PVRTypeIntValue::ReallocAndCopyData(&m_cStructure->values, &m_cStructure->iValuesSize, values);
350 if (defaultValue != -1)
351 m_cStructure->iDefaultValue = defaultValue;
352 }
353
355 std::vector<PVRTypeIntValue> GetValues() const
356 {
357 std::vector<PVRTypeIntValue> ret;
358 for (unsigned int i = 0; i < m_cStructure->iValuesSize; ++i)
359 ret.emplace_back(m_cStructure->values[i].iValue, m_cStructure->values[i].strDescription);
360 return ret;
361 }
362
365 void SetDefaultValue(int defaultValue) { m_cStructure->iDefaultValue = defaultValue; }
366
368 int GetDefaultValue() const { return m_cStructure->iDefaultValue; }
369
372 void SetMinValue(int minValue) { m_cStructure->iMinValue = minValue; }
373
375 int GetMinValue() const { return m_cStructure->iMinValue; }
376
379 void SetStep(int step) { m_cStructure->iStep = step; }
380
382 int GetStep() const { return m_cStructure->iStep; }
383
386 void SetMaxValue(int maxValue) { m_cStructure->iMaxValue = maxValue; }
387
389 int GetMaxValue() const { return m_cStructure->iMaxValue; }
391
392 static PVR_INT_SETTING_DEFINITION* AllocAndCopyData(const PVRIntSettingDefinition& source)
393 {
395 AllocResources(source.GetCStructure(), def); // handles values, iValuesSize
396 def->iDefaultValue = source.GetCStructure()->iDefaultValue;
397 def->iMinValue = source.GetCStructure()->iMinValue;
398 def->iStep = source.GetCStructure()->iStep;
399 def->iMaxValue = source.GetCStructure()->iMaxValue;
400 return def;
401 }
402
403 static PVR_INT_SETTING_DEFINITION* AllocAndCopyData(PVR_INT_SETTING_DEFINITION* source)
404 {
406 AllocResources(source, def); // handles values, iValuesSize
407 def->iDefaultValue = source->iDefaultValue;
408 def->iMinValue = source->iMinValue;
409 def->iStep = source->iStep;
410 def->iMaxValue = source->iMaxValue;
411 return def;
412 }
413
414 static void AllocResources(const PVR_INT_SETTING_DEFINITION* source,
416 {
417 target->values = PVRTypeIntValue::AllocAndCopyData(source->values, source->iValuesSize);
418 target->iValuesSize = source->iValuesSize;
419 }
420
421 static void FreeResources(PVR_INT_SETTING_DEFINITION* target)
422 {
423 PVRTypeIntValue::FreeResources(target->values, target->iValuesSize);
424 target->values = nullptr;
425 target->iValuesSize = 0;
426 }
427
428 static void ReallocAndCopyData(PVR_INT_SETTING_DEFINITION** source,
429 const PVRIntSettingDefinition& def)
430 {
431 if (*source)
432 FreeResources(*source);
433 *source = AllocAndCopyData(def);
434 }
435
436private:
437 PVRIntSettingDefinition(const PVR_INT_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
438 PVRIntSettingDefinition(PVR_INT_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
439};
441//------------------------------------------------------------------------------
442
443//==============================================================================
455 : public DynamicCStructHdl<PVRStringSettingDefinition, PVR_STRING_SETTING_DEFINITION>
456{
457 friend class CInstancePVRClient;
458
459public:
461 PVRStringSettingDefinition() { m_cStructure->bAllowEmptyValue = true; }
476
479
485 PVRStringSettingDefinition(const std::vector<PVRTypeStringValue>& settingValues,
486 const std::string& defaultValue,
487 bool allowEmptyValue)
488 {
489 SetValues(settingValues);
490 SetDefaultValue(defaultValue);
491 SetAllowEmptyValue(allowEmptyValue);
492 }
493
506 void SetValues(const std::vector<PVRTypeStringValue>& values,
507 const std::string& defaultValue = "")
508 {
509 PVRTypeStringValue::ReallocAndCopyData(&m_cStructure->values, &m_cStructure->iValuesSize,
510 values);
511 ReallocAndCopyString(&m_cStructure->strDefaultValue, defaultValue.c_str());
512 }
513
515 std::vector<PVRTypeStringValue> GetValues() const
516 {
517 std::vector<PVRTypeStringValue> ret;
518 for (unsigned int i = 0; i < m_cStructure->iValuesSize; ++i)
519 ret.emplace_back(m_cStructure->values[i].strValue, m_cStructure->values[i].strDescription);
520 return ret;
521 }
522
525 void SetDefaultValue(const std::string& defaultValue)
526 {
527 ReallocAndCopyString(&m_cStructure->strDefaultValue, defaultValue.c_str());
528 }
529
531 std::string GetDefaultValue() const
532 {
533 return m_cStructure->strDefaultValue ? m_cStructure->strDefaultValue : "";
534 }
535
538 void SetAllowEmptyValue(bool allowEmptyValue)
539 {
540 m_cStructure->bAllowEmptyValue = allowEmptyValue;
541 }
542
544 bool GetAllowEmptyValue() const { return m_cStructure->bAllowEmptyValue; }
546
547 static PVR_STRING_SETTING_DEFINITION* AllocAndCopyData(const PVRStringSettingDefinition& source)
548 {
550 AllocResources(source.GetCStructure(), def); // handles strDefaultValue, values, iValuesSize
551 def->bAllowEmptyValue = source.GetCStructure()->bAllowEmptyValue;
552 return def;
553 }
554
555 static PVR_STRING_SETTING_DEFINITION* AllocAndCopyData(PVR_STRING_SETTING_DEFINITION* source)
556 {
558 AllocResources(source, def); // handles strDefaultValue, values, iValuesSize
559 def->bAllowEmptyValue = source->bAllowEmptyValue;
560 return def;
561 }
562
563 static void AllocResources(const PVR_STRING_SETTING_DEFINITION* source,
565 {
566 target->strDefaultValue = AllocAndCopyString(source->strDefaultValue);
567 target->values = PVRTypeStringValue::AllocAndCopyData(source->values, source->iValuesSize);
568 target->iValuesSize = source->iValuesSize;
569 }
570
571 static void FreeResources(PVR_STRING_SETTING_DEFINITION* target)
572 {
573 PVRTypeStringValue::FreeResources(target->values, target->iValuesSize);
574 target->values = nullptr;
575 target->iValuesSize = 0;
576
577 FreeString(target->strDefaultValue);
578 target->strDefaultValue = nullptr;
579 }
580
581 static void ReallocAndCopyData(PVR_STRING_SETTING_DEFINITION** source,
583 {
584 if (*source)
585 FreeResources(*source);
586 *source = AllocAndCopyData(def);
587 }
588
589private:
590 PVRStringSettingDefinition(const PVR_STRING_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
591 PVRStringSettingDefinition(PVR_STRING_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
592};
594//------------------------------------------------------------------------------
595
596//==============================================================================
607class PVRSettingDefinition : public DynamicCStructHdl<PVRSettingDefinition, PVR_SETTING_DEFINITION>
608{
609 friend class CInstancePVRClient;
610
611public:
613 PVRSettingDefinition() = default;
633
636
643 PVRSettingDefinition(unsigned int settingDefId,
644 const std::string& settingDefName,
645 uint64_t readonlyConditions,
646 const PVRIntSettingDefinition& settingDef)
647 {
648 SetId(settingDefId);
649 SetName(settingDefName);
651 SetReadonlyConditions(readonlyConditions);
652 SetIntDefinition(settingDef);
653 }
654
661 PVRSettingDefinition(unsigned int settingDefId,
662 const std::string& settingDefName,
663 uint64_t readonlyConditions,
664 const PVRStringSettingDefinition& settingDef)
665 {
666 SetId(settingDefId);
667 SetName(settingDefName);
669 SetReadonlyConditions(readonlyConditions);
670 SetStringDefinition(settingDef);
671 }
672
681 PVRSettingDefinition(unsigned int settingDefId,
682 const std::string& settingDefName,
683 PVR_SETTING_TYPE eType,
684 uint64_t readonlyConditions,
685 const PVRIntSettingDefinition& intSettingDef,
686 const PVRStringSettingDefinition& stringSettingDef)
687 {
688 SetId(settingDefId);
689 SetName(settingDefName);
690 SetType(eType);
691 SetReadonlyConditions(readonlyConditions);
692 SetIntDefinition(intSettingDef);
693 SetStringDefinition(stringSettingDef);
694 }
695
698 void SetId(unsigned int defId) { m_cStructure->iId = defId; }
699
701 unsigned int GetId() const { return m_cStructure->iId; }
702
705 void SetName(const std::string& name)
706 {
707 ReallocAndCopyString(&m_cStructure->strName, name.c_str());
708 }
709
711 std::string GetName() const { return m_cStructure->strName ? m_cStructure->strName : ""; }
712
715 void SetType(PVR_SETTING_TYPE eType) { m_cStructure->eType = eType; }
716
718 PVR_SETTING_TYPE GetType() const { return m_cStructure->eType; }
719
723 void SetReadonlyConditions(uint64_t conditions)
724 {
725 m_cStructure->iReadonlyConditions = conditions;
726 }
727
729 uint64_t GetReadonlyConditions() const { return m_cStructure->iReadonlyConditions; }
730
731 //----------------------------------------------------------------------------
732
740 {
741 PVRIntSettingDefinition::ReallocAndCopyData(&m_cStructure->intSettingDefinition, def);
742 }
743
746 {
748 if (m_cStructure->intSettingDefinition)
749 {
750 std::vector<PVRTypeIntValue> settingValues;
751 settingValues.reserve(m_cStructure->intSettingDefinition->iValuesSize);
752 for (unsigned int i = 0; i < m_cStructure->intSettingDefinition->iValuesSize; ++i)
753 {
754 settingValues.emplace_back(m_cStructure->intSettingDefinition->values[i].iValue,
755 m_cStructure->intSettingDefinition->values[i].strDescription);
756 }
757 ret.SetValues(std::move(settingValues));
758 ret.SetDefaultValue(m_cStructure->intSettingDefinition->iDefaultValue);
759 ret.SetMinValue(m_cStructure->intSettingDefinition->iMinValue);
760 ret.SetStep(m_cStructure->intSettingDefinition->iStep);
761 ret.SetMaxValue(m_cStructure->intSettingDefinition->iMaxValue);
762 }
763 return ret;
764 }
765
766 //----------------------------------------------------------------------------
767
775 {
776 PVRStringSettingDefinition::ReallocAndCopyData(&m_cStructure->stringSettingDefinition, def);
777 }
778
781 {
783 if (m_cStructure->stringSettingDefinition)
784 {
785 std::vector<PVRTypeStringValue> settingValues;
786 settingValues.reserve(m_cStructure->stringSettingDefinition->iValuesSize);
787 for (unsigned int i = 0; i < m_cStructure->stringSettingDefinition->iValuesSize; ++i)
788 {
789 settingValues.emplace_back(m_cStructure->stringSettingDefinition->values[i].strValue,
790 m_cStructure->stringSettingDefinition->values[i].strDescription);
791 }
792 ret.SetValues(std::move(settingValues));
793 ret.SetDefaultValue(m_cStructure->stringSettingDefinition->strDefaultValue);
794 }
795 return ret;
796 }
798
799 static PVR_SETTING_DEFINITION** AllocAndCopyData(const std::vector<PVRSettingDefinition>& source)
800 {
801 PVR_SETTING_DEFINITION** defs = new PVR_SETTING_DEFINITION* [source.size()] {};
802 for (unsigned int i = 0; i < source.size(); ++i)
803 {
804 defs[i] = new PVR_SETTING_DEFINITION{};
805 defs[i]->iId = source[i].GetCStructure()->iId;
806 defs[i]->eType = source[i].GetCStructure()->eType;
807 defs[i]->iReadonlyConditions = source[i].GetCStructure()->iReadonlyConditions;
808 AllocResources(source[i].GetCStructure(),
809 defs[i]); // handles strName, intSettingDefinition, stringSettingDefinition
810 }
811 return defs;
812 }
813
814 static PVR_SETTING_DEFINITION** AllocAndCopyData(PVR_SETTING_DEFINITION** source,
815 unsigned int size)
816 {
817 PVR_SETTING_DEFINITION** defs = new PVR_SETTING_DEFINITION* [size] {};
818 for (unsigned int i = 0; i < size; ++i)
819 {
820 defs[i] = new PVR_SETTING_DEFINITION{};
821 defs[i]->iId = source[i]->iId;
822 defs[i]->eType = source[i]->eType;
823 defs[i]->iReadonlyConditions = source[i]->iReadonlyConditions;
824 AllocResources(source[i],
825 defs[i]); // handles strName, intSettingDefinition, stringSettingDefinition
826 }
827 return defs;
828 }
829
830 static void AllocResources(const PVR_SETTING_DEFINITION* source, PVR_SETTING_DEFINITION* target)
831 {
832 target->strName = AllocAndCopyString(source->strName);
833 if (source->intSettingDefinition)
834 target->intSettingDefinition =
835 PVRIntSettingDefinition::AllocAndCopyData(source->intSettingDefinition);
836 if (source->stringSettingDefinition)
837 target->stringSettingDefinition =
838 PVRStringSettingDefinition::AllocAndCopyData(source->stringSettingDefinition);
839 }
840
841 static void FreeResources(PVR_SETTING_DEFINITION* target)
842 {
843 FreeString(target->strName);
844 target->strName = nullptr;
845
846 if (target->intSettingDefinition)
847 {
848 PVRIntSettingDefinition::FreeResources(target->intSettingDefinition);
849 target->intSettingDefinition = nullptr;
850 }
851
852 if (target->stringSettingDefinition)
853 {
854 PVRStringSettingDefinition::FreeResources(target->stringSettingDefinition);
855 target->stringSettingDefinition = nullptr;
856 }
857 }
858
859 static void FreeResources(PVR_SETTING_DEFINITION** defs, unsigned int size)
860 {
861 for (unsigned int i = 0; i < size; ++i)
862 {
863 FreeResources(defs[i]);
864 delete defs[i];
865 }
866 delete[] defs;
867 }
868
869 static void ReallocAndCopyData(PVR_SETTING_DEFINITION*** source,
870 unsigned int* size,
871 const std::vector<PVRSettingDefinition>& defs)
872 {
873 FreeResources(*source, *size);
874 *source = nullptr;
875 *size = static_cast<unsigned int>(defs.size());
876 if (*size)
877 *source = AllocAndCopyData(defs);
878 }
879
880private:
881 PVRSettingDefinition(const PVR_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
882 PVRSettingDefinition(PVR_SETTING_DEFINITION* def) : DynamicCStructHdl(def) {}
883};
885//------------------------------------------------------------------------------
886
887//==============================================================================
899 : public DynamicCStructHdl<PVRSettingKeyValuePair, PVR_SETTING_KEY_VALUE_PAIR>
900{
901 friend class CInstancePVRClient;
902
903public:
918
921
924
929 PVRSettingKeyValuePair(unsigned int key, int value)
930 {
931 SetKey(key);
933 SetIntValue(value);
934 }
935
940 PVRSettingKeyValuePair(unsigned int key, const std::string& value)
941 {
942 SetKey(key);
944 SetStringValue(value);
945 }
946
953 PVRSettingKeyValuePair(unsigned int key,
954 PVR_SETTING_TYPE eType,
955 int intValue,
956 const std::string& stringValue)
957 {
958 SetKey(key);
959 SetType(eType);
960 SetIntValue(intValue);
961 SetStringValue(stringValue);
962 }
963
965 void SetKey(unsigned int key) { m_cStructure->iKey = key; }
966
968 unsigned GetKey() const { return m_cStructure->iKey; }
969
972 void SetType(PVR_SETTING_TYPE eType) { m_cStructure->eType = eType; }
973
975 PVR_SETTING_TYPE GetType() const { return m_cStructure->eType; }
976
978 void SetIntValue(int value) { m_cStructure->iValue = value; }
979
981 int GetIntValue() const { return m_cStructure->iValue; }
982
984 void SetStringValue(const std::string& value)
985 {
986 ReallocAndCopyString(&m_cStructure->strValue, value.c_str());
987 }
988
990 std::string GetStringValue() const
991 {
992 return m_cStructure->strValue ? m_cStructure->strValue : "";
993 }
995
996 static PVR_SETTING_KEY_VALUE_PAIR* AllocAndCopyData(
997 const std::vector<PVRSettingKeyValuePair>& values)
998 {
999 PVR_SETTING_KEY_VALUE_PAIR* pairs = new PVR_SETTING_KEY_VALUE_PAIR[values.size()]{};
1000 for (unsigned int i = 0; i < values.size(); ++i)
1001 {
1002 pairs[i].iKey = values[i].GetCStructure()->iKey;
1003 pairs[i].eType = values[i].GetCStructure()->eType;
1004 pairs[i].iValue = values[i].GetCStructure()->iValue;
1005 AllocResources(values[i].GetCStructure(), &pairs[i]); // handles strValue
1006 }
1007 return pairs;
1008 }
1009
1010 static PVR_SETTING_KEY_VALUE_PAIR* AllocAndCopyData(const PVR_SETTING_KEY_VALUE_PAIR* source,
1011 unsigned int size)
1012 {
1014 for (unsigned int i = 0; i < size; ++i)
1015 {
1016 pairs[i].iKey = source[i].iKey;
1017 pairs[i].eType = source[i].eType;
1018 pairs[i].iValue = source[i].iValue;
1019 AllocResources(&source[i], &pairs[i]); // handles strValue
1020 }
1021 return pairs;
1022 }
1023
1024 static void AllocResources(const PVR_SETTING_KEY_VALUE_PAIR* source,
1026 {
1027 target->strValue = AllocAndCopyString(source->strValue);
1028 }
1029
1030 static void FreeResources(PVR_SETTING_KEY_VALUE_PAIR* target) { FreeString(target->strValue); }
1031
1032 static void FreeResources(PVR_SETTING_KEY_VALUE_PAIR* pairs, unsigned int size)
1033 {
1034 for (unsigned int i = 0; i < size; ++i)
1035 FreeResources(&pairs[i]);
1036 delete[] pairs;
1037 }
1038
1039 static void ReallocAndCopyData(PVR_SETTING_KEY_VALUE_PAIR** source,
1040 unsigned int* size,
1041 const std::vector<PVRSettingKeyValuePair>& values)
1042 {
1043 FreeResources(*source, *size);
1044 *source = nullptr;
1045 *size = static_cast<unsigned int>(values.size());
1046 if (*size)
1047 *source = AllocAndCopyData(values);
1048 }
1049
1050private:
1051 PVRSettingKeyValuePair(const PVR_SETTING_KEY_VALUE_PAIR* pair) : DynamicCStructHdl(pair) {}
1052 PVRSettingKeyValuePair(PVR_SETTING_KEY_VALUE_PAIR* pair) : DynamicCStructHdl(pair) {}
1053};
1055//------------------------------------------------------------------------------
1056
1057//==============================================================================
1076class PVRCapabilities : public DynamicCStructHdl<PVRCapabilities, PVR_ADDON_CAPABILITIES>
1077{
1078 friend class CInstancePVRClient;
1079
1080public:
1082 PVRCapabilities() = default;
1083 PVRCapabilities(const PVRCapabilities& capabilities) : DynamicCStructHdl(capabilities) {}
1120
1123
1125 void SetSupportsEPG(bool supportsEPG) { m_cStructure->bSupportsEPG = supportsEPG; }
1126
1128 bool GetSupportsEPG() const { return m_cStructure->bSupportsEPG; }
1129
1132 void SetSupportsEPGEdl(bool supportsEPGEdl) { m_cStructure->bSupportsEPGEdl = supportsEPGEdl; }
1133
1135 bool GetSupportsEPGEdl() const { return m_cStructure->bSupportsEPGEdl; }
1136
1138 void SetSupportsTV(bool supportsTV) { m_cStructure->bSupportsTV = supportsTV; }
1139
1141 bool GetSupportsTV() const { return m_cStructure->bSupportsTV; }
1142
1144 void SetSupportsRadio(bool supportsRadio) { m_cStructure->bSupportsRadio = supportsRadio; }
1145
1147 bool GetSupportsRadio() const { return m_cStructure->bSupportsRadio; }
1148
1151 void SetSupportsRecordings(bool supportsRecordings)
1152 {
1153 m_cStructure->bSupportsRecordings = supportsRecordings;
1154 }
1155
1157 bool GetSupportsRecordings() const { return m_cStructure->bSupportsRecordings; }
1158
1161 void SetSupportsRecordingsUndelete(bool supportsRecordingsUndelete)
1162 {
1163 m_cStructure->bSupportsRecordingsUndelete = supportsRecordingsUndelete;
1164 }
1165
1167 bool GetSupportsRecordingsUndelete() const { return m_cStructure->bSupportsRecordingsUndelete; }
1168
1171 void SetSupportsTimers(bool supportsTimers) { m_cStructure->bSupportsTimers = supportsTimers; }
1172
1174 bool GetSupportsTimers() const { return m_cStructure->bSupportsTimers; }
1175
1181 void SetSupportsProviders(bool supportsProviders)
1182 {
1183 m_cStructure->bSupportsProviders = supportsProviders;
1184 }
1185
1187 bool GetSupportsProviders() const { return m_cStructure->bSupportsProviders; }
1188
1195 void SetSupportsChannelGroups(bool supportsChannelGroups)
1196 {
1197 m_cStructure->bSupportsChannelGroups = supportsChannelGroups;
1198 }
1199
1201 bool GetSupportsChannelGroups() const { return m_cStructure->bSupportsChannelGroups; }
1202
1208 void SetSupportsChannelScan(bool supportsChannelScan)
1209 {
1210 m_cStructure->bSupportsChannelScan = supportsChannelScan;
1211 }
1212
1214 bool GetSupportsChannelScan() const { return m_cStructure->bSupportsChannelScan; }
1215
1223 void SetSupportsChannelSettings(bool supportsChannelSettings)
1224 {
1225 m_cStructure->bSupportsChannelSettings = supportsChannelSettings;
1226 }
1227
1229 bool GetSupportsChannelSettings() const { return m_cStructure->bSupportsChannelSettings; }
1230
1233 void SetHandlesInputStream(bool handlesInputStream)
1234 {
1235 m_cStructure->bHandlesInputStream = handlesInputStream;
1236 }
1237
1239 bool GetHandlesInputStream() const { return m_cStructure->bHandlesInputStream; }
1240
1242 void SetHandlesDemuxing(bool handlesDemuxing)
1243 {
1244 m_cStructure->bHandlesDemuxing = handlesDemuxing;
1245 }
1246
1248 bool GetHandlesDemuxing() const { return m_cStructure->bHandlesDemuxing; }
1249
1251 void SetSupportsRecordingPlayCount(bool supportsRecordingPlayCount)
1252 {
1253 m_cStructure->bSupportsRecordingPlayCount = supportsRecordingPlayCount;
1254 }
1255
1257 bool GetSupportsRecordingPlayCount() const { return m_cStructure->bSupportsRecordingPlayCount; }
1258
1261 void SetSupportsLastPlayedPosition(bool supportsLastPlayedPosition)
1262 {
1263 m_cStructure->bSupportsLastPlayedPosition = supportsLastPlayedPosition;
1264 }
1265
1267 bool GetSupportsLastPlayedPosition() const { return m_cStructure->bSupportsLastPlayedPosition; }
1268
1271 void SetSupportsRecordingEdl(bool supportsRecordingEdl)
1272 {
1273 m_cStructure->bSupportsRecordingEdl = supportsRecordingEdl;
1274 }
1275
1277 bool GetSupportsRecordingEdl() const { return m_cStructure->bSupportsRecordingEdl; }
1278
1280 void SetSupportsRecordingsRename(bool supportsRecordingsRename)
1281 {
1282 m_cStructure->bSupportsRecordingsRename = supportsRecordingsRename;
1283 }
1284
1286 bool GetSupportsRecordingsRename() const { return m_cStructure->bSupportsRecordingsRename; }
1287
1290 void SetSupportsRecordingsLifetimeChange(bool supportsRecordingsLifetimeChange)
1291 {
1292 m_cStructure->bSupportsRecordingsLifetimeChange = supportsRecordingsLifetimeChange;
1293 }
1294
1298 {
1299 return m_cStructure->bSupportsRecordingsLifetimeChange;
1300 }
1301
1304 void SetSupportsDescrambleInfo(bool supportsDescrambleInfo)
1305 {
1306 m_cStructure->bSupportsDescrambleInfo = supportsDescrambleInfo;
1307 }
1308
1310 bool GetSupportsDescrambleInfo() const { return m_cStructure->bSupportsDescrambleInfo; }
1311
1315 void SetSupportsAsyncEPGTransfer(bool supportsAsyncEPGTransfer)
1316 {
1317 m_cStructure->bSupportsAsyncEPGTransfer = supportsAsyncEPGTransfer;
1318 }
1319
1321 bool GetSupportsAsyncEPGTransfer() const { return m_cStructure->bSupportsAsyncEPGTransfer; }
1322
1324 void SetSupportsRecordingSize(bool supportsRecordingSize)
1325 {
1326 m_cStructure->bSupportsRecordingSize = supportsRecordingSize;
1327 }
1328
1330 bool GetSupportsRecordingSize() const { return m_cStructure->bSupportsRecordingSize; }
1331
1334 void SetSupportsRecordingsDelete(bool supportsRecordingsDelete)
1335 {
1336 m_cStructure->bSupportsRecordingsDelete = supportsRecordingsDelete;
1337 }
1338
1340 bool GetSupportsRecordingsDelete() const { return m_cStructure->bSupportsRecordingsDelete; }
1341
1343 void SetSupportsMultipleRecordedStreams(bool supportsMultipleRecordedStreams)
1344 {
1345 m_cStructure->bSupportsMultipleRecordedStreams = supportsMultipleRecordedStreams;
1346 }
1347
1350 {
1351 return m_cStructure->bSupportsMultipleRecordedStreams;
1352 }
1353
1360 void SetRecordingsLifetimeValues(const std::vector<PVRTypeIntValue>& recordingsLifetimeValues)
1361 {
1362 PVRTypeIntValue::ReallocAndCopyData(&m_cStructure->recordingsLifetimeValues,
1363 &m_cStructure->iRecordingsLifetimesSize,
1364 recordingsLifetimeValues);
1365 }
1366
1368 std::vector<PVRTypeIntValue> GetRecordingsLifetimeValues() const
1369 {
1370 std::vector<PVRTypeIntValue> recordingsLifetimeValues;
1371 for (unsigned int i = 0; i < m_cStructure->iRecordingsLifetimesSize; ++i)
1372 recordingsLifetimeValues.emplace_back(
1373 m_cStructure->recordingsLifetimeValues[i].iValue,
1374 m_cStructure->recordingsLifetimeValues[i].strDescription);
1375 return recordingsLifetimeValues;
1376 }
1378
1379 static void AllocResources(const PVR_ADDON_CAPABILITIES* source, PVR_ADDON_CAPABILITIES* target)
1380 {
1381 if (target->iRecordingsLifetimesSize)
1382 {
1383 target->recordingsLifetimeValues = PVRTypeIntValue::AllocAndCopyData(
1384 source->recordingsLifetimeValues, source->iRecordingsLifetimesSize);
1385 }
1386 }
1387
1388 static void FreeResources(PVR_ADDON_CAPABILITIES* target)
1389 {
1390 PVRTypeIntValue::FreeResources(target->recordingsLifetimeValues,
1391 target->iRecordingsLifetimesSize);
1392 target->recordingsLifetimeValues = nullptr;
1393 target->iRecordingsLifetimesSize = 0;
1394 }
1395
1396private:
1397 PVRCapabilities(const PVR_ADDON_CAPABILITIES* capabilities) : DynamicCStructHdl(capabilities) {}
1398 PVRCapabilities(PVR_ADDON_CAPABILITIES* capabilities) : DynamicCStructHdl(capabilities) {}
1399};
1401//------------------------------------------------------------------------------
1402
1403//==============================================================================
1452class PVRStreamProperty : public DynamicCStructHdl<PVRStreamProperty, PVR_NAMED_VALUE>
1453{
1454 friend class CInstancePVRClient;
1455
1456public:
1458 PVRStreamProperty(const PVRStreamProperty& property) : DynamicCStructHdl(property) {}
1471
1474
1477
1482 PVRStreamProperty(const std::string& name, const std::string& value)
1483 {
1484 SetName(name);
1485 SetValue(value);
1486 }
1487
1489 void SetName(const std::string& name)
1490 {
1491 ReallocAndCopyString(&m_cStructure->strName, name.c_str());
1492 }
1493
1495 std::string GetName() const { return m_cStructure->strName ? m_cStructure->strName : ""; }
1496
1498 void SetValue(const std::string& value)
1499 {
1500 ReallocAndCopyString(&m_cStructure->strValue, value.c_str());
1501 }
1502
1504 std::string GetValue() const { return m_cStructure->strValue ? m_cStructure->strValue : ""; }
1506
1507 static void AllocResources(const PVR_NAMED_VALUE* source, PVR_NAMED_VALUE* target)
1508 {
1509 target->strName = AllocAndCopyString(source->strName);
1510 target->strValue = AllocAndCopyString(source->strValue);
1511 }
1512
1513 static void FreeResources(PVR_NAMED_VALUE* target)
1514 {
1515 FreeString(target->strName);
1516 FreeString(target->strValue);
1517 }
1518
1519private:
1520 PVRStreamProperty(const PVR_NAMED_VALUE* property) : DynamicCStructHdl(property) {}
1521 PVRStreamProperty(PVR_NAMED_VALUE* property) : DynamicCStructHdl(property) {}
1522};
1524//------------------------------------------------------------------------------
1525
1526} /* namespace addon */
1527} /* namespace kodi */
1528
1529#endif /* __cplusplus */
Definition AddonBase.h:288
Definition General.h:1077
Definition General.h:289
Definition General.h:608
Definition General.h:900
Definition General.h:1453
Definition General.h:35
Definition General.h:162
std::string GetValue() const
To get with the used property value.
Definition General.h:1504
void SetValue(const std::string &value)
To set with the used property value.
Definition General.h:1498
void SetName(const std::string &name)
To set with the identification name.
Definition General.h:1489
std::string GetName() const
To get with the identification name.
Definition General.h:1495
PVRStreamProperty()=default
Default class constructor.
PVRStreamProperty(const std::string &name, const std::string &value)
Class constructor with integrated value set.
Definition General.h:1482
PVR_SETTING_TYPE
Definition pvr_general.h:176
@ INTEGER
0 : Integer
Definition pvr_general.h:178
@ STRING
1 : String
Definition pvr_general.h:181
unsigned GetKey() const
To get with the key.
Definition General.h:968
void SetIntValue(int value)
To set with the value.
Definition General.h:978
void SetStringValue(const std::string &value)
To set with the value.
Definition General.h:984
PVRSettingKeyValuePair()=default
Default class constructor.
void SetKey(unsigned int key)
To set with the key.
Definition General.h:965
PVRSettingKeyValuePair(unsigned int key, PVR_SETTING_TYPE eType, int intValue, const std::string &stringValue)
Class constructor with integrated value set.
Definition General.h:953
void SetType(PVR_SETTING_TYPE eType)
required This key value pair's type.
Definition General.h:972
PVRSettingKeyValuePair(unsigned int key, const std::string &value)
Class constructor with integrated value set.
Definition General.h:940
PVRSettingKeyValuePair(unsigned int key, int value)
Class constructor with integrated value set.
Definition General.h:929
int GetIntValue() const
To get with the value.
Definition General.h:981
std::string GetStringValue() const
To get with the value.
Definition General.h:990
PVR_SETTING_TYPE GetType() const
To get with SetType changed values.
Definition General.h:975
void SetSupportsRecordingsDelete(bool supportsRecordingsDelete)
Set true if this add-on supports delete of recordings stored on the backend.
Definition General.h:1334
void SetSupportsRecordingsUndelete(bool supportsRecordingsUndelete)
Set true if this add-on supports undelete of recordings stored on the backend.
Definition General.h:1161
void SetSupportsProviders(bool supportsProviders)
Set true if this add-on supports providers.
Definition General.h:1181
void SetSupportsEPGEdl(bool supportsEPGEdl)
Set true if the backend supports retrieving an edit decision list for an EPG tag.
Definition General.h:1132
bool GetSupportsRecordingsUndelete() const
To get with SetSupportsRecordings changed values.
Definition General.h:1167
bool GetSupportsRecordingsDelete() const
To get with SetSupportsRecordingsDelete changed values.
Definition General.h:1340
void SetSupportsChannelSettings(bool supportsChannelSettings)
Set true if this add-on supports channel edit.
Definition General.h:1223
void SetHandlesDemuxing(bool handlesDemuxing)
Set true if this add-on demultiplexes packets.
Definition General.h:1242
bool GetSupportsRecordingsLifetimeChange() const
To get with SetSupportsRecordingsLifetimeChange changed values.
Definition General.h:1297
void SetSupportsChannelGroups(bool supportsChannelGroups)
Set true if this add-on supports channel groups.
Definition General.h:1195
void SetSupportsMultipleRecordedStreams(bool supportsMultipleRecordedStreams)
Set true if this add-on supports multiple streams for recordings at a time.
Definition General.h:1343
bool GetSupportsChannelSettings() const
To get with SetSupportsChannelSettings changed values.
Definition General.h:1229
bool GetSupportsRecordings() const
To get with SetSupportsRecordings changed values.
Definition General.h:1157
void SetSupportsRadio(bool supportsRadio)
Set true if this add-on provides TV channels.
Definition General.h:1144
bool GetSupportsAsyncEPGTransfer() const
To get with SetSupportsAsyncEPGTransfer changed values.
Definition General.h:1321
void SetSupportsTV(bool supportsTV)
Set true if this add-on provides TV channels.
Definition General.h:1138
void SetSupportsLastPlayedPosition(bool supportsLastPlayedPosition)
Set true if the backend supports store/retrieve of last played position for recordings.
Definition General.h:1261
void SetSupportsRecordingSize(bool supportsRecordingSize)
Set true if this addon-on supports retrieving size of recordings.
Definition General.h:1324
void SetHandlesInputStream(bool handlesInputStream)
Set true if this add-on provides an input stream. false if Kodi handles the stream.
Definition General.h:1233
bool GetSupportsProviders() const
To get with SetSupportsProviders changed values.
Definition General.h:1187
bool GetSupportsChannelScan() const
To get with SetSupportsChannelScan changed values.
Definition General.h:1214
void SetSupportsEPG(bool supportsEPG)
Set true if the add-on provides EPG information.
Definition General.h:1125
void SetSupportsRecordingEdl(bool supportsRecordingEdl)
Set true if the backend supports retrieving an edit decision list for recordings.
Definition General.h:1271
bool GetSupportsRecordingSize() const
To get with SetSupportsRecordingSize changed values.
Definition General.h:1330
void SetSupportsAsyncEPGTransfer(bool supportsAsyncEPGTransfer)
Set true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback fun...
Definition General.h:1315
bool GetSupportsEPGEdl() const
To get with SetSupportsEPGEdl changed values.
Definition General.h:1135
void SetSupportsRecordingsLifetimeChange(bool supportsRecordingsLifetimeChange)
Set true if the backend supports changing lifetime for recordings.
Definition General.h:1290
bool GetHandlesDemuxing() const
To get with SetHandlesDemuxing changed values.
Definition General.h:1248
std::vector< PVRTypeIntValue > GetRecordingsLifetimeValues() const
To get with SetRecordingsLifetimeValues changed values.
Definition General.h:1368
bool GetSupportsRadio() const
To get with SetSupportsRadio changed values.
Definition General.h:1147
void SetSupportsDescrambleInfo(bool supportsDescrambleInfo)
Set true if the backend supports descramble information for playing channels.
Definition General.h:1304
bool GetSupportsMultipleRecordedStreams() const
To get with SetSupportsMultiRecordedStreams changed values.
Definition General.h:1349
void SetSupportsTimers(bool supportsTimers)
Set true if this add-on supports the creation and editing of timers.
Definition General.h:1171
bool GetSupportsRecordingPlayCount() const
To get with SetSupportsRecordingPlayCount changed values.
Definition General.h:1257
void SetSupportsRecordingsRename(bool supportsRecordingsRename)
Set true if the backend supports renaming recordings.
Definition General.h:1280
void SetSupportsRecordings(bool supportsRecordings)
true if this add-on supports playback of recordings stored on the backend.
Definition General.h:1151
bool GetSupportsLastPlayedPosition() const
To get with SetSupportsLastPlayedPosition changed values.
Definition General.h:1267
void SetRecordingsLifetimeValues(const std::vector< PVRTypeIntValue > &recordingsLifetimeValues)
optional Set array containing the possible values for PVRRecording::SetLifetime().
Definition General.h:1360
bool GetSupportsTV() const
To get with SetSupportsTV changed values.
Definition General.h:1141
bool GetSupportsRecordingsRename() const
To get with SetSupportsRecordingsRename changed values.
Definition General.h:1286
bool GetSupportsDescrambleInfo() const
To get with SetSupportsDescrambleInfo changed values.
Definition General.h:1310
void SetSupportsRecordingPlayCount(bool supportsRecordingPlayCount)
Set true if the backend supports play count for recordings.
Definition General.h:1251
bool GetSupportsRecordingEdl() const
To get with SetSupportsRecordingEdl changed values.
Definition General.h:1277
void SetSupportsChannelScan(bool supportsChannelScan)
Set true if this add-on support scanning for new channels on the backend.
Definition General.h:1208
bool GetHandlesInputStream() const
To get with SetHandlesInputStream changed values.
Definition General.h:1239
bool GetSupportsEPG() const
To get with SetSupportsEPG changed values.
Definition General.h:1128
bool GetSupportsChannelGroups() const
To get with SetSupportsChannelGroups changed values.
Definition General.h:1201
bool GetSupportsTimers() const
To get with SetSupportsTimers changed values.
Definition General.h:1174
std::vector< PVRTypeIntValue > GetValues() const
To get with SetValues changed values.
Definition General.h:355
int GetMinValue() const
To get with SetMinValue changed values.
Definition General.h:375
void SetStep(int step)
optional The amount for increasing the values for this setting from min to max.
Definition General.h:379
void SetValues(const std::vector< PVRTypeIntValue > &values, int defaultValue=-1)
optional value definitions.
Definition General.h:347
void SetMaxValue(int maxValue)
optional The maximum value for this setting.
Definition General.h:386
void SetMinValue(int minValue)
optional The minimum value for this setting.
Definition General.h:372
int GetStep() const
To get with SetStep changed values.
Definition General.h:382
void SetDefaultValue(int defaultValue)
optional The default value for this setting.
Definition General.h:365
int GetMaxValue() const
To get with SetMaxValue changed values.
Definition General.h:389
PVRIntSettingDefinition(const std::vector< PVRTypeIntValue > &settingValues, int defaultValue, int minValue, int step, int maxValue)
Class constructor with integrated values.
Definition General.h:322
int GetDefaultValue() const
To get with SetDefaultValue changed values.
Definition General.h:368
void SetId(unsigned int defId)
required This setting definition's identifier.
Definition General.h:698
void SetStringDefinition(const PVRStringSettingDefinition &def)
optional
Definition General.h:774
PVRSettingDefinition(unsigned int settingDefId, const std::string &settingDefName, uint64_t readonlyConditions, const PVRStringSettingDefinition &settingDef)
Class constructor with integrated values.
Definition General.h:661
PVRSettingDefinition(unsigned int settingDefId, const std::string &settingDefName, PVR_SETTING_TYPE eType, uint64_t readonlyConditions, const PVRIntSettingDefinition &intSettingDef, const PVRStringSettingDefinition &stringSettingDef)
Class constructor with integrated values.
Definition General.h:681
uint64_t GetReadonlyConditions() const
To get with SetReadonlyConditions changed values.
Definition General.h:729
unsigned int GetId() const
To get with SetId changed values.
Definition General.h:701
void SetType(PVR_SETTING_TYPE eType)
required This setting definition's identifier.
Definition General.h:715
PVRIntSettingDefinition GetIntDefinition() const
To get with SetIntDefinition changed values.
Definition General.h:745
PVRSettingDefinition(unsigned int settingDefId, const std::string &settingDefName, uint64_t readonlyConditions, const PVRIntSettingDefinition &settingDef)
Class constructor with integrated values.
Definition General.h:643
void SetName(const std::string &name)
required A short localized string with the name of the setting.
Definition General.h:705
std::string GetName() const
To get with SetName changed values.
Definition General.h:711
PVRStringSettingDefinition GetStringDefinition() const
To get with SetStringDefinition changed values.
Definition General.h:780
void SetIntDefinition(const PVRIntSettingDefinition &def)
optional
Definition General.h:739
void SetReadonlyConditions(uint64_t conditions)
optional The read-only conditions value for this setting. PVR_SETTING_READONLY_CONDITION_* enum value...
Definition General.h:723
PVR_SETTING_TYPE GetType() const
To get with SetType changed values.
Definition General.h:718
void SetAllowEmptyValue(bool allowEmptyValue)
optional The allow empty values flag for this setting.
Definition General.h:538
std::string GetDefaultValue() const
To get with SetDefaultValue changed values.
Definition General.h:531
std::vector< PVRTypeStringValue > GetValues() const
To get with SetValues changed values.
Definition General.h:515
bool GetAllowEmptyValue() const
To get with SetAllowEmptyValue changed values.
Definition General.h:544
void SetValues(const std::vector< PVRTypeStringValue > &values, const std::string &defaultValue="")
optional value definitions.
Definition General.h:506
PVRStringSettingDefinition(const std::vector< PVRTypeStringValue > &settingValues, const std::string &defaultValue, bool allowEmptyValue)
Class constructor with integrated values.
Definition General.h:485
void SetDefaultValue(const std::string &defaultValue)
optional The default value for this setting.
Definition General.h:525
void SetValue(int value)
To set with the identification value.
Definition General.h:71
std::string GetDescription() const
To get with the description text of the value.
Definition General.h:83
void SetDescription(const std::string &description)
To set with the description text of the value.
Definition General.h:77
int GetValue() const
To get with the identification value.
Definition General.h:74
PVRTypeIntValue(int value, const std::string &description)
Class constructor with integrated value set.
Definition General.h:64
PVRTypeIntValue()=default
Default class constructor.
std::string GetDescription() const
To get with the description text of the value.
Definition General.h:213
std::string GetValue() const
To get with the identification value.
Definition General.h:204
void SetDescription(const std::string &description)
To set with the description text of the value.
Definition General.h:207
void SetValue(const std::string &value)
To set with the identification value.
Definition General.h:198
PVRTypeStringValue()=default
Default class constructor.
PVRTypeStringValue(const std::string &value, const std::string &description)
Class constructor with integrated value set.
Definition General.h:191
"C" PVR add-on capabilities.
Definition pvr_general.h:350
"C" Representation of an integer value, including a description.
Definition pvr_defines.h:26
"C" Representation of a string value, including a description
Definition pvr_defines.h:35
"C" Representation of an integer setting definition.
Definition pvr_general.h:388
"C" Representation of a named value.
Definition pvr_defines.h:44
"C" Representation of a setting definition.
Definition pvr_general.h:422
"C" Representation of a key-value pair, either {int,int} or {int,string}, depending on the type set.
Definition pvr_general.h:441
"C" Representation of a string setting definition.
Definition pvr_general.h:406