mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 18:01:06 +02:00
Merge remote-tracking branch 'check/next-cc'
...only build-tested, needs fixes
Origin commit data
------------------
Branch: ni/coolstream
Commit: ecd62d81d1
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-02-15 (Sat, 15 Feb 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -49,6 +49,8 @@
|
||||
#include "neutrinoapi.h"
|
||||
#include "controlapi.h"
|
||||
#include <video.h>
|
||||
#include <zapit/femanager.h>
|
||||
|
||||
extern cVideo * videoDecoder;
|
||||
|
||||
extern CPlugins *g_PluginList;//for relodplugins
|
||||
@@ -161,6 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""},
|
||||
{"epg", &CControlAPI::EpgCGI, ""},
|
||||
{"zapto", &CControlAPI::ZaptoCGI, "text/plain"},
|
||||
{"signal", &CControlAPI::SignalInfoCGI, "text/plain"},
|
||||
{"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"},
|
||||
{"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"},
|
||||
// boxcontrol - system
|
||||
@@ -212,7 +215,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
// settings
|
||||
{"config", &CControlAPI::ConfigCGI, "text/plain"},
|
||||
// filehandling
|
||||
{"file", &CControlAPI::FileCGI, "+xml"},
|
||||
{"file", &CControlAPI::FileCGI, "+xml"}
|
||||
|
||||
|
||||
};
|
||||
@@ -780,12 +783,14 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
|
||||
}
|
||||
else if (hh->ParamList["1"].compare("mute") == 0)
|
||||
{
|
||||
NeutrinoAPI->Zapit->muteAudio(true);
|
||||
char mute = 1;
|
||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char));
|
||||
hh->SendOk();
|
||||
}
|
||||
else if (hh->ParamList["1"].compare("unmute") == 0)
|
||||
{
|
||||
NeutrinoAPI->Zapit->muteAudio(false);
|
||||
char mute = 0;
|
||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char));
|
||||
hh->SendOk();
|
||||
}
|
||||
else if (hh->ParamList["1"].compare("status") == 0) { // Mute status
|
||||
@@ -793,7 +798,7 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
|
||||
}
|
||||
else if(hh->ParamList["1"]!="") { //set volume
|
||||
char vol = atol( hh->ParamList["1"].c_str() );
|
||||
NeutrinoAPI->Zapit->setVolume(vol,vol);
|
||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, (void *)&vol, sizeof(char));
|
||||
hh->SendOk();
|
||||
}
|
||||
else
|
||||
@@ -1392,7 +1397,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat )
|
||||
struct tm *tmStartZeit = localtime(&eventIterator->startTime);
|
||||
if(xml_forat){
|
||||
hh->printf("\t<epgsearch>");
|
||||
hh->printf("\t\t<channelname>%s</channelname>\n",NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str());
|
||||
hh->printf("\t\t<channelname>%s</channelname>\n",ZapitTools::UTF8_to_UTF8XML(NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()).c_str());;
|
||||
hh->printf("\t\t<epgtitle>%s</epgtitle>\n",ZapitTools::UTF8_to_UTF8XML(epg.title.c_str()).c_str());
|
||||
hh->printf("\t\t<info1>%s</info1>\n",ZapitTools::UTF8_to_UTF8XML(epg.info1.c_str()).c_str());
|
||||
hh->printf("\t\t<info2>%s</info2>\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str());
|
||||
@@ -1760,6 +1765,40 @@ void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP)
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CControlAPI::SignalInfoCGI(CyhookHandler *hh)
|
||||
{
|
||||
CFrontend *frontend = CFEManager::getInstance()->getLiveFE();
|
||||
if(frontend){
|
||||
bool parame_empty = false;
|
||||
|
||||
if (hh->ParamList["1"].empty())
|
||||
parame_empty = true;
|
||||
|
||||
if ( parame_empty || (hh->ParamList["1"] == "sig") ){
|
||||
unsigned int sig = frontend->getSignalStrength() & 0xFFFF;
|
||||
sig = (sig & 0xFFFF) * 100 / 65535;
|
||||
if (parame_empty)
|
||||
hh->printf("SIG: ");
|
||||
hh->printf("%3u\n", sig);
|
||||
}
|
||||
if ( parame_empty || (hh->ParamList["1"] == "snr") ){
|
||||
unsigned int snr = frontend->getSignalNoiseRatio() & 0xFFFF;
|
||||
snr = (snr & 0xFFFF) * 100 / 65535;
|
||||
if (parame_empty)
|
||||
hh->printf("SNR: ");
|
||||
hh->printf("%3u\n", snr);
|
||||
}
|
||||
if ( parame_empty || (hh->ParamList["1"] == "ber") ){
|
||||
unsigned int ber = frontend->getBitErrorRate();
|
||||
if (parame_empty)
|
||||
hh->printf("BER: ");
|
||||
hh->printf("%3u\n", ber);
|
||||
}
|
||||
}else
|
||||
hh->SendError();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CControlAPI::SendStreamInfo(CyhookHandler *hh)
|
||||
{
|
||||
|
@@ -111,6 +111,8 @@ private:
|
||||
void logoCGI(CyhookHandler *hh);
|
||||
void ConfigCGI(CyhookHandler *hh);
|
||||
void FileCGI(CyhookHandler *hh);
|
||||
void SignalInfoCGI(CyhookHandler *hh);
|
||||
|
||||
|
||||
protected:
|
||||
static const unsigned int PLUGIN_DIR_COUNT = 7;
|
||||
|
@@ -132,6 +132,8 @@ CNeutrinoAPI::CNeutrinoAPI()
|
||||
EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf
|
||||
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
|
||||
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
|
||||
EventServer->registerEvent2( NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
|
||||
EventServer->registerEvent2( NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user