Project

General

Profile

Feature #545 » menuHTTP.c.diff

diff - Anonymous, 02/02/2011 07:22 PM

View differences:

vdr-plugin-streamdev-0.5.0+git20110128/server/menuHTTP.c
"[<a href=\"/\">Home</a> (<a href=\"all.html\" tvid=\"RED\">no script</a>)] "
"[<a href=\"tree.html\" tvid=\"GREEN\">Tree View</a>] "
"[<a href=\"groups.html\" tvid=\"YELLOW\">Groups</a> (<a href=\"groups.m3u\">Playlist</a>)] "
"[<a href=\"channels.html\" tvid=\"BLUE\">Channels</a> (<a href=\"channels.m3u\">Playlist</a>)] ";
"[<a href=\"channels.html\" tvid=\"BLUE\">Channels</a> (<a href=\"channels.m3u\">Playlist</a>)] "
"[<a href=\"rss.xml\">RSS</a>] ";
const char* cHtmlChannelList::css =
"<style type=\"text/css\">\n"
......
}
}
//Vito
// ******************** cRssList ******************
cRssList::cRssList(cChannelIterator *Iterator, const char* Base, eStreamType StreamType)
: cChannelList(Iterator),
m_IConv(cCharSetConv::SystemCharacterTable(), "UTF-8")
{
streamType = StreamType;
base = strdup(Base);
rssState = msFirst;
}
cRssList::~cRssList()
{
free(base);
}
bool cRssList::HasNext()
{
return rssState != msLast;
}
std::string cRssList::Next()
{
std::string type_ext;
if (rssState == msFirst)
{
rssState = msContinue;
return "<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n\t<channel>\n";
}
const cChannel *channel = NextChannel();
if (!channel)
{
rssState = msLast;
return "\t</channel>\n</rss>\n";
}
std::string name = (std::string) m_IConv.Convert(channel->Name());
switch(streamType)
{
case stTS:
type_ext = (std::string) ".ts";
break;
case stPS:
type_ext = (std::string) ".vob";
break;
case stPES:
type_ext = (std::string) ".vdr";
break;
case stES:
type_ext = (std::string) ".ts";
break;
case stEXT:
type_ext = (std::string) ".avi";
break;
default:
type_ext = (std::string) ".ts";
}
if (channel->GroupSep())
{
return (std::string) "";
} else {
return (std::string) "\t\t<item>\n\t\t<num>" +
(const char*) itoa(channel->Number()) + "</num>\n\t\t<title>" + name + "</title>\n\t\t<link>" +
base + (std::string) channel->GetChannelID().ToString() + type_ext + "</link>\n\t\t<description>\n\t\tEPG\n\t\t</description>\n\t\t</item>\n";
}
}
(3-3/5)