mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
yWeb 2.8.a.4
- updated nhttpd - Code clean up - changes to nhttpd.conf - some changes for logo display git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@416 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -63,9 +63,9 @@ void CControlAPI::init(CyhookHandler *hh)
|
||||
{
|
||||
if(PLUGIN_DIRS[0] == "")
|
||||
{ // given in nhttpd.conf
|
||||
PLUGIN_DIRS[0]=hh->WebserverConfigList["PublicDocumentRoot"];
|
||||
PLUGIN_DIRS[0]=hh->WebserverConfigList["WebsiteMain.override_directory"];
|
||||
PLUGIN_DIRS[0].append("/scripts");
|
||||
PLUGIN_DIRS[1]=hh->WebserverConfigList["PrivatDocumentRoot"];
|
||||
PLUGIN_DIRS[1]=hh->WebserverConfigList["WebsiteMain.directory"];
|
||||
PLUGIN_DIRS[1].append("/scripts");
|
||||
PLUGIN_DIRS[2]="/var/tuxbox/plugins";
|
||||
PLUGIN_DIRS[3]=PLUGINDIR;
|
||||
@@ -145,37 +145,37 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"channellist", &CControlAPI::ChannellistCGI, "text/plain"},
|
||||
{"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"},
|
||||
{"getbouquets", &CControlAPI::GetBouquetsCGI, "text/plain"},
|
||||
{"getmode", &CControlAPI::GetModeCGI, "text/plain"},
|
||||
{"setmode", &CControlAPI::SetModeCGI, "text/plain"},
|
||||
{"epg", &CControlAPI::EpgCGI, ""},
|
||||
{"zapto", &CControlAPI::ZaptoCGI, "text/plain"},
|
||||
{"getmode", &CControlAPI::GetModeCGI, "text/plain"},
|
||||
{"setmode", &CControlAPI::SetModeCGI, "text/plain"},
|
||||
{"epg", &CControlAPI::EpgCGI, ""},
|
||||
{"zapto", &CControlAPI::ZaptoCGI, "text/plain"},
|
||||
{"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"},
|
||||
// boxcontrol - system
|
||||
{"standby", &CControlAPI::StandbyCGI, "text/plain"},
|
||||
{"shutdown", &CControlAPI::ShutdownCGI, "text/plain"},
|
||||
{"reboot", &CControlAPI::RebootCGI, "text/plain"},
|
||||
{"getdate", &CControlAPI::GetDateCGI, "text/plain"},
|
||||
{"gettime", &CControlAPI::GetTimeCGI, "text/plain"},
|
||||
{"info", &CControlAPI::InfoCGI, "text/plain"},
|
||||
{"version", &CControlAPI::VersionCGI, ""},
|
||||
{"standby", &CControlAPI::StandbyCGI, "text/plain"},
|
||||
{"shutdown", &CControlAPI::ShutdownCGI, "text/plain"},
|
||||
{"reboot", &CControlAPI::RebootCGI, "text/plain"},
|
||||
{"getdate", &CControlAPI::GetDateCGI, "text/plain"},
|
||||
{"gettime", &CControlAPI::GetTimeCGI, "text/plain"},
|
||||
{"info", &CControlAPI::InfoCGI, "text/plain"},
|
||||
{"version", &CControlAPI::VersionCGI, ""},
|
||||
// boxcontrol - devices
|
||||
{"volume", &CControlAPI::VolumeCGI, "text/plain"},
|
||||
{"lcd", &CControlAPI::LCDAction, "text/plain"},
|
||||
{"system", &CControlAPI::SystemCGI, "text/plain"},
|
||||
{"message", &CControlAPI::MessageCGI, "text/plain"},
|
||||
{"rc", &CControlAPI::RCCGI, "text/plain"},
|
||||
{"rcem", &CControlAPI::RCEmCGI, "text/plain"},
|
||||
{"volume", &CControlAPI::VolumeCGI, "text/plain"},
|
||||
{"lcd", &CControlAPI::LCDAction, "text/plain"},
|
||||
{"system", &CControlAPI::SystemCGI, "text/plain"},
|
||||
{"message", &CControlAPI::MessageCGI, "text/plain"},
|
||||
{"rc", &CControlAPI::RCCGI, "text/plain"},
|
||||
{"rcem", &CControlAPI::RCEmCGI, "text/plain"},
|
||||
// Start skripts, plugins
|
||||
{"startplugin", &CControlAPI::StartPluginCGI, "text/plain"},
|
||||
{"exec", &CControlAPI::ExecCGI, "+xml"},
|
||||
{"yweb", &CControlAPI::YWebCGI, "text/plain"},
|
||||
{"exec", &CControlAPI::ExecCGI, "+xml"},
|
||||
{"yweb", &CControlAPI::YWebCGI, "text/plain"},
|
||||
// video handling
|
||||
{"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"},
|
||||
{"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"},
|
||||
{"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"},
|
||||
{"scartmode", &CControlAPI::ScartModeCGI, "text/plain"},
|
||||
{"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"},
|
||||
{"scartmode", &CControlAPI::ScartModeCGI, "text/plain"},
|
||||
// timer
|
||||
{"timer", &CControlAPI::TimerCGI, "text/plain"},
|
||||
{"timer", &CControlAPI::TimerCGI, "text/plain"},
|
||||
// bouquet editing
|
||||
{"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"},
|
||||
{"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"},
|
||||
@@ -652,53 +652,53 @@ static const struct key keynames[] = {
|
||||
};
|
||||
|
||||
// The code here is based on rcsim. Thx Carjay!
|
||||
void CControlAPI::RCEmCGI(CyhookHandler *hh)
|
||||
{
|
||||
if (hh->ParamList.empty()) {
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
std::string keyname = hh->ParamList["1"];
|
||||
int sendcode = -1;
|
||||
for (unsigned int i = 0; sendcode == -1 && i < sizeof(keynames)/sizeof(key); i++) {
|
||||
if (!strcmp(keyname.c_str(), keynames[i].name))
|
||||
sendcode = keynames[i].code;
|
||||
}
|
||||
void CControlAPI::RCEmCGI(CyhookHandler *hh) {
|
||||
if (hh->ParamList.empty()) {
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
std::string keyname = hh->ParamList["1"];
|
||||
int sendcode = -1;
|
||||
for (unsigned int i = 0; sendcode == -1 && i < sizeof(keynames)
|
||||
/ sizeof(key); i++) {
|
||||
if (!strcmp(keyname.c_str(), keynames[i].name))
|
||||
sendcode = keynames[i].code;
|
||||
}
|
||||
|
||||
if (sendcode == -1) {
|
||||
printf("[nhttpd] Key %s not found\n", keyname.c_str());
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
unsigned int repeat = 1;
|
||||
unsigned int delay = 250;
|
||||
if (hh->ParamList["delay"] != "")
|
||||
delay = atoi(hh->ParamList["delay"].c_str());
|
||||
if (hh->ParamList["duration"] != "")
|
||||
repeat = atoi(hh->ParamList["duration"].c_str())*1000/delay;
|
||||
if (hh->ParamList["repeat"] != "")
|
||||
repeat = atoi(hh->ParamList["repeat"].c_str());
|
||||
if (sendcode == -1) {
|
||||
printf("[nhttpd] Key %s not found\n", keyname.c_str());
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
unsigned int repeat = 1;
|
||||
unsigned int delay = 250;
|
||||
if (hh->ParamList["delay"] != "")
|
||||
delay = atoi(hh->ParamList["delay"].c_str());
|
||||
if (hh->ParamList["duration"] != "")
|
||||
repeat = atoi(hh->ParamList["duration"].c_str()) * 1000 / delay;
|
||||
if (hh->ParamList["repeat"] != "")
|
||||
repeat = atoi(hh->ParamList["repeat"].c_str());
|
||||
|
||||
int evd = open(EVENTDEV, O_RDWR);
|
||||
if (evd < 0) {
|
||||
hh->SendError();
|
||||
perror("opening event0 failed");
|
||||
return;
|
||||
}
|
||||
if (rc_send(evd, sendcode, KEY_PRESSED) < 0){
|
||||
perror("writing 'KEY_PRESSED' event failed");
|
||||
hh->SendError();
|
||||
close(evd);
|
||||
return;
|
||||
}
|
||||
if (rc_send(evd, sendcode, KEY_RELEASED)<0){
|
||||
perror("writing 'KEY_RELEASED' event failed");
|
||||
close(evd);
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
close(evd);
|
||||
hh->SendOk();
|
||||
int evd = open(EVENTDEV, O_RDWR);
|
||||
if (evd < 0) {
|
||||
hh->SendError();
|
||||
perror("opening event0 failed");
|
||||
return;
|
||||
}
|
||||
if (rc_send(evd, sendcode, KEY_PRESSED) < 0) {
|
||||
perror("writing 'KEY_PRESSED' event failed");
|
||||
hh->SendError();
|
||||
close(evd);
|
||||
return;
|
||||
}
|
||||
if (rc_send(evd, sendcode, KEY_RELEASED) < 0) {
|
||||
perror("writing 'KEY_RELEASED' event failed");
|
||||
close(evd);
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
close(evd);
|
||||
hh->SendOk();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void CControlAPI::VideoFormatCGI(CyhookHandler *hh)
|
||||
@@ -926,8 +926,8 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
|
||||
{
|
||||
t_channel_id channel_id;
|
||||
sscanf(hh->ParamList["id"].c_str(),
|
||||
SCANF_CHANNEL_ID_TYPE,
|
||||
&channel_id);
|
||||
SCANF_CHANNEL_ID_TYPE,
|
||||
&channel_id);
|
||||
sectionsd_getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL, NeutrinoAPI->eList);
|
||||
CChannelEventList::iterator eventIterator;
|
||||
for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); eventIterator++)
|
||||
@@ -947,8 +947,8 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
|
||||
//eventlist for a chan
|
||||
t_channel_id channel_id;
|
||||
sscanf(hh->ParamList["1"].c_str(),
|
||||
SCANF_CHANNEL_ID_TYPE,
|
||||
&channel_id);
|
||||
SCANF_CHANNEL_ID_TYPE,
|
||||
&channel_id);
|
||||
SendEventList(hh, channel_id);
|
||||
}
|
||||
}
|
||||
|
@@ -85,10 +85,8 @@ THandleStatus CNeutrinoYParser::Hook_SendResponse(CyhookHandler *hh)
|
||||
//-----------------------------------------------------------------------------
|
||||
THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList)
|
||||
{
|
||||
ConfigList["ExtrasDocumentRoot"]= Config->getString("ExtrasDocRoot", EXTRASDOCUMENTROOT);
|
||||
ConfigList["ExtrasDocumentURL"] = Config->getString("ExtrasDocURL", EXTRASDOCUMENTURL);
|
||||
// ConfigList["NewGui"] = Config->getString("NewGui", "true");
|
||||
ConfigList["Zapit_XML_Path"] = Config->getString("Zapit_XML_Path", ZAPITXMLPATH);
|
||||
// ConfigList["ExtrasDocumentRoot"]= Config->getString("ExtrasDocRoot", EXTRASDOCUMENTROOT);
|
||||
// ConfigList["ExtrasDocumentURL"] = Config->getString("ExtrasDocURL", EXTRASDOCUMENTURL);
|
||||
ConfigList["TUXBOX_LOGOS_URL"]= Config->getString("Tuxbox.LogosURL", TUXBOX_LOGOS_URL);
|
||||
|
||||
if (Config->getInt32("configfile.version") < 3)
|
||||
@@ -106,26 +104,26 @@ THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile *Config, CStringList
|
||||
//=============================================================================
|
||||
const CNeutrinoYParser::TyFuncCall CNeutrinoYParser::yFuncCallList[]=
|
||||
{
|
||||
{"mount-get-list", &CNeutrinoYParser::func_mount_get_list},
|
||||
{"mount-set-values", &CNeutrinoYParser::func_mount_set_values},
|
||||
{"mount-get-list", &CNeutrinoYParser::func_mount_get_list},
|
||||
{"mount-set-values", &CNeutrinoYParser::func_mount_set_values},
|
||||
{"get_bouquets_as_dropdown", &CNeutrinoYParser::func_get_bouquets_as_dropdown},
|
||||
{"get_bouquets_as_templatelist",&CNeutrinoYParser::func_get_bouquets_as_templatelist},
|
||||
{"get_actual_bouquet_number", &CNeutrinoYParser::func_get_actual_bouquet_number},
|
||||
{"get_channels_as_dropdown", &CNeutrinoYParser::func_get_channels_as_dropdown},
|
||||
{"get_bouquets_with_epg", &CNeutrinoYParser::func_get_bouquets_with_epg},
|
||||
{"get_actual_channel_id", &CNeutrinoYParser::func_get_actual_channel_id},
|
||||
{"get_mode", &CNeutrinoYParser::func_get_mode},
|
||||
{"get_video_pids", &CNeutrinoYParser::func_get_video_pids},
|
||||
{"get_audio_pid", &CNeutrinoYParser::func_get_radio_pid},
|
||||
{"get_bouquets_with_epg", &CNeutrinoYParser::func_get_bouquets_with_epg},
|
||||
{"get_actual_channel_id", &CNeutrinoYParser::func_get_actual_channel_id},
|
||||
{"get_mode", &CNeutrinoYParser::func_get_mode},
|
||||
{"get_video_pids", &CNeutrinoYParser::func_get_video_pids},
|
||||
{"get_audio_pid", &CNeutrinoYParser::func_get_radio_pid},
|
||||
{"get_audio_pids_as_dropdown", &CNeutrinoYParser::func_get_audio_pids_as_dropdown},
|
||||
{"umount_get_list", &CNeutrinoYParser::func_unmount_get_list},
|
||||
{"get_partition_list", &CNeutrinoYParser::func_get_partition_list},
|
||||
{"get_boxtype", &CNeutrinoYParser::func_get_boxtype},
|
||||
{"get_current_stream_info", &CNeutrinoYParser::func_get_current_stream_info},
|
||||
{"get_timer_list", &CNeutrinoYParser::func_get_timer_list},
|
||||
{"set_timer_form", &CNeutrinoYParser::func_set_timer_form},
|
||||
{"bouquet_editor_main", &CNeutrinoYParser::func_bouquet_editor_main},
|
||||
{"set_bouquet_edit_form", &CNeutrinoYParser::func_set_bouquet_edit_form},
|
||||
{"umount_get_list", &CNeutrinoYParser::func_unmount_get_list},
|
||||
{"get_partition_list", &CNeutrinoYParser::func_get_partition_list},
|
||||
{"get_boxtype", &CNeutrinoYParser::func_get_boxtype},
|
||||
{"get_current_stream_info", &CNeutrinoYParser::func_get_current_stream_info},
|
||||
{"get_timer_list", &CNeutrinoYParser::func_get_timer_list},
|
||||
{"set_timer_form", &CNeutrinoYParser::func_set_timer_form},
|
||||
{"bouquet_editor_main", &CNeutrinoYParser::func_bouquet_editor_main},
|
||||
{"set_bouquet_edit_form", &CNeutrinoYParser::func_set_bouquet_edit_form},
|
||||
|
||||
};
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -330,7 +328,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
std::string timestr;
|
||||
bool have_logos = false;
|
||||
|
||||
if(hh->WebserverConfigList["TUXBOX_LOGOS_URL"] != "" ||hh->WebserverConfigList["ExtrasDocumentRoot"] == "web" || (access((hh->WebserverConfigList["ExtrasDocumentRoot"]+"/logos").c_str(),4)==0) )
|
||||
if(hh->WebserverConfigList["Tuxbox.LogosURL"] != "")
|
||||
have_logos = true;
|
||||
for(int j = 0; j < (int) channels.size(); j++)
|
||||
{
|
||||
@@ -348,10 +346,10 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
if(have_logos)
|
||||
yresult += string_printf("<td class=\"%c\" width=\"44\" rowspan=\"2\"><a href=\"javascript:do_zap('"
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
"')\"><img class=\"channel_logo\" src=\"%s/logos/"
|
||||
"')\"><img class=\"channel_logo\" src=\"%s/"
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
".jpg\"/></a></td>", classname, channel->channel_id,
|
||||
(hh->WebserverConfigList["ExtrasDocumentURL"]).c_str(),
|
||||
(hh->WebserverConfigList["Tuxbox.LogosURL"]).c_str(),
|
||||
channel->channel_id & 0xFFFFFFFFFFFFULL);
|
||||
|
||||
/* timer slider */
|
||||
@@ -376,6 +374,8 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
"')\"> %d. %s%s</a> <a href=\"javascript:do_epg('"
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
"','"
|
||||
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
|
||||
"')\">%s</a>\n",
|
||||
((channel->channel_id == current_channel) ? "<a name=\"akt\"></a>" : " "),
|
||||
channel->channel_id,
|
||||
@@ -383,6 +383,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
channel->getName().c_str(),
|
||||
(channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "",
|
||||
channel->channel_id,
|
||||
channel->channel_id & 0xFFFFFFFFFFFFULL,
|
||||
((NeutrinoAPI->ChannelListEvents[channel->channel_id]) ? "<img src=\"/images/elist.gif\" alt=\"Programmvorschau\" style=\"border: 0px\" />" : ""));
|
||||
|
||||
if (channel->channel_id == current_channel)
|
||||
@@ -441,7 +442,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
|
||||
yresult += string_printf("<tr><td class=\"%cepg\">",classname);
|
||||
yresult += string_printf("%s %s "
|
||||
"<span style=\"font-size: 8pt; white-space: nowrap\">(%ld von %d min, %d%%)</span>"
|
||||
"<span style=\"font-size: 8pt; white-space: nowrap\">(%ld von %d min, %d%%)</span>"
|
||||
, timestr.c_str()
|
||||
, event->description.c_str()
|
||||
, (time(NULL) - event->startTime)/60
|
||||
|
Reference in New Issue
Block a user