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