/xbmc/utils/TuxBoxUtil.h

http://github.com/xbmc/xbmc · C Header · 191 lines · 162 code · 10 blank · 19 comment · 0 complexity · 4c67cbcd757ef19d2ee7104a6fa27a90 MD5 · raw file

  1. #pragma once
  2. /*
  3. * Copyright (C) 2005-2013 Team XBMC
  4. * http://xbmc.org
  5. *
  6. * This Program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2, or (at your option)
  9. * any later version.
  10. *
  11. * This Program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with XBMC; see the file COPYING. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #include "StdString.h"
  22. #include "threads/Thread.h"
  23. class CURL;
  24. class TiXmlElement;
  25. class CFileItem;
  26. class CFileItemList;
  27. struct STREAMINFO
  28. {
  29. CStdString frontend;
  30. CStdString service_name;
  31. CStdString service_reference;
  32. CStdString provider;
  33. CStdString vpid;
  34. CStdString apid;
  35. CStdString pcrpid;
  36. CStdString tpid;
  37. CStdString tsid;
  38. CStdString onid;
  39. CStdString sid;
  40. CStdString pmt;
  41. CStdString video_format;
  42. CStdString supported_crypt_systems;
  43. CStdString used_crypt_systems;
  44. CStdString satellite;
  45. CStdString frequency;
  46. CStdString symbol_rate;
  47. CStdString polarisation;
  48. CStdString inversion;
  49. CStdString fec;
  50. CStdString snr;
  51. CStdString agc;
  52. CStdString ber;
  53. CStdString lock;
  54. CStdString sync;
  55. };
  56. struct VIDEOSUBCHANNEL
  57. {
  58. std::vector<CStdString> reference;
  59. std::vector<CStdString> name;
  60. std::vector<CStdString> selected;
  61. CStdString current_name;
  62. bool mode;
  63. };
  64. typedef struct AUDIOCHANNEL
  65. {
  66. CStdString pid;
  67. CStdString selected;
  68. CStdString name;
  69. } sAudioChannel;
  70. struct CURRENTSERVICEDATA
  71. {
  72. CStdString service_name;
  73. CStdString service_reference;
  74. std::vector<AUDIOCHANNEL> audio_channels;
  75. int requested_audio_channel;
  76. CStdString audio_track;
  77. CStdString current_event_date;
  78. CStdString current_event_time;
  79. CStdString current_event_start;
  80. CStdString current_event_duration;
  81. CStdString current_event_description;
  82. CStdString current_event_details;
  83. CStdString next_event_date;
  84. CStdString next_event_time;
  85. CStdString next_event_start;
  86. CStdString next_event_duration;
  87. CStdString next_event_description;
  88. CStdString next_event_details;
  89. };
  90. struct BOXSTATUS
  91. {
  92. CStdString current_time;
  93. CStdString standby;
  94. CStdString recording;
  95. CStdString mode;
  96. CStdString ip;
  97. };
  98. struct BOXSINFO
  99. {
  100. CStdString image_version;
  101. CStdString image_url;
  102. CStdString image_comment;
  103. CStdString image_catalog;
  104. CStdString firmware;
  105. CStdString fpfirmware;
  106. CStdString webinterface;
  107. CStdString model;
  108. CStdString manufacturer;
  109. CStdString processor;
  110. CStdString usbstick;
  111. CStdString disk;
  112. };
  113. struct SERVICE_EPG
  114. {
  115. CStdString service_reference;
  116. CStdString service_name;
  117. CStdString image_comment;
  118. CStdString event;
  119. CStdString date;
  120. CStdString time;
  121. CStdString duration;
  122. CStdString descritption;
  123. CStdString genre;
  124. CStdString genrecategory;
  125. CStdString start;
  126. CStdString details;
  127. };
  128. struct ZAPSTREAM
  129. {
  130. bool initialized;
  131. bool available;
  132. };
  133. class CTuxBoxUtil
  134. {
  135. public:
  136. STREAMINFO sStrmInfo;
  137. CURRENTSERVICEDATA sCurSrvData;
  138. BOXSTATUS sBoxStatus;
  139. BOXSINFO sBoxInfo;
  140. SERVICE_EPG sServiceEPG;
  141. VIDEOSUBCHANNEL vVideoSubChannel;
  142. ZAPSTREAM sZapstream;
  143. CTuxBoxUtil(void);
  144. virtual ~CTuxBoxUtil(void);
  145. bool GetZapUrl(const CStdString& strPath, CFileItem &items);
  146. bool ParseBouquets(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
  147. bool ParseBouquetsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
  148. bool ParseChannels(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
  149. bool ParseChannelsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
  150. bool ZapToUrl(CURL url, const CStdString &pathOption);
  151. bool StreamInformations(TiXmlElement *pRootElement);
  152. bool CurrentServiceData(TiXmlElement *pRootElement);
  153. bool BoxStatus(TiXmlElement *pRootElement);
  154. bool BoxInfo(TiXmlElement *pRootElement);
  155. bool ServiceEPG(TiXmlElement *pRootElement);
  156. bool GetHttpXML(CURL url,CStdString strRequestType);
  157. bool GetGUIRequestedAudioChannel(AUDIOCHANNEL& sRequestedAC);
  158. bool GetRequestedAudioChannel(AUDIOCHANNEL& sRequestedAC);
  159. bool GetVideoSubChannels(CStdString& strVideoSubChannelName, CStdString& strVideoSubChannelPid);
  160. bool GetVideoChannels(TiXmlElement *pRootElement);
  161. bool CreateNewItem(const CFileItem& item, CFileItem& item_new);
  162. bool InitZapstream(const CStdString& strPath);
  163. bool SetAudioChannel(const CStdString& strPath, const AUDIOCHANNEL& sAC);
  164. CStdString GetPicon(CStdString strServiceName);
  165. CStdString GetSubMode(int iMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
  166. CStdString DetectSubMode(CStdString strSubMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
  167. };
  168. extern CTuxBoxUtil g_tuxbox;
  169. class CTuxBoxService : public CThread
  170. {
  171. public:
  172. CTuxBoxService();
  173. ~CTuxBoxService();
  174. bool Start();
  175. void Stop();
  176. bool IsRunning();
  177. virtual void OnExit();
  178. virtual void OnStartup();
  179. virtual void Process();
  180. };
  181. extern CTuxBoxService g_tuxboxService;