diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 31f008a17..e01dbd85e 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -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); diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index c4ae68b25..1a5ccb008 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -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 ); } diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index 159319f73..43d55f22c 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -42,6 +42,8 @@ SHTDCNT::SHTDCNT() { thread_running = false; + sleep_cnt = 0; + shutdown_cnt = 0; } SHTDCNT::~SHTDCNT() diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index a0fa0a1a7..aa27a6ed2 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -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 { diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 856683fe9..3ac223e05 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -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"); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 254b56f0f..2eaf46696 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -65,6 +65,7 @@ #include #include + #include #include diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bc2859a87..0ad202426 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -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; diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index ce90d5b46..28c60dd58 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -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 { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 2b45838b6..1b2568d6e 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -48,6 +48,8 @@ // nhttpd #include "neutrinoapi.h" #include "controlapi.h" +#include +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 diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index f7d23babb..d112858af 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -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"); } //------------------------------------------------------------------------- diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 99c37c012..1251a5837 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -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))