| 1 |
/* |
| 2 |
* Copyright (C) 2010-2021 Team Kodi (https://kodi.tv) |
| 3 |
* Copyright (C) 2020 Alwin Esch (Team Kodi) |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSE.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include <kodi/AddonBase.h> |
| 12 |
|
| 13 |
#define DEFAULT_HOST "127.0.0.1" |
| 14 |
#define DEFAULT_PORT 34890 |
| 15 |
#define DEFAULT_CHARCONV false |
| 16 |
#define DEFAULT_HANDLE_MSG true |
| 17 |
#define DEFAULT_PRIORITY 0 |
| 18 |
#define DEFAULT_TIMEOUT 3 |
| 19 |
#define DEFAULT_AUTOGROUPS false |
| 20 |
#define DEFAULT_CHUNKSIZE 65536 |
| 21 |
|
| 22 |
class ATTR_DLL_LOCAL CVNSISettings |
| 23 |
{ |
| 24 |
public: |
| 25 |
static CVNSISettings& Get(); |
| 26 |
|
| 27 |
bool Load(); |
| 28 |
ADDON_STATUS SetSetting(const std::string& settingName, |
| 29 |
const kodi::addon::CSettingValue& settingValue); |
| 30 |
|
| 31 |
const std::string& GetHostname() const { return m_szHostname; } |
| 32 |
const std::string& GetWolMac() const { return m_szWolMac; } |
| 33 |
int GetPort() const { return m_iPort; } |
| 34 |
int GetConnectTimeout() const { return m_iConnectTimeout; } |
| 35 |
int GetPriority() const { return m_iPriority; } |
| 36 |
bool GetCharsetConv() const { return m_bCharsetConv; } |
| 37 |
bool GetAutoChannelGroups() const { return m_bAutoChannelGroups; } |
| 38 |
int GetTimeshift() const { return m_iTimeshift; } |
| 39 |
const std::string& GetIconPath() const { return m_szIconPath; } |
| 40 |
int GetChunkSize() const { return m_iChunkSize; } |
| 41 |
|
| 42 |
private: |
| 43 |
CVNSISettings() = default; |
| 44 |
CVNSISettings(const CVNSISettings&) = delete; |
| 45 |
CVNSISettings& operator=(const CVNSISettings&) = delete; |
| 46 |
|
| 47 |
std::string m_szHostname = DEFAULT_HOST; /*!< hostname or ip-address of the server */ |
| 48 |
std::string m_szWolMac; |
| 49 |
int m_iPort = DEFAULT_PORT; /*!< TCP port of the vnsi server */ |
| 50 |
int m_iConnectTimeout = DEFAULT_TIMEOUT; /*!< Network connection / read timeout in seconds */ |
| 51 |
int m_iPriority = |
| 52 |
DEFAULT_PRIORITY; /*!< The Priority this client have in response to other clients */ |
| 53 |
bool m_bCharsetConv = |
| 54 |
DEFAULT_CHARCONV; /*!< Convert VDR's incoming strings to UTF8 character set */ |
| 55 |
bool m_bAutoChannelGroups = DEFAULT_AUTOGROUPS; |
| 56 |
int m_iTimeshift = 1; |
| 57 |
std::string m_szIconPath; /*!< path to channel icons */ |
| 58 |
int m_iChunkSize = DEFAULT_CHUNKSIZE; |
| 59 |
}; |