Merge remote-tracking branch 'check/next-cc'

This commit is contained in:
Stefan Seyfried
2014-01-27 21:00:18 +01:00
11 changed files with 51 additions and 9 deletions

View File

@@ -58,6 +58,7 @@ extern cVideo * videoDecoder;
extern CPictureViewer * g_PicViewer;
#define ICON_CACHE_SIZE 1024*1024*2 // 2mb
#define ICONDIR_VAR "/var/tuxbox/icons/"
#define BACKGROUNDIMAGEWIDTH 720
@@ -953,7 +954,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
/* we cache and check original name */
it = icon_cache.find(filename);
if(it == icon_cache.end()) {
std::string newname = iconBasePath + filename.c_str() + ".png";
std::string newname = std::string(ICONDIR_VAR) + filename + ".png";
if (access(newname.c_str(), F_OK))
newname = iconBasePath + filename + ".png";
//printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout);
data = g_PicViewer->getIcon(newname, &width, &height);
@@ -972,7 +975,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
goto _display;
}
newname = iconBasePath + filename.c_str() + ".raw";
newname = std::string(ICONDIR_VAR) + filename + ".raw";
if (access(newname.c_str(), F_OK))
newname = iconBasePath + filename + ".raw";
int lfd = open(newname.c_str(), O_RDONLY);

View File

@@ -887,6 +887,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
*msg = NeutrinoMessages::RELOAD_SETUP;
*data = 0;
break;
case NeutrinoMessages::EVT_HDMI_CEC_ON:
*msg = NeutrinoMessages::EVT_HDMI_CEC_ON;
*data = 0;
break;
default:
printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID );
}

View File

@@ -42,6 +42,8 @@
SHTDCNT::SHTDCNT()
{
thread_running = false;
sleep_cnt = 0;
shutdown_cnt = 0;
}
SHTDCNT::~SHTDCNT()

View File

@@ -916,6 +916,8 @@ int CLuaInstance::MenuAddItem(lua_State *L)
if (type == "back") {
m->m->addItem(GenericMenuBack);
} else if (type == "separator") {
m->m->addItem(GenericMenuSeparator);
} else if (type == "separatorline") {
if (!b->name.empty()) {
m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, b->name.c_str(), NONEXISTANT_LOCALE));
} else {

View File

@@ -350,7 +350,7 @@ int CMiscMenue::showMiscSettingsMenuEnergy()
if (shutdown_count.length() < 3)
shutdown_count.insert(0, 3 - shutdown_count.length(), ' ');
CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, &shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 ");
CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, shutdown_count.c_str(), miscSettings_shutdown_count);
CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, shutdown_count, miscSettings_shutdown_count);
m2->setHint("", LOCALE_MENU_HINT_SHUTDOWN_COUNT);
COnOffNotifier * miscNotifier = new COnOffNotifier(1);
@@ -407,21 +407,21 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg)
if (epg_extendedcache.length() < 3)
epg_extendedcache.insert(0, 3 - epg_extendedcache.length(), ' ');
CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, epg_extendedcache.c_str(), miscSettings_epg_cache_e);
CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, epg_extendedcache, miscSettings_epg_cache_e);
mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE);
epg_old_events = to_string(g_settings.epg_old_events);
if (epg_old_events.length() < 3)
epg_old_events.insert(0, 3 - epg_old_events.length(), ' ');
CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, epg_old_events.c_str(), miscSettings_epg_old_events);
CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, epg_old_events, miscSettings_epg_old_events);
mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS);
epg_max_events = to_string(g_settings.epg_max_events);
if (epg_max_events.length() < 6)
epg_max_events.insert(0, 6 - epg_max_events.length(), ' ');
CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier);
CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events.c_str(), miscSettings_epg_max_events);
CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events, miscSettings_epg_max_events);
mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS);
CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir");

View File

@@ -65,6 +65,7 @@
#include <driver/screen_max.h>
#include <driver/display.h>
#include <system/settings.h>
#include <algorithm>

View File

@@ -3148,6 +3148,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
// ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED),
// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO);
}
else if (msg == NeutrinoMessages::EVT_HDMI_CEC_ON) {
if(g_settings.hdmi_cec_view_on)
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on);
return messages_return::handled;
}
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
delete [] (unsigned char*) data;

View File

@@ -151,6 +151,8 @@ struct NeutrinoMessages {
/* sectionsd */
EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */
EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */
EVT_HDMI_CEC_ON = CRCInput::RC_WithData + 26
};
enum
{

View File

@@ -48,6 +48,8 @@
// nhttpd
#include "neutrinoapi.h"
#include "controlapi.h"
#include <video.h>
extern cVideo * videoDecoder;
extern CPlugins *g_PluginList;//for relodplugins
extern CBouquetManager *g_bouquetManager;
@@ -424,6 +426,17 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
{
if (!(hh->ParamList.empty()))
{
bool CEC_HDMI_off = false;
if (!(hh->ParamList["cec"].empty())){
if(hh->ParamList["cec"]=="off"){
CEC_HDMI_off = true;
}
}
//dont use CEC with standbyoff --- use: control/standby?off&cec=off
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){
videoDecoder->SetCECAutoView(0);
}
if (hh->ParamList["1"] == "on") // standby mode on
{
if(CNeutrinoApp::getInstance()->getMode() != 4)
@@ -439,6 +452,10 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
}
else
hh->SendError();
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){//dont use CEC with standbyoff
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD);
}
}
else
if(CNeutrinoApp::getInstance()->getMode() == 4)//mode_standby = 4

View File

@@ -130,6 +130,7 @@ CNeutrinoAPI::CNeutrinoAPI()
EventServer->registerEvent2( NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
}
//-------------------------------------------------------------------------

View File

@@ -294,9 +294,11 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)
std::string find_executable(const char *name)
{
struct stat s;
char *path = getenv("PATH");
char *p, *n;
if (! path)
char *tmpPath = getenv("PATH");
char *p, *n, *path;
if (tmpPath)
path = strdupa(tmpPath);
else
path = strdupa("/bin:/usr/bin:/sbin:/usr/sbin");
if (name[0] == '/') { /* full path given */
if (!access(name, X_OK) && !stat(name, &s) && S_ISREG(s.st_mode))