| 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 "PlayerCoreFactory.h" |
| 12 |
|
| 13 |
#include <string> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
class CFileItem; |
| 17 |
class CRegExp; |
| 18 |
class TiXmlElement; |
| 19 |
|
| 20 |
class CPlayerSelectionRule |
| 21 |
{ |
| 22 |
public: |
| 23 |
explicit CPlayerSelectionRule(TiXmlElement* rule); |
| 24 |
virtual ~CPlayerSelectionRule() = default; |
| 25 |
|
| 26 |
void GetPlayers(const CFileItem& item, std::vector<std::string>&validPlayers, std::vector<std::string>&players); |
| 27 |
|
| 28 |
private: |
| 29 |
static int GetTristate(const char* szValue); |
| 30 |
static bool CompileRegExp(const std::string& str, CRegExp& regExp); |
| 31 |
static bool MatchesRegExp(const std::string& str, CRegExp& regExp); |
| 32 |
void Initialize(TiXmlElement* pRule); |
| 33 |
|
| 34 |
std::string m_name; |
| 35 |
|
| 36 |
int m_tAudio; |
| 37 |
int m_tVideo; |
| 38 |
int m_tGame; |
| 39 |
int m_tInternetStream; |
| 40 |
int m_tRemote; |
| 41 |
|
| 42 |
int m_tBD; |
| 43 |
int m_tDVD; |
| 44 |
int m_tDVDFile; |
| 45 |
int m_tDiscImage; |
| 46 |
|
| 47 |
std::string m_protocols; |
| 48 |
std::string m_fileTypes; |
| 49 |
std::string m_mimeTypes; |
| 50 |
std::string m_fileName; |
| 51 |
|
| 52 |
bool m_bStreamDetails; |
| 53 |
std::string m_audioCodec; |
| 54 |
std::string m_audioChannels; |
| 55 |
std::string m_videoCodec; |
| 56 |
std::string m_videoResolution; |
| 57 |
std::string m_videoAspect; |
| 58 |
|
| 59 |
std::string m_playerName; |
| 60 |
|
| 61 |
std::vector<std::unique_ptr<CPlayerSelectionRule>> vecSubRules; |
| 62 |
}; |