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