From 693691124f6a1c62be161a3c0729b700f311cc7b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 29 Jan 2014 17:19:00 +0400 Subject: [PATCH 01/67] driver/record.cpp: dont show menu after timeshift stop, if timeshift record already stopped Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d683fe4c9269b88c7712d06c34f2251f9036643 Author: [CST] Focus Date: 2014-01-29 (Wed, 29 Jan 2014) --- src/driver/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f7aba8256..5a4bf3171 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1360,7 +1360,7 @@ void CRecordManager::StartTimeshift() if(res) { CMoviePlayerGui::getInstance().exec(NULL, tmode); - if(g_settings.temp_timeshift && !g_settings.auto_timeshift) + if(g_settings.temp_timeshift && !g_settings.auto_timeshift && autoshift) ShowMenu(); } } From ed4273c7456c5770aaee40eb9f90d0127c8a47ea Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 29 Jan 2014 17:21:28 +0400 Subject: [PATCH 02/67] gui/movieplayer.cpp: for timeshift started in rewind mode, fix vfd speed display, force play time display Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a763a9ab068322b44963e911bdfa077a55b66be0 Author: [CST] Focus Date: 2014-01-29 (Wed, 29 Jan 2014) --- src/gui/movieplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index a7f36e9e3..f61585960 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -575,6 +575,11 @@ void CMoviePlayerGui::PlayFile(void) /* playback->Start() starts paused */ if(timeshift == 3) { playback->SetSpeed(-1); + playstate = CMoviePlayerGui::REW; + if (!FileTime.IsVisible() && !time_forced) { + FileTime.switchMode(position, duration); + time_forced = true; + } } else if(!timeshift || !g_settings.timeshift_pause) { playback->SetSpeed(1); } From 4a6379a0d6710457129f54ae95feb9dca97d4e87 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 29 Jan 2014 17:26:45 +0400 Subject: [PATCH 03/67] gui/infoviewer.cpp: update movieplayer position also in timeshift mode; fix messages in timeshift mode: while infobar is visible, all but key events was dropped, preventing ie record timer stop etc. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5135e3077355263ac91f1942b032aca5fdab9257 Author: [CST] Focus Date: 2014-01-29 (Wed, 29 Jan 2014) --- src/gui/infoviewer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ccfea0f2d..072e7288c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -924,7 +924,8 @@ void CInfoViewer::loop(bool show_dot) res = messages_return::cancel_info; } } - } else if (fileplay && !CMoviePlayerGui::getInstance().timeshift /* && ( (msg == (neutrino_msg_t) g_settings.mpkey_pause) || (msg == (neutrino_msg_t) g_settings.mpkey_rewind) || (msg == (neutrino_msg_t) g_settings.mpkey_play) || (msg == (neutrino_msg_t) g_settings.mpkey_forward) || (msg == (neutrino_msg_t) g_settings.mpkey_stop)) */ ) { + } else if (fileplay || CMoviePlayerGui::getInstance().timeshift) { + /* this debug message will only hit in movieplayer mode, where console is * spammed to death anyway... */ printf("%s:%d msg:%08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); @@ -942,6 +943,7 @@ void CInfoViewer::loop(bool show_dot) CMoviePlayerGui::getInstance().start_timeshift = false; } #endif +#if 0 else if (CMoviePlayerGui::getInstance().timeshift && ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || \ (msg == (neutrino_msg_t) g_settings.mpkey_forward) || \ (msg == (neutrino_msg_t) g_settings.mpkey_pause) || \ @@ -952,6 +954,7 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; } +#endif } if (hideIt) { @@ -1274,8 +1277,9 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) } else if (data == lcdUpdateTimer) { //printf("CInfoViewer::handleMsg: lcdUpdateTimer\n"); if (is_visible) { - if (fileplay) { + if (fileplay || CMoviePlayerGui::getInstance().timeshift) CMoviePlayerGui::getInstance().UpdatePosition(); + if (fileplay) { char runningRest[32]; // %d can be 10 digits max... int curr_pos = CMoviePlayerGui::getInstance().GetPosition(); int duration = CMoviePlayerGui::getInstance().GetDuration(); From 6ff7880f77ec03f00490cfb22584bf33329c94d4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 29 Jan 2014 19:28:53 +0400 Subject: [PATCH 04/67] gui/movieplayer.cpp: fix stalled old speed display on vfd, when timeshift rewind started Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91c62d6ff0bfa0f5cec1f648b51ea18cc5cf969e Author: [CST] Focus Date: 2014-01-29 (Wed, 29 Jan 2014) --- src/gui/movieplayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f61585960..5d630dcc9 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -508,6 +508,7 @@ void CMoviePlayerGui::PlayFile(void) //CTimeOSD FileTime; position = 0, duration = 0; + speed = 1; playstate = CMoviePlayerGui::STOPPED; printf("Startplay at %d seconds\n", startposition/1000); @@ -574,6 +575,7 @@ void CMoviePlayerGui::PlayFile(void) /* playback->Start() starts paused */ if(timeshift == 3) { + speed = -1; playback->SetSpeed(-1); playstate = CMoviePlayerGui::REW; if (!FileTime.IsVisible() && !time_forced) { From 28799374eddbce9fc82486500e10b9789f25bb4d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 29 Jan 2014 05:29:10 +0100 Subject: [PATCH 05/67] CFlashExpert::checkSize: Fix display backupMaxSize & backupRequiredSize Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/583931e4467a1a0953369550b6a41a0c653f6197 Author: Michael Liebmann Date: 2014-01-29 (Wed, 29 Jan 2014) --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/gui/update.cpp | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 12847d421..aceeebc7d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -537,7 +537,7 @@ flashupdate.proxyusername Benutzername flashupdate.proxyusername_hint1 Geben Sie den Proxy-Benutzernamen ein flashupdate.proxyusername_hint2 Ein leerer Eintrag bedeutet keine Authentifizierung flashupdate.read_directory_not_exist Das Backupverzeichnis %s \nexistiert nicht! -flashupdate.read_no_available_space Der maximal verfügbare Platz in %s \nbeträgt %d KB, es werden aber %d KB benötigt.\n \nDer Vorgang wird abgebrochen, wählen sie bitte einen anderen Datenträger! +flashupdate.read_no_available_space Der maximal verfügbare Platz in %s \nbeträgt %s KB, es werden aber %s KB benötigt.\n \nDer Vorgang wird abgebrochen, wählen sie bitte einen anderen Datenträger! flashupdate.read_volume_error Die Größe des Datenträgers %s \nkann nicht ermittelt werden! flashupdate.readflash ganzes Flashimage auslesen flashupdate.readflashmtd einzelne Partition auslesen diff --git a/data/locale/english.locale b/data/locale/english.locale index 60774fae3..3b64a8549 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -537,7 +537,7 @@ flashupdate.proxyusername Username flashupdate.proxyusername_hint1 enter the proxyserver username flashupdate.proxyusername_hint2 a empty entry means no proxy-auth flashupdate.read_directory_not_exist The backup directory %s \ndoes not exist! -flashupdate.read_no_available_space The maximum available space in %s \nis %d KB, but there are %d KB required.\n \nThe operation is canceled, please choose another medium! +flashupdate.read_no_available_space The maximum available space in %s \nis %s KB, but there are %s KB required.\n \nThe operation is canceled, please choose another medium! flashupdate.read_volume_error The size of the volume %s \ncan not be determined! flashupdate.readflash Read whole image flashupdate.readflashmtd Read one partition diff --git a/src/gui/update.cpp b/src/gui/update.cpp index de2948901..5b9d21f33 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include @@ -582,6 +583,8 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile) return false; } backupRequiredSize = ((bused * bsize) / 1024ULL) * 2ULL; // twice disk space for summarized image + dprintf(DEBUG_INFO, "##### [%s] backupRequiredSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", + __func__, backupRequiredSize, btotal, bused, bsize); } else #endif @@ -596,11 +599,11 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile) uint64_t backupMaxSize = (btotal - bused) * (uint64_t)bsize; uint64_t res = 10; // Reserved 10% of available space backupMaxSize = (backupMaxSize - ((backupMaxSize * res) / 100ULL)) / 1024ULL; - printf("##### [%s] backupMaxSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", + dprintf(DEBUG_INFO, "##### [%s] backupMaxSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", __func__, backupMaxSize, btotal, bused, bsize); if (backupMaxSize < backupRequiredSize) { - snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), backupMaxSize, backupRequiredSize); + snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), to_string(backupMaxSize).c_str(), to_string(backupRequiredSize).c_str()); ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg); return false; } From 99ee825ad758d9c0e55ff8adc180ca408ea86d1d Mon Sep 17 00:00:00 2001 From: martii Date: Wed, 29 Jan 2014 20:06:31 +0100 Subject: [PATCH 06/67] gui/timerlist: fix display of channel name Signed-off-by: M. Liebmann Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86fca1090924a49f3e5b94c4b05fbe5fb0947b15 Author: martii Date: 2014-01-29 (Wed, 29 Jan 2014) --- src/gui/timerlist.cpp | 6 +++--- src/gui/timerlist.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index a841b56ba..b22f28418 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -321,7 +321,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) else if (timerNew.eventType == CTimerd::TIMER_ZAPTO || timerNew.eventType == CTimerd::TIMER_RECORD) { - if (strcmp(timerNew_channel_name, "---")==0) + if (timerNew_channel_name == "---") return menu_return::RETURN_REPAINT; if (timerNew.eventType==CTimerd::TIMER_RECORD) { @@ -369,7 +369,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) "%n", &timerNew.channel_id, &delta); - strncpy(timerNew_channel_name, &(key[3 + delta + 1]), 29); + timerNew_channel_name = std::string(key + 3 + delta + 1); g_RCInput->postMsg(CRCInput::RC_timeout, 0); // leave underlying menu also g_RCInput->postMsg(CRCInput::RC_timeout, 0); // leave underlying menu also return menu_return::RETURN_EXIT; @@ -1211,7 +1211,7 @@ int CTimerList::newTimer() CMenuWidget mm(LOCALE_TIMERLIST_MODESELECT, NEUTRINO_ICON_SETTINGS); mm.addItem(new CMenuForwarder(LOCALE_TIMERLIST_MODETV, true, NULL, &mctv)); mm.addItem(new CMenuForwarder(LOCALE_TIMERLIST_MODERADIO, true, NULL, &mcradio)); - strcpy(timerNew_channel_name,"---"); + timerNew_channel_name = "---"; CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_CHANNEL, true, timerNew_channel_name, &mm); CMenuForwarder* m7 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, true,timerNew.recordingDir, this, "rec_dir2", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 067d942bb..0266c6e04 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -63,7 +63,7 @@ class CTimerList : public CMenuTarget CTimerd::TimerList timerlist; // List of timers CTimerd::responseGetTimer timerNew; int timerNew_standby_on; - char timerNew_channel_name[30]; + std::string timerNew_channel_name; std::string m_weekdaysStr; int timer_apids_dflt; From f45ae5cab423188efcf143ef20601ec6c001f830 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 30 Jan 2014 05:46:48 +0100 Subject: [PATCH 07/67] CMenuForwarder: Fix options handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/08130328a021d9b804f3201d8699e5aa7dc5439e Author: Michael Liebmann Date: 2014-01-30 (Thu, 30 Jan 2014) --- src/gui/widget/menue.cpp | 35 +++++++++++++++++++++++++---------- src/gui/widget/menue.h | 5 +++-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a86fc473c..a3581c486 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1814,7 +1814,8 @@ int CMenuOptionLanguageChooser::paint( bool selected ) //------------------------------------------------------------------------------------------------------------------------------- CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string_ptr = &Option; + option_string = &Option; + option = NULL; name = Text; nameString = ""; active = Active; @@ -1828,7 +1829,8 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string_ptr = &Option; + option_string = &Option; + option = NULL; name = NONEXISTANT_LOCALE; nameString = Text; active = Active; @@ -1842,8 +1844,8 @@ CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string = Option ? Option : ""; - option_string_ptr = &option_string; + option_string = NULL; + option = Option; name = Text; nameString = ""; active = Active; @@ -1857,8 +1859,8 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string = Option ? Option : ""; - option_string_ptr = &option_string; + option_string = NULL; + option = Option; name = NONEXISTANT_LOCALE; nameString = Text; active = Active; @@ -1882,9 +1884,20 @@ void CMenuForwarder::setName(const neutrino_locale_t t) nameString = ""; } +void CMenuForwarder::setOption(const char * const Option) +{ + option = Option; + option_string = NULL; + if (used && x != -1) + paint(); +} + void CMenuForwarder::setOption(const std::string &Option) { - option_string = Option; + option = NULL; + option_string = &Option; + if (used && x != -1) + paint(); } int CMenuForwarder::getHeight(void) const @@ -1924,9 +1937,11 @@ int CMenuForwarder::exec(CMenuTarget* parent) std::string CMenuForwarder::getOption(void) { - if (!option_string_ptr->empty()) - return *option_string_ptr; - if (jumpTarget) + if (option) + return (std::string)option; + else if (option_string) + return *option_string; + else if (jumpTarget) return jumpTarget->getValue(); return ""; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index c6e9c234e..c66484fea 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -217,8 +217,8 @@ class CMenuForwarder : public CMenuItem std::string actionKey; protected: - std::string option_string; - const std::string * option_string_ptr; + const char * option; + const std::string * option_string; CMenuTarget * jumpTarget; virtual std::string getOption(void); @@ -250,6 +250,7 @@ class CMenuForwarder : public CMenuItem int exec(CMenuTarget* parent); bool isSelectable(void) const { return active; } void setOption(const std::string &Option); + void setOption(const char * const Option); void setName(const std::string& text); void setName(const neutrino_locale_t text); }; From 5503a94df8ddc8e2c2793f68a34889739968b4da Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 30 Jan 2014 07:26:11 +0100 Subject: [PATCH 08/67] CTimerList: Add lua plugins to plugin selection Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f2fccc6d85130ba1ea8af6f0ea47f60e2c6ff4fc Author: Michael Liebmann Date: 2014-01-30 (Thu, 30 Jan 2014) --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index b22f28418..3db880fe1 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1223,7 +1223,7 @@ int CTimerList::newTimer() CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew.message, &timerSettings_msg ); strcpy(timerNew.pluginName,"---"); - CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL, timerNew.pluginName); + CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL | CPlugins::P_TYPE_LUA, timerNew.pluginName); CMenuForwarder *m10 = new CMenuForwarder(LOCALE_TIMERLIST_PLUGIN, false, timerNew.pluginName, &plugin_chooser); From 1d3b10ca5b4b29c8897807c5e310f8a56ab91b94 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 31 Jan 2014 11:16:06 +0100 Subject: [PATCH 09/67] CKeyValue:: -fix get current name , fix -Wconversion in timerd Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2441171656cc2e5e0ed7b4dc6b46bcb2d4d92309 Author: Jacek Jendrzej Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/widget/keychooser.cpp | 2 +- src/timerd/timermanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index 41f325273..ed146b8fa 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -53,7 +53,7 @@ public: keyvalue = k; }; - virtual const char * getString(void) + virtual const char * getName(void) { the_text = g_Locale->getText(LOCALE_KEYCHOOSERMENU_CURRENTKEY); the_text += ": "; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 0c2f7135d..5493f126d 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1147,13 +1147,13 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): eventInfo.epgID = config->getInt64("EVENT_INFO_EPG_ID_"+id); dprintf("read EVENT_INFO_EPG_ID_%s %ld\n",id.c_str(),(long)eventInfo.epgID); - eventInfo.epg_starttime = config->getInt64("EVENT_INFO_EPG_STARTTIME_"+id); + eventInfo.epg_starttime = (long int)config->getInt64("EVENT_INFO_EPG_STARTTIME_"+id); dprintf("read EVENT_INFO_EPG_STARTTIME_%s %ld\n",id.c_str(),(long)eventInfo.epg_starttime); eventInfo.channel_id = config->getInt64("EVENT_INFO_CHANNEL_ID_"+id); dprintf("read EVENT_INFO_CHANNEL_ID_%s %ld\n",id.c_str(),(long)eventInfo.channel_id); - eventInfo.apids = config->getInt32("EVENT_INFO_APIDS_"+id); + eventInfo.apids = (unsigned char)config->getInt32("EVENT_INFO_APIDS_"+id); dprintf("read EVENT_INFO_APIDS_%s 0x%X (%p)\n",id.c_str(),eventInfo.apids,&eventInfo.apids); recordingDir = config->getString("REC_DIR_"+id); From ff767289608142f16781dfd794e3da1ddfc5694e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 31 Jan 2014 16:31:05 +0400 Subject: [PATCH 10/67] gui/imageinfo.cpp: honor screen setup values Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ae320ba4118af9beb77de6b33f8542d9f30fad0b Author: [CST] Focus Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/imageinfo.cpp | 7 +++++++ src/gui/imageinfo.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 4d980e519..e1e71e63f 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -181,7 +181,14 @@ void CImageInfo::ShowWindow() { CComponentsFooter *footer = NULL; if (cc_win == NULL){ + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance (); +#if 0 cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); +#endif + cc_win = new CComponentsWindow(frameBuffer->getScreenX(), frameBuffer->getScreenY(), + frameBuffer->getScreenWidth(), + frameBuffer->getScreenHeight(), + LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); footer = cc_win->getFooterObject(); footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 46e7615eb..d60f2df96 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -64,7 +64,8 @@ class CImageInfo : public CMenuTarget void ShowWindow(); void ScrollLic(bool scrollDown); - CComponentsWindowMax *cc_win; + //CComponentsWindowMax *cc_win; + CComponentsWindow *cc_win; CComponentsForm *cc_info; CComponentsPIP *cc_tv; CComponentsInfoBox *cc_lic; From db6fa1f5eb5b7beaa9d49ce1925fca076ecc8359 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 1 Feb 2014 01:51:03 +0100 Subject: [PATCH 11/67] CTimerList: Fix commit 5503a94 (THX Houdini) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a60d320aad0416ac5f63628bd3de5b889fcf1567 Author: Michael Liebmann Date: 2014-02-01 (Sat, 01 Feb 2014) --- src/gui/timerlist.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 3db880fe1..ee78b7b10 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1223,7 +1223,11 @@ int CTimerList::newTimer() CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew.message, &timerSettings_msg ); strcpy(timerNew.pluginName,"---"); - CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL | CPlugins::P_TYPE_LUA, timerNew.pluginName); + CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL +#if ENABLE_LUA + | CPlugins::P_TYPE_LUA +#endif + , timerNew.pluginName); CMenuForwarder *m10 = new CMenuForwarder(LOCALE_TIMERLIST_PLUGIN, false, timerNew.pluginName, &plugin_chooser); From fc1b332cc7ae6d915d3f1149db982ceb67b268b1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 1 Feb 2014 13:59:06 +0100 Subject: [PATCH 12/67] CTimerd:: enlarge recorddir and pluginname size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/31221edc4778d423c8ec08bda4b21302f702fd67 Author: Jacek Jendrzej Date: 2014-02-01 (Sat, 01 Feb 2014) --- lib/timerdclient/timerdtypes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index a57a2009f..9ec69b56c 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -33,9 +33,9 @@ #include #define REMINDER_MESSAGE_MAXLEN 31 -#define EXEC_PLUGIN_NAME_MAXLEN 31 -#define RECORD_DIR_MAXLEN 100 -#define EPG_TITLE_MAXLEN 50 +#define EXEC_PLUGIN_NAME_MAXLEN 256 +#define RECORD_DIR_MAXLEN 1024 +#define EPG_TITLE_MAXLEN 51 #define TIMERD_APIDS_CONF 0x00 #define TIMERD_APIDS_STD 0x01 From 530d403ee0e62d412325f676cf9a498719d4049c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Feb 2014 09:08:21 +0100 Subject: [PATCH 13/67] plugins: type for listed plugins on blue key is selectable * add mainmenu items for tools and lua-extensions (default not visible) * add usermenu items for tools and lua-extensions (default off) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9ad30f1831ad883a4459a7cb64dabe1a8c0b0b0 Author: vanhofen Date: 2014-02-04 (Tue, 04 Feb 2014) Origin message was: ------------------ - plugins: type for listed plugins on blue key is selectable * add mainmenu items for tools and lua-extensions (default not visible) * add usermenu items for tools and lua-extensions (default off) --- data/locale/deutsch.locale | 5 +++++ data/locale/english.locale | 5 +++++ src/gui/personalize.cpp | 11 ++++++++++- src/gui/pluginlist.cpp | 7 ++++--- src/gui/plugins.cpp | 2 +- src/gui/plugins.h | 1 - src/gui/user_menue.cpp | 27 +++++++++++++++++++++++---- src/gui/user_menue_setup.cpp | 4 +++- src/neutrino_menue.cpp | 14 ++++++++++++++ src/system/locals.h | 5 +++++ src/system/locals_intern.h | 5 +++++ src/system/settings.cpp | 4 ++++ src/system/settings.h | 6 ++++++ 13 files changed, 85 insertions(+), 11 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index aceeebc7d..16b0bc559 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -740,6 +740,7 @@ mainmenu.channels Kanalliste mainmenu.clearsectionsd Lösche EPG Cache mainmenu.games Spiele mainmenu.head Hauptmenü +mainmenu.lua Lua-Erweiterungen mainmenu.media Multimedia mainmenu.movieplayer Movieplayer mainmenu.pausesectionsd EPG auslesen @@ -756,6 +757,7 @@ mainmenu.shutdown Ausschalten mainmenu.shutdown_menu Ausschalt Optionen mainmenu.sleeptimer SleepTimer mainmenu.standby Standby +mainmenu.tools Werkzeuge mainmenu.tvmode TV-Modus mainmenu.tvradio_switch TV-Radio Umschaltung mainsettings.audio Audio @@ -953,6 +955,7 @@ menu.hint_leds_record Definiert, ob die Power-LEDs blinken sollen, wenn eine Auf menu.hint_leds_standby Definiert den Status der Power-LEDs im Standby menu.hint_leds_tv Definiert den Status der Power-LEDs im TV-Modus menu.hint_load Laden der Neutrino-HD-Einstellungen aus einer Datei +menu.hint_lua Lua-Erweiterungen ausführen menu.hint_make_hdlist Bei aktiver Option wird ein Bouquet namens 'HD' erzeugt, in dem alle HD-Sender zusammengefasst sind menu.hint_make_newlist Nach einer Kanalsuche wird ein Bouquet namens 'neue Kanäle' erzeugt menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelöschte Kanäle' erzeugt @@ -1165,6 +1168,7 @@ menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus +menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um menu.hint_vfd Frontdisplay und Power-LEDs @@ -1607,6 +1611,7 @@ personalize.pinhint Personalisierungs PIN Code eingeben personalize.pinprotect ja personalize.pinstatus mit PIN personalize.plugins Plugins +personalize.usermenu_plugin_type Plugin Typ personalize.usermenu_preferred_buttons Bevorzugte Tasten zuweisen personalize.usermenu_show_cancel Zeige Schalter "Abbrechen" personalize.visible sichtbar diff --git a/data/locale/english.locale b/data/locale/english.locale index 3b64a8549..66a2baca5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -740,6 +740,7 @@ mainmenu.channels Channels mainmenu.clearsectionsd Clear EPG Cache mainmenu.games Games mainmenu.head Main Menu +mainmenu.lua Lua extensions mainmenu.media Media mainmenu.movieplayer Movieplayer mainmenu.pausesectionsd Read EPG @@ -756,6 +757,7 @@ mainmenu.shutdown Shutdown (deep standby) mainmenu.shutdown_menu Shutdown mainmenu.sleeptimer SleepTimer mainmenu.standby Standby +mainmenu.tools Tools mainmenu.tvmode TV-Mode mainmenu.tvradio_switch TV-Radio Switch mainsettings.audio Audio @@ -953,6 +955,7 @@ menu.hint_leds_record LEDs state when box recording menu.hint_leds_standby LEDs state in soft-standby mode menu.hint_leds_tv Working LEDs state menu.hint_load Load Neutrino-HD GUI settings from file +menu.hint_lua Run Lua extensions menu.hint_make_hdlist Auto-create HD channel list based on\nchannel type and name menu.hint_make_newlist Create list of recently added channels menu.hint_make_removedlist Create list of recently removed channels @@ -1165,6 +1168,7 @@ menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone +menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode menu.hint_vfd Frontpanel LEDS, VFD options @@ -1607,6 +1611,7 @@ personalize.pinhint Enter the Personalization PIN Code personalize.pinprotect Yes personalize.pinstatus Require PIN personalize.plugins Plugins +personalize.usermenu_plugin_type Plugin type personalize.usermenu_preferred_buttons Assigning of preferred keys personalize.usermenu_show_cancel Show "Cancel"-Button personalize.visible Visible diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index f8c9b2584..e5fda5015 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -195,7 +195,14 @@ const CMenuOptionChooser::keyval PERSONALIZE_PROTECT_MODE_OPTIONS[CPersonalizeGu { CPersonalizeGui::PERSONALIZE_PROTECT_MODE_PIN_PROTECTED , LOCALE_PERSONALIZE_PINPROTECT },// The menu/option is protected by a PIN }; - +#define PERSONALIZE_UMENU_PLUGIN_TYPE_MAX 4 +const CMenuOptionChooser::keyval PERSONALIZE_UMENU_PLUGIN_TYPE[PERSONALIZE_UMENU_PLUGIN_TYPE_MAX] = +{ + { CPlugins::P_TYPE_GAME , LOCALE_MAINMENU_GAMES }, + { CPlugins::P_TYPE_TOOL , LOCALE_MAINMENU_TOOLS }, + { CPlugins::P_TYPE_SCRIPT , LOCALE_MAINMENU_SCRIPTS }, + { CPlugins::P_TYPE_LUA , LOCALE_MAINMENU_LUA } +}; CPersonalizeGui::CPersonalizeGui() : CPINProtection(g_settings.personalize_pincode) { @@ -453,6 +460,8 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(GenericMenuSeparatorLine); + p_widget->addItem(GenericMenuSeparator); + p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPE, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE], PERSONALIZE_UMENU_PLUGIN_TYPE, PERSONALIZE_UMENU_PLUGIN_TYPE_MAX, true)); p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); } diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 450f6219f..879b2cb2b 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -134,6 +134,8 @@ int CPluginList::exec(CMenuTarget* parent, const std::string & /*actionKey*/) tmp->number = count; tmp->name = g_PluginList->getName(count); tmp->desc = g_PluginList->getDescription(count); + if (tmp->desc == "") + tmp->desc = "---"; pluginlist.push_back(tmp); } } @@ -310,7 +312,7 @@ void CPluginList::paintHead() if (pluginlisttype == CPlugins::P_TYPE_GAME) header.setIcon(NEUTRINO_ICON_GAMES); - else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) + else header.setIcon(NEUTRINO_ICON_SHELL); header.paint(CC_SAVE_SCREEN_NO); @@ -356,11 +358,10 @@ void CPluginList::paintItems() CPluginList::result_ CPluginList::pluginSelected() { + hide(); g_PluginList->startPlugin(pluginlist[selected]->number,0); if (!g_PluginList->getScriptOutput().empty()) { - hide(); - //ShowMsg(LOCALE_PLUGINS_RESULT, Latin1_to_UTF8(g_PluginList->getScriptOutput()), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); } paint(); diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 5573204cb..439a5f7c5 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -134,7 +134,7 @@ void CPlugins::scanDir(const char *dir) else if (new_plugin.type == CPlugins::P_TYPE_LUA) new_plugin.pluginfile.append(".lua"); #endif - else + else // CPlugins::P_TYPE_GAME or CPlugins::P_TYPE_TOOL new_plugin.pluginfile.append(".so"); // We do not check if new_plugin.pluginfile exists since .cfg in // PLUGINDIR_VAR can overwrite settings in read only dir diff --git a/src/gui/plugins.h b/src/gui/plugins.h index 349219ec7..ac7f15089 100644 --- a/src/gui/plugins.h +++ b/src/gui/plugins.h @@ -52,7 +52,6 @@ class CPlugins P_TYPE_GAME = 0x2, P_TYPE_TOOL = 0x4, P_TYPE_SCRIPT = 0x8 - #if ENABLE_LUA , P_TYPE_LUA = 0x10 diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 7f786b82c..7a1ce177f 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -123,7 +123,11 @@ bool CUserMenu::showUserMenu(int button) CDBoxInfoWidget *boxinfo = NULL; CNeutrinoApp * neutrino = NULL; CPluginList * games = NULL; + CPluginList * tools = NULL; CPluginList * scripts = NULL; +#if ENABLE_LUA + CPluginList * lua = NULL; +#endif std::string txt = g_settings.usermenu_text[button]; neutrino_locale_t caption = user_menu[button].caption; @@ -294,6 +298,14 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, games, "-1", key, icon ); menu->addItem(menu_item, false); break; + case SNeutrinoSettings::ITEM_TOOLS: + menu_items++; + menu_prev = SNeutrinoSettings::ITEM_TOOLS; + tools = new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL); + keyhelper.get(&key,&icon); + menu_item = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, tools, "-1", key, icon ); + menu->addItem(menu_item, false); + break; case SNeutrinoSettings::ITEM_SCRIPTS: menu_items++; menu_prev = SNeutrinoSettings::ITEM_SCRIPTS; @@ -302,17 +314,24 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, scripts, "-1", key, icon ); menu->addItem(menu_item, false); break; +#if ENABLE_LUA + case SNeutrinoSettings::ITEM_LUA: + menu_items++; + menu_prev = SNeutrinoSettings::ITEM_LUA; + lua = new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA); + keyhelper.get(&key,&icon); + menu_item = new CMenuForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, lua, "-1", key, icon ); + menu->addItem(menu_item, false); + break; +#endif case SNeutrinoSettings::ITEM_PLUGIN: { char id[5]; int cnt = 0; for (unsigned int count = 0; count < (unsigned int) g_PluginList->getNumberOfPlugins(); count++) { - bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL; + bool show = g_PluginList->getType(count) == g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE]; -#if ENABLE_LUA - show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; -#endif if (show && !g_PluginList->isHidden(count)) { sprintf(id, "%d", count); diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 967b5666b..539065c2e 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -89,7 +89,9 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS }, { SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD }, { SNeutrinoSettings::ITEM_YOUTUBE, LOCALE_MOVIEPLAYER_YTPLAYBACK }, - { SNeutrinoSettings::ITEM_FILEPLAY, LOCALE_MOVIEPLAYER_FILEPLAYBACK } + { SNeutrinoSettings::ITEM_FILEPLAY, LOCALE_MOVIEPLAYER_FILEPLAYBACK }, + { SNeutrinoSettings::ITEM_TOOLS, LOCALE_MAINMENU_TOOLS }, + { SNeutrinoSettings::ITEM_LUA, LOCALE_MAINMENU_LUA } }; int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &) diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 3caad3e5c..b6461901b 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -195,11 +195,25 @@ void CNeutrinoApp::InitMenuMain() mf->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_GAMES]); + //tools + bool show_tools = g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL); + mf = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, show_tools, NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL)); + mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_TOOLS); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TOOLS]); + //scripts bool show_scripts = g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT); mf = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, show_scripts, NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SCRIPTS]); + +#if ENABLE_LUA + //lua + bool show_lua = g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA); + mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_lua, NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA)); + mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); +#endif } //separator diff --git a/src/system/locals.h b/src/system/locals.h index f9079ba73..008ca1026 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -767,6 +767,7 @@ typedef enum LOCALE_MAINMENU_CLEARSECTIONSD, LOCALE_MAINMENU_GAMES, LOCALE_MAINMENU_HEAD, + LOCALE_MAINMENU_LUA, LOCALE_MAINMENU_MEDIA, LOCALE_MAINMENU_MOVIEPLAYER, LOCALE_MAINMENU_PAUSESECTIONSD, @@ -783,6 +784,7 @@ typedef enum LOCALE_MAINMENU_SHUTDOWN_MENU, LOCALE_MAINMENU_SLEEPTIMER, LOCALE_MAINMENU_STANDBY, + LOCALE_MAINMENU_TOOLS, LOCALE_MAINMENU_TVMODE, LOCALE_MAINMENU_TVRADIO_SWITCH, LOCALE_MAINSETTINGS_AUDIO, @@ -980,6 +982,7 @@ typedef enum LOCALE_MENU_HINT_LEDS_STANDBY, LOCALE_MENU_HINT_LEDS_TV, LOCALE_MENU_HINT_LOAD, + LOCALE_MENU_HINT_LUA, LOCALE_MENU_HINT_MAKE_HDLIST, LOCALE_MENU_HINT_MAKE_NEWLIST, LOCALE_MENU_HINT_MAKE_REMOVEDLIST, @@ -1192,6 +1195,7 @@ typedef enum LOCALE_MENU_HINT_TIMEOUTS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, + LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_VFD, @@ -1634,6 +1638,7 @@ typedef enum LOCALE_PERSONALIZE_PINPROTECT, LOCALE_PERSONALIZE_PINSTATUS, LOCALE_PERSONALIZE_PLUGINS, + LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPE, LOCALE_PERSONALIZE_USERMENU_PREFERRED_BUTTONS, LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, LOCALE_PERSONALIZE_VISIBLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index c40f74378..75aff6eb0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -767,6 +767,7 @@ const char * locale_real_names[] = "mainmenu.clearsectionsd", "mainmenu.games", "mainmenu.head", + "mainmenu.lua", "mainmenu.media", "mainmenu.movieplayer", "mainmenu.pausesectionsd", @@ -783,6 +784,7 @@ const char * locale_real_names[] = "mainmenu.shutdown_menu", "mainmenu.sleeptimer", "mainmenu.standby", + "mainmenu.tools", "mainmenu.tvmode", "mainmenu.tvradio_switch", "mainsettings.audio", @@ -980,6 +982,7 @@ const char * locale_real_names[] = "menu.hint_leds_standby", "menu.hint_leds_tv", "menu.hint_load", + "menu.hint_lua", "menu.hint_make_hdlist", "menu.hint_make_newlist", "menu.hint_make_removedlist", @@ -1192,6 +1195,7 @@ const char * locale_real_names[] = "menu.hint_timeouts", "menu.hint_timers", "menu.hint_timezone", + "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", "menu.hint_vfd", @@ -1634,6 +1638,7 @@ const char * locale_real_names[] = "personalize.pinprotect", "personalize.pinstatus", "personalize.plugins", + "personalize.usermenu_plugin_type", "personalize.usermenu_preferred_buttons", "personalize.usermenu_show_cancel", "personalize.visible", diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 63e96586a..42bb69cd1 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -47,7 +47,9 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE {"personalize_media" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, {"personalize_games" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, + {"personalize_tools" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, {"personalize_scripts" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, + {"personalize_lua" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, {"personalize_settings" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_service" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_sleeptimer" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, @@ -101,6 +103,8 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE {"personalize_feat_key_vtxt" , CPersonalizeGui::PERSONALIZE_FEAT_KEY_BLUE}, {"personalize_feat_key_rclock" , CPersonalizeGui::PERSONALIZE_FEAT_KEY_AUTO}, + //plugin type + {"personalize_usermenu_plugin_type" , CPlugins::P_TYPE_TOOL }, //user menu {"personalize_usermenu_show_cancel" , true}, }; diff --git a/src/system/settings.h b/src/system/settings.h index 042fe5112..3710a2e90 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -177,7 +177,9 @@ struct SNeutrinoSettings P_MAIN_MEDIA, P_MAIN_GAMES, + P_MAIN_TOOLS, P_MAIN_SCRIPTS, + P_MAIN_LUA, P_MAIN_SETTINGS, P_MAIN_SERVICE, P_MAIN_SLEEPTIMER, @@ -231,6 +233,8 @@ struct SNeutrinoSettings P_FEAT_KEY_VTXT, P_FEAT_KEY_RC_LOCK, + //plugins type + P_UMENU_PLUGIN_TYPE, //user menu P_UMENU_SHOW_CANCEL, @@ -658,6 +662,8 @@ struct SNeutrinoSettings ITEM_SCRIPTS = 21, ITEM_YOUTUBE = 22, ITEM_FILEPLAY = 23, + ITEM_TOOLS = 24, + ITEM_LUA = 25, ITEM_MAX // MUST be always the last in the list } USER_ITEM; std::string usermenu_text[BUTTON_MAX]; From 7e896426201f45afa04bd45ce2d83c255916c4c8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Feb 2014 17:33:41 +0400 Subject: [PATCH 14/67] zapit/include/zapit/frontend_c.h: prevent setTsidOnid() to change current transponder id on locked frontend: fix case when PiP started while no live channel running (ie playback mode), return to live playback mode can break running recording Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b992366b1cbf8021c00f7fd382b7d54c4669568a Author: [CST] Focus Date: 2014-02-04 (Tue, 04 Feb 2014) --- src/zapit/include/zapit/frontend_c.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 957d0cbb3..1ff0e8b3a 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -225,7 +225,11 @@ class CFrontend return (currentTransponder.TP_id == 0) || (tpid == currentTransponder.TP_id); } - void setTsidOnid(transponder_id_t newid) { currentTransponder.TP_id = newid; } + void setTsidOnid(transponder_id_t newid) + { + if (!usecount) + currentTransponder.TP_id = newid; + } uint32_t getRate (); void Lock(); From 54aaa74a3fd3eedee444cb60e3bdb191709fa328 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Feb 2014 17:38:31 +0400 Subject: [PATCH 15/67] zapit/src/zapit.cpp: there is case when unlocking live playback can fail due to all frontends busy and zap back to live channel not possible. Send CZapitClient::EVT_ZAP_FAILED to notify neutrino Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e68b207154b263eb84793cd82bf3e73d8e6f285c Author: [CST] Focus Date: 2014-02-04 (Tue, 04 Feb 2014) --- src/zapit/src/zapit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index f09d76532..110a6e700 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1632,7 +1632,8 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) SendPMT(); } else { live_fe->setTsidOnid(0); - ZapIt(lock_channel_id); + if (!ZapIt(lock_channel_id)) + SendEvent(CZapitClient::EVT_ZAP_FAILED, &lock_channel_id, sizeof(lock_channel_id)); lock_channel_id = 0; } From 4a43f8b4d1e914054f58a2983a198c08c6eb909d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Feb 2014 17:41:58 +0400 Subject: [PATCH 16/67] gui/infoviewer.cpp: restore channel id in showMovieTitle(), else infoviewer do not process some events after playback stop Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e8be660b0908dcc024a14ecaf686bcf497b1a381 Author: [CST] Focus Date: 2014-02-04 (Tue, 04 Feb 2014) --- src/gui/infoviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 072e7288c..1c13e020c 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -504,6 +504,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe infoViewerBB->is_visible = true; ChannelName = Channel; + t_channel_id old_channel_id = channel_id; channel_id = Channel_Id; /* showChannelLogo() changes this, so better reset it every time... */ @@ -583,6 +584,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe loop(show_dot); aspectRatio = 0; fileplay = 0; + channel_id = old_channel_id; } void CInfoViewer::reset_allScala() From 540ddff6f15e87dde5368d606657589a4dcca169 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 1 Feb 2014 05:46:25 +0100 Subject: [PATCH 17/67] CLuaInstance::MessageboxExec: Fix align Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7d88327dbc92a20faf29db64d4ecc42bf506ae16 Author: Michael Liebmann Date: 2014-02-01 (Sat, 01 Feb 2014) --- src/gui/luainstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 03d014a65..af5a166af 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1195,7 +1195,7 @@ int CLuaInstance::MessageboxExec(lua_State *L) const char *val = lua_tostring(L, -2); table_key mb[] = { { "center1", CMessageBox::mbBtnAlignCenter1 }, - { "center2", CMessageBox::mbBtnAlignCenter1 }, + { "center2", CMessageBox::mbBtnAlignCenter2 }, { "left", CMessageBox::mbBtnAlignLeft }, { "right", CMessageBox::mbBtnAlignRight }, { NULL, 0 } From 75ad4b299c113ed00e20f232f7daf2fe2e1c844f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 1 Feb 2014 13:21:58 +0100 Subject: [PATCH 18/67] src/gui/widget/icons.h: Add missing NEUTRINO_ICON_BLUE Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1766553c56068fc41db4cc75c4fa0b098ad6bc96 Author: Michael Liebmann Date: 2014-02-01 (Sat, 01 Feb 2014) --- src/gui/widget/icons.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 772528232..1461a7fcc 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -75,6 +75,7 @@ #define NEUTRINO_ICON_BUTTON_PLUS "plus" #define NEUTRINO_ICON_BUTTON_MINUS "minus" +#define NEUTRINO_ICON_BLUE "icon_blue" #define NEUTRINO_ICON_GREEN "icon_green" #define NEUTRINO_ICON_RED "icon_red" #define NEUTRINO_ICON_YELLOW "icon_yellow" From 8d223494f01ed14353b5340c055ceb57f27c5c60 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 4 Feb 2014 15:00:57 +0100 Subject: [PATCH 19/67] CLuaInstance::MenuAddItem: Fix neutrino segfault at (type == "chooser") when options in lua script broken Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6dada97564cd1e9307a09969ccb0eb588fdf9b1a Author: Michael Liebmann Date: 2014-02-04 (Tue, 04 Feb 2014) --- src/gui/luainstance.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index af5a166af..96a9f0aa1 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -934,6 +934,10 @@ int CLuaInstance::MenuAddItem(lua_State *L) options_count++; } lua_pop(L, 1); + if (options_count == 0) { + m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "ERROR! (options_count)", NONEXISTANT_LOCALE)); + return 0; + } CMenuOptionChooser::keyval_ext *kext = (CMenuOptionChooser::keyval_ext *)calloc(options_count, sizeof(CMenuOptionChooser::keyval_ext)); m->tofree.push_back(kext); From 2b8776368d7e402385cd46ef1327d86801c5d6aa Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Feb 2014 19:24:41 +0100 Subject: [PATCH 20/67] paintButtons: fix alternative button text size Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e9725e393e8c1075b322256101599687b0ede23c Author: Jacek Jendrzej Date: 2014-02-04 (Tue, 04 Feb 2014) --- src/gui/widget/buttons.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 0143c6d76..0d52a4406 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -139,7 +139,10 @@ int paintButtons( const int &x, if (content[i].locale) { buttontext[i] = g_Locale->getText(content[i].locale); //text width - fwidth[i] = font->getRenderWidth(buttontext[i], true); + if (alt_buttontext != NULL && i == buttontext_id) + fwidth[i] = font->getRenderWidth(alt_buttontext, true); //...with an alternate buttontext + else + fwidth[i] = font->getRenderWidth(buttontext[i], true); w_text += fwidth[i]; count_labels++; } else { From b91133af929e9daebc236195b54149826cbdbbce Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Feb 2014 19:32:06 +0100 Subject: [PATCH 21/67] epgview.cpp: -add adzap Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3818875a80e35d7e7344bcdc348909e3af771f3f Author: Jacek Jendrzej Date: 2014-02-04 (Tue, 04 Feb 2014) --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/epgview.cpp | 67 +++++++++++++++++++++++++++++--------- src/gui/epgview.h | 3 +- src/neutrino.cpp | 3 ++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 8 files changed, 61 insertions(+), 17 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 16b0bc559..5e9d660d0 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 Kochen GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt +adzap Werbezapper apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark diff --git a/data/locale/english.locale b/data/locale/english.locale index 66a2baca5..e666ec168 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 cooking GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown +adzap AdZap apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 7e687d5d6..4cadb4fd5 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -435,19 +437,25 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) { return a.startTime< b.startTime; } - +bool CEpgData::isCurrentEPG(const t_channel_id channel_id) +{ + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(( epg_done!= -1 ) && live_channel_id == channel_id){ + return true; + } + return false; +} int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; - static uint64_t id; - static time_t startzeit; + static uint64_t id = 0; + static time_t startzeit = 0; call_fromfollowlist = callFromfollowlist; if (a_startzeit) startzeit=*a_startzeit; id=a_id; - int height; - height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); GetEPGData(channel_id, id, &startzeit ); if (doLoop) @@ -469,7 +477,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); return res; } - // Calculate offset for the title when logo appears. int pic_offx = 0; std::string lname; @@ -644,10 +651,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - + bool wzap = isCurrentEPG(channel_id); // show Timer Event Buttons - showTimerEventBar (true); - + showTimerEventBar (true,wzap); + //show Content&Component for Dolby & 16:9 int dummy_h,dummy_w; frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); @@ -775,6 +782,22 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start else showText(showPos, sy + toph); break; + case CRCInput::RC_page_up: + if(isCurrentEPG(channel_id)){ + g_settings.wzap_time++; + if(g_settings.wzap_time>9) + g_settings.wzap_time = 9; + showTimerEventBar(true, true); + } + break; + case CRCInput::RC_page_down: + if(isCurrentEPG(channel_id)){ + g_settings.wzap_time--; + if(g_settings.wzap_time<0) + g_settings.wzap_time = 0; + showTimerEventBar(true, true); + } + break; // 31.05.2002 dirch record timer case CRCInput::RC_red: @@ -862,12 +885,19 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start { //CTimerdClient timerdclient; if (g_Timerd->isTimerdAvailable()) - { - g_Timerd->addZaptoTimerEvent(channel_id, + { + if(g_settings.wzap_time && isCurrentEPG(channel_id)){ + g_Timerd->addZaptoTimerEvent(channel_id, + time (NULL) + (g_settings.wzap_time * 60), + 0, 0, + 0, 0, 0); + }else{ + g_Timerd->addZaptoTimerEvent(channel_id, epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + } timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else @@ -1130,7 +1160,7 @@ const struct button_label EpgButtons[] = }; -void CEpgData::showTimerEventBar (bool pshow) +void CEpgData::showTimerEventBar (bool pshow, bool webzap) { int x,y,h,fh; @@ -1150,13 +1180,18 @@ void CEpgData::showTimerEventBar (bool pshow) return; } frameBuffer->paintBoxRel(sx,y,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);//round - /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + std::string tmp_but_name; + if(g_settings.wzap_time && webzap){ + tmp_but_name = g_Locale->getText(LOCALE_ADZAP); + tmp_but_name += " "+ to_string(g_settings.wzap_time) + " "; + tmp_but_name += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),1); else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),0); #if 0 // Button: Timer Record & Channelswitch diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 7492a79b3..c15b00f5d 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -87,7 +87,8 @@ class CEpgData void showText( int startPos, int ypos ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); - void showTimerEventBar(bool show); + void showTimerEventBar(bool show, bool webzap=false); + bool isCurrentEPG(const t_channel_id channel_id); public: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 62fbf6acd..1a7252e03 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -419,6 +419,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); + g_settings.wzap_time = configfile.getInt32("wzap_time", 3 ); + g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); //audio @@ -930,6 +932,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); + configfile.setInt32("wzap_time" , g_settings.wzap_time ); configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); //audio diff --git a/src/system/locals.h b/src/system/locals.h index 008ca1026..fff99ba4c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -123,6 +123,7 @@ typedef enum LOCALE_GENRE_TRAVEL_HOBBIES_6, LOCALE_GENRE_TRAVEL_HOBBIES_7, LOCALE_GENRE_UNKNOWN, + LOCALE_ADZAP, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 75aff6eb0..7700d888d 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -123,6 +123,7 @@ const char * locale_real_names[] = "GENRE.TRAVEL_HOBBIES.6", "GENRE.TRAVEL_HOBBIES.7", "GENRE.UNKNOWN", + "adzap", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", diff --git a/src/system/settings.h b/src/system/settings.h index 3710a2e90..b4aa6ee09 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -95,6 +95,7 @@ struct SNeutrinoSettings int infobar_show_res; int infobar_show_tuner; int infobar_show_dd_available; + int wzap_time; //audio int audio_AnalogMode; int audio_DolbyDigital; From 51d0de467b2c5aed82815b972b480c9d06f9d313 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 5 Feb 2014 12:47:42 +0400 Subject: [PATCH 22/67] eitd/sectionsd.cpp: check myCurrentEvent for expire before using it Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/201022450c1c2745a3b7f4c990ebfbfbd1a4f2d8 Author: [CST] Focus Date: 2014-02-05 (Wed, 05 Feb 2014) --- src/eitd/sectionsd.cpp | 21 +++++++++++++++++++++ src/eitd/sectionsd.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index b4e3bacda..81f1e8646 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2306,6 +2306,24 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve unlockEvents(); } +/* invalidate current/next events, if current event times expired */ +void CEitManager::checkCurrentNextEvent(void) +{ + time_t curtime = time(NULL); + writeLockEvents(); + if (scanning || !myCurrentEvent || myCurrentEvent->times.empty()) { + unlockEvents(); + return; + } + if ((long)(myCurrentEvent->times.begin()->startzeit + myCurrentEvent->times.begin()->dauer) < (long)curtime) { + delete myCurrentEvent; + myCurrentEvent = NULL; + delete myNextEvent; + myNextEvent = NULL; + } + unlockEvents(); +} + /* send back the current and next event for the channel id passed to it * Works like that: * - if the currently running program is requested, return myCurrentEvent and myNextEvent, @@ -2329,6 +2347,8 @@ void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSecti uniqueServiceKey &= 0xFFFFFFFFFFFFULL; + checkCurrentNextEvent(); + readLockEvents(); /* if the currently running program is requested... */ if (uniqueServiceKey == messaging_current_servicekey) { @@ -2587,6 +2607,7 @@ bool CEitManager::getActualEPGServiceKey(const t_channel_id channel_id, CEPGData dprintf("[commandActualEPGchannelID] Request of current EPG for " PRINTF_CHANNEL_ID_TYPE "\n", channel_id); t_channel_id uniqueServiceKey = channel_id & 0xFFFFFFFFFFFFULL; + checkCurrentNextEvent(); readLockEvents(); if (uniqueServiceKey == messaging_current_servicekey) { if (myCurrentEvent) { diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index 3d3d398c1..fd81bc4f7 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -42,6 +42,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex static OpenThreads::Mutex m; static CEitManager * manager; + void checkCurrentNextEvent(void); CEitManager(); /* main thread function */ From 3fcb1867b5972b77311fb4c7637f5beb7320ba5f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 5 Feb 2014 13:08:03 +0400 Subject: [PATCH 23/67] system/helpers.cpp: add code to get hdd standby/active status and flush hdd buffers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/097e05c083a912fd7c21106fb206e86e3b40d524 Author: [CST] Focus Date: 2014-02-05 (Wed, 05 Feb 2014) --- src/system/helpers.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++ src/system/helpers.h | 3 ++ 2 files changed, 76 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 01e76b513..0f00424a6 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -38,6 +38,9 @@ #include #include #include +#include +#include +#include #include #include @@ -611,3 +614,73 @@ bool CFileHelpers::removeDir(const char *Dir) errno = 0; return true; } + +static int hdd_open_dev(const char * fname) +{ + FILE * fp; + struct mntent * mnt; + dev_t dev; + struct stat st; + int fd = -1; + + if (stat(fname, &st) != 0) { + perror(fname); + return fd; + } + + dev = st.st_dev; + fp = setmntent("/proc/mounts", "r"); + if (fp == NULL) { + perror("setmntent"); + return fd; + } + + while ((mnt = getmntent(fp)) != NULL) { + if (stat(mnt->mnt_fsname, &st) != 0) + continue; + if (S_ISBLK(st.st_mode) && st.st_rdev == dev) { + printf("[hdd] file [%s] -> dev [%s]\n", fname, mnt->mnt_fsname); + fd = open(mnt->mnt_fsname, O_RDONLY|O_NONBLOCK); + if (fd < 0) + perror(mnt->mnt_fsname); + break; + } + } + endmntent(fp); + return fd; +} + +bool hdd_get_standby(const char * fname) +{ + bool standby = false; + + int fd = hdd_open_dev(fname); + if (fd >= 0) { + unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; + int ret = ioctl(fd, HDIO_DRIVE_CMD, args); + if (ret) { + args[0] = WIN_CHECKPOWERMODE2; + ret = ioctl(fd, HDIO_DRIVE_CMD, args); + } + if ((ret == 0) && (args[2] != 0xFF)) + standby = true; + + printf("[hdd] %s\n", standby ? "standby" : "active"); + close(fd); + } + return standby; +} + +void hdd_flush(const char * fname) +{ + int fd = hdd_open_dev(fname); + if (fd >= 0) { + printf("[hdd] flush buffers...\n"); + fsync(fd); + if (ioctl(fd, BLKFLSBUF, NULL)) + perror("BLKFLSBUF"); + else + ioctl(fd, HDIO_DRIVE_CMD, NULL); + close(fd); + } +} diff --git a/src/system/helpers.h b/src/system/helpers.h index ed9f191ff..b494a2500 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -43,6 +43,9 @@ void mySleep(int sec); std::string find_executable(const char *name); +bool hdd_get_standby(const char * fname); +void hdd_flush(const char * fname); + std::string getPathName(std::string &path); std::string getBaseName(std::string &path); std::string getFileName(std::string &file); From d6e6c99080279aebed2a25557dfb3473afcf9718 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 5 Feb 2014 13:08:35 +0400 Subject: [PATCH 24/67] driver/record.cpp: try to flush hdd buffers, if hdd is in standby at record start Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3d3e169f1e2d5f47dd0151f46d77a77ba142aff3 Author: [CST] Focus Date: 2014-02-05 (Wed, 05 Feb 2014) --- src/driver/record.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5a4bf3171..088e92e35 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -152,6 +152,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) hintBox.paint(); tsfile = std::string(filename) + ".ts"; + bool standby = hdd_get_standby(Directory.c_str()); printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]); @@ -202,6 +203,8 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } psi.genpsi(fd); + if (standby) + hdd_flush(tsfile.c_str()); #if 0 if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS)) From e15a28753ecdfef9905bc98550b7cd39610253ce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 28 Jan 2014 16:34:17 +0100 Subject: [PATCH 25/67] CComponentsHeader/CComponentsFooter: move footer class into its own file Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7151608c8bceecce7c2db31c985922cf387326ac Author: Thilo Graf Date: 2014-01-28 (Tue, 28 Jan 2014) --- src/gui/components/cc_frm_footer.cpp | 2 +- src/gui/components/cc_frm_footer.h | 53 ++++++++++++++++++++++++++++ src/gui/components/cc_frm_header.h | 30 ++-------------- src/gui/components/cc_frm_window.h | 1 + 4 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 src/gui/components/cc_frm_footer.h diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f03a2f37e..59d5c6154 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -27,7 +27,7 @@ #include #include -#include "cc_frm.h" +#include "cc_frm_footer.h" using namespace std; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h new file mode 100644 index 000000000..dd96a02bd --- /dev/null +++ b/src/gui/components/cc_frm_footer.h @@ -0,0 +1,53 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __CC_FORM_FOOTER_H__ +#define __CC_FORM_FOOTER_H__ + + +#include "cc_frm_header.h" + +/*! +CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer +Is mostly usable like a header but without caption, and context button icons. +*/ +class CComponentsFooter : public CComponentsHeader +{ + protected: + void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + public: + CComponentsFooter(); + CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); +}; + +#endif diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 96b32f9c4..7756b269e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,7 +32,7 @@ //! Sub class of CComponentsForm. Shows a header with prepared items. /*! -CComponentsHeader provides prepared items like icon, caption and context button icons +CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows */ class CComponentsHeader : public CComponentsForm { @@ -176,9 +176,9 @@ class CComponentsHeader : public CComponentsForm virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; -//! Sub class of CComponentsHeader. Shows a header with prepared items. +//! Sub class of CComponentsHeader. /*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons +CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows Caption is defined with locales. */ class CComponentsHeaderLocalized : public CComponentsHeader @@ -194,28 +194,4 @@ class CComponentsHeaderLocalized : public CComponentsHeader fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); }; - -/*! -CComponentsFooter provides prepared container for footer -Is mostly usable like a header but without caption, and context button icons. -*/ -class CComponentsFooter : public CComponentsHeader -{ - protected: - void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - public: - CComponentsFooter(); - CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); -}; - #endif diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 43e22724f..74f26b4d1 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -27,6 +27,7 @@ #include "cc_frm.h" #include "cc_frm_icons.h" #include "cc_frm_header.h" +#include "cc_frm_footer.h" //! Sub class of CComponentsForm. Shows a window with prepared items. /*! From b48decae3a26b74080eecce4ce3a695c862538f6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 30 Jan 2014 17:44:07 +0100 Subject: [PATCH 26/67] CComponentsIconForm: rework constructors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59723d89f0077cc16ada6a52adfd2673f501b521 Author: Thilo Graf Date: 2014-01-30 (Thu, 30 Jan 2014) --- src/gui/components/cc_frm_icons.cpp | 32 ++++++++++++++--------------- src/gui/components/cc_frm_icons.h | 15 ++++++++++---- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/gui/components/cc_frm_icons.cpp b/src/gui/components/cc_frm_icons.cpp index 1092491f2..aa6b84d92 100644 --- a/src/gui/components/cc_frm_icons.cpp +++ b/src/gui/components/cc_frm_icons.cpp @@ -35,36 +35,34 @@ using namespace std; //sub class CComponentsIconForm inherit from CComponentsForm CComponentsIconForm::CComponentsIconForm() { - initVarIconForm(); + initVarIconForm(1, 1, 0, 0, vector()); } - -CComponentsIconForm::CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector &v_icon_names, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +CComponentsIconForm::CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - initVarIconForm(); + initVarIconForm(x_pos, y_pos, w, h, v_icon_names, has_shadow, color_frame, color_body, color_shadow); +} + +void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + cc_item_type = CC_ITEMTYPE_FRM_ICONFORM; x = x_pos; y = y_pos; width = w; height = h; + v_icons = v_icon_names; shadow = has_shadow; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - - v_icons = v_icon_names; -} -void CComponentsIconForm::initVarIconForm() -{ - cc_item_type = CC_ITEMTYPE_FRM_ICONFORM; - - //set default width and height to 0, this causes a dynamic adaptation of width and height of form - width = 0; - height = 0; - - v_icons.clear(); ccif_offset = 2; ccif_icon_align = CC_ICONS_FRM_ALIGN_LEFT; } diff --git a/src/gui/components/cc_frm_icons.h b/src/gui/components/cc_frm_icons.h index c33755719..83b86c5f8 100644 --- a/src/gui/components/cc_frm_icons.h +++ b/src/gui/components/cc_frm_icons.h @@ -25,7 +25,6 @@ #define __CC_FORM_ICONS_H__ #include "cc_frm.h" -#include "cc_frm_icons.h" class CComponentsIconForm : public CComponentsForm { @@ -35,12 +34,20 @@ class CComponentsIconForm : public CComponentsForm void initMaxHeight(int *pheight); protected: - void initVarIconForm(); + void initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); public: CComponentsIconForm(); - CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector &v_icon_names, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); // ~CComponentsIconForm(); //inherited from CComponentsForm void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From 1cc801f9319cf0fa851f9bd923cf8f36a34cab52 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 17:41:29 +0100 Subject: [PATCH 27/67] CComponentsWindow: fix handling of window size On some several cases it's possible that full resulution is not visible on SD output or video-out modes like 576i/p. So it's makes more sense to use current osd-settings for max size and position. This fixes also current behavior of Imageinfo. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d3febd0804eba708e1c8887eeda74684df96cd4 Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/components/cc_frm_window.cpp | 41 ++++++++++++++++++++++------ src/gui/components/cc_frm_window.h | 10 ++++--- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index cdc596f99..48503b6d7 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -80,13 +80,14 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const //CComponentsForm cc_item_type = CC_ITEMTYPE_FRM_WINDOW; - //using current screen settings for default dimensions, do use full screen if default values for width/height = 0 - int w_tmp = frameBuffer->getScreenWidth(w == 0 ? true : false); - int h_tmp = frameBuffer->getScreenHeight(h == 0 ? true : false); - width = w == 0 ? w_tmp : w; - height = h == 0 ? h_tmp : h; - x = x_pos; - y = y_pos; + //using current screen settings for default dimensions, + //do use full screen (from osd-settings) if default values for width/height = 0 + x = x_pos; + y = y_pos; + width = w; + height = h; + initWindowSize(); + initWindowPos(); ccw_caption = caption; ccw_icon_name = iconname; @@ -110,9 +111,31 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const initCCWItems(); } +void CComponentsWindow::initWindowSize() +{ + if (cc_parent) + return; + + if (width == 0) + width = frameBuffer->getScreenWidth(); + if (height == 0) + height = frameBuffer->getScreenHeight(); +} + +void CComponentsWindow::initWindowPos() +{ + if (cc_parent) + return; + + if (x == 0) + x = frameBuffer->getScreenX(); + if (y == 0) + y = frameBuffer->getScreenY(); +} + void CComponentsWindow::doCenter(){ - x = cc_parent ? cc_parent->getWidth() - width/2 : frameBuffer->getScreenWidth(true)/2 - width/2; - y = cc_parent ? cc_parent->getHeight() - height/2 : frameBuffer->getScreenHeight(true)/2 -height/2; + x = cc_parent ? cc_parent->getWidth() - width/2 : getScreenStartX(width); + y = cc_parent ? cc_parent->getHeight() - height/2 : getScreenStartY(height); } void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const int& align_mode) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 74f26b4d1..b3cd34137 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -92,6 +92,10 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///allow centering of window on screen, mostly senseful for window object without parent void doCenter(); + ///initialize width and height + void initWindowSize(); + ///initialize position + void initWindowPos(); public: enum @@ -159,12 +163,10 @@ class CComponentsWindow : public CComponentsForm class CComponentsWindowMax : public CComponentsWindow { public: - ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, position of window is general centered and bound - ///to current screen settings, this shows a window over full screen + ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, this shows a centered window based up current screen settings CComponentsWindowMax(const std::string& caption, const std::string& iconname = ""); - ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, position of window is general centered and bound - ///to current screen settings, this shows a window over full screen + ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings CComponentsWindowMax(neutrino_locale_t locale_caption, const std::string& iconname = ""); }; From 10289e5d369296b4a9395d2cde23cc1943aa32df Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 19:16:58 +0100 Subject: [PATCH 28/67] CComponentsWindowMax: add missing parameters to constructors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9482613d4cd2e18a8c61582200b30175067dcdb6 Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/components/cc_frm_window.cpp | 21 +++++++++++++++++---- src/gui/components/cc_frm_window.h | 12 ++++++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 48503b6d7..b1c207c2a 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -63,11 +63,24 @@ CComponentsWindow::CComponentsWindow( const int& x_pos, const int& y_pos, const initVarWindow(x_pos, y_pos, w, h, caption, iconname, has_shadow, color_frame, color_body, color_shadow); } -CComponentsWindowMax::CComponentsWindowMax(const string& caption, const string& iconname) - :CComponentsWindow(0, 0, 0, 0, caption, iconname){}; +CComponentsWindowMax::CComponentsWindowMax( const string& caption, + const string& iconname, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) + :CComponentsWindow(0, 0, 0, 0, caption, + iconname, has_shadow, color_frame, color_body, color_shadow){}; -CComponentsWindowMax::CComponentsWindowMax(neutrino_locale_t locale_caption, const string& iconname) - :CComponentsWindow(0, 0, 0, 0, locale_caption != NONEXISTANT_LOCALE ? g_Locale->getText(locale_caption) : "", iconname){}; +CComponentsWindowMax::CComponentsWindowMax( neutrino_locale_t locale_caption, + const string& iconname, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) + :CComponentsWindow(0, 0, 0, 0, + locale_caption != NONEXISTANT_LOCALE ? g_Locale->getText(locale_caption) : "", + iconname, has_shadow, color_frame, color_body, color_shadow){}; void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const string& caption, diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index b3cd34137..d658bd090 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -164,10 +164,18 @@ class CComponentsWindowMax : public CComponentsWindow { public: ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, this shows a centered window based up current screen settings - CComponentsWindowMax(const std::string& caption, const std::string& iconname = ""); + CComponentsWindowMax( const std::string& caption, const std::string& iconname = "", + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings - CComponentsWindowMax(neutrino_locale_t locale_caption, const std::string& iconname = ""); + CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "", + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); }; #endif From be04423b305dd8369fd03cef4ee10f73424913b7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 19:34:41 +0100 Subject: [PATCH 29/67] CImageInfo: enable missing window shadow Also revert ff767289608142f16781dfd794e3da1ddfc5694e, Size handling fixed in 533c2cfc5c8aaf4f56fa07828d44ccb03a62efa6 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fb4819ff1483f28dd829478b72ec8c667f576a2b Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/imageinfo.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index e1e71e63f..297334d67 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -181,14 +181,7 @@ void CImageInfo::ShowWindow() { CComponentsFooter *footer = NULL; if (cc_win == NULL){ - CFrameBuffer *frameBuffer = CFrameBuffer::getInstance (); -#if 0 - cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); -#endif - cc_win = new CComponentsWindow(frameBuffer->getScreenX(), frameBuffer->getScreenY(), - frameBuffer->getScreenWidth(), - frameBuffer->getScreenHeight(), - LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); + cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO, CC_SHADOW_ON); cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); footer = cc_win->getFooterObject(); footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); From 753d478e2ccc163b8836e4e55149d4575b0727b8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 19:36:29 +0100 Subject: [PATCH 30/67] CBuildInfo: use member doCenter() for centering window Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/65ef4b4ccf2a35e1ff775a7b4ba24be856a1656c Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/buildinfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 1b9fbff2d..f87554820 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,7 +35,7 @@ using namespace std; -CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo() : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); } @@ -43,8 +43,7 @@ CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_ME //init all var members void CBuildInfo::initVarBuildInfo() { - x = frameBuffer->getScreenWidth(true)/2 - width/2; - y = frameBuffer->getScreenHeight(true)/2 -height/2; + doCenter(); append_v_offset = 1; font = NULL; From b01f32f013c98038e5483f6603cabeda8f010817 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 22:59:57 +0100 Subject: [PATCH 31/67] CBuildInfo: remove append offset Append offset is not required here, even harmful, because parent items (header, body, footer) in the parent object are already adapted. Offset maybe required in body object, but not in the parent window. This fixes also fb remains on the bottom of window after executed hide() in buildinfo object. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/72f3081b9c0de0631f954bb01701588f722e4a9e Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) Origin message was: ------------------ CBuildInfo: remove append offset Append offset is not required here, even harmful, because parent items (header, body, footer) in the parent object are already adapted. Offset maybe required in body object, but not in the parent window. This fixes also fb remains on the bottom of window after executed hide() in buildinfo object. --- src/gui/buildinfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index f87554820..45b87a2c6 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -44,8 +44,7 @@ CBuildInfo::CBuildInfo() : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_ME void CBuildInfo::initVarBuildInfo() { doCenter(); - - append_v_offset = 1; + font = NULL; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); InitInfoItems(); From 1c21514660dc8488e0e0773656d8eaf82c6378bf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 31 Jan 2014 23:11:13 +0100 Subject: [PATCH 32/67] CComponents: remove wrong init value for item position This causes an unnecessary offset and possible fb-remains. This was observed at the header in Imageinfo, but only without shadow. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/57a6c363296698b1403e7fa494e0084a67d37699 Author: Thilo Graf Date: 2014-01-31 (Fri, 31 Jan 2014) --- src/gui/components/cc_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index a2d688000..c9c49528a 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -56,8 +56,8 @@ void CComponents::clearSavedScreen() void CComponents::initVarBasic() { - x = saved_screen.x = 1; - y = saved_screen.y = 1; + x = saved_screen.x = 0; + y = saved_screen.y = 0; cc_xr = x; cc_yr = y; height = saved_screen.dy = CC_HEIGHT_MIN; From c0b74d30e8315f59f0dc68f1989ee927ee2800c1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Feb 2014 09:01:24 +0100 Subject: [PATCH 33/67] CComponentsPicture: show paint mode in debug output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/718824015a0d45c928292cbae75d787d7c4ea10d Author: Thilo Graf Date: 2014-02-03 (Mon, 03 Feb 2014) --- src/gui/components/cc_item_picture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index ea9e661e3..99f41624e 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -181,7 +181,7 @@ void CComponentsPicture::paintPicture() if (do_paint && cc_allow_paint){ #ifdef DEBUG_CC - printf(" [CComponentsPicture] %s: paint image: %s (do_paint=%d)\n", __func__, pic_name.c_str(), do_paint); + printf(" [CComponentsPicture] %s: paint image: %s (do_paint=%d) with mode %d\n", __func__, pic_name.c_str(), do_paint, pic_paint_mode); #endif if (pic_paint_mode == CC_PIC_IMAGE_MODE_OFF) pic_painted = frameBuffer->paintIcon(pic_name, pic_x, pic_y, 0 /*pic_max_h*/, pic_offset, pic_paint, pic_paintBg, col_body); From 83afb37b1197aa7f0f40b8282d62221db4110d44 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Feb 2014 09:41:40 +0100 Subject: [PATCH 34/67] CComponentsPicture: rework constructors, clean ups Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/34fcdec2768e354b9ae50e1ba899275cea57a929 Author: Thilo Graf Date: 2014-02-03 (Mon, 03 Feb 2014) --- src/gui/components/cc_item_picture.cpp | 57 ++++++++++++-------------- src/gui/components/cc_item_picture.h | 46 +++++++++++++-------- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 99f41624e..d1a109b0a 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -40,26 +40,32 @@ using namespace std; //------------------------------------------------------------------------------------------------------- //sub class CComponentsPicture from CComponentsItem -CComponentsPicture::CComponentsPicture( const int x_pos, const int y_pos, const int w, const int h, - const std::string& image_name, const int alignment, bool has_shadow, +CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) { - init(x_pos, y_pos, image_name, alignment, has_shadow, color_frame, color_background, color_shadow); - - width = w; - height = h; - pic_paint_mode = CC_PIC_IMAGE_MODE_AUTO, - - initVarPicture(); + init(x_pos, y_pos, w, h, image_name, alignment, has_shadow, color_frame, color_background, color_shadow); } -void CComponentsPicture::init( int x_pos, int y_pos, const string& image_name, const int alignment, bool has_shadow, +void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, const int &h, const string& image_name, const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) { //CComponents, CComponentsItem cc_item_type = CC_ITEMTYPE_PICTURE; + //CComponents + x = pic_x = x_pos; + y = pic_y = y_pos; + height = h; + width = w; + shadow = has_shadow; + shadow_w = SHADOW_OFFSET; + col_frame = color_frame; + col_body = color_background; + col_shadow = color_shadow; + //CComponentsPicture + pic_paint_mode = CC_PIC_IMAGE_MODE_AUTO, pic_name = image_name; pic_align = alignment; pic_offset = 1; @@ -72,33 +78,24 @@ void CComponentsPicture::init( int x_pos, int y_pos, const string& image_name, c if (pic_name.empty()) pic_width = pic_height = 0; - //CComponents - x = pic_x = x_pos; - y = pic_y = y_pos; - height = 0; - width = 0; - shadow = has_shadow; - shadow_w = SHADOW_OFFSET; - col_frame = color_frame; - col_body = color_background; - col_shadow = color_shadow; + initCCItem(); } void CComponentsPicture::setPicture(const std::string& picture_name) { pic_name = picture_name; - initVarPicture(); + initCCItem(); } void CComponentsPicture::setPictureAlign(const int alignment) { - pic_align = alignment; - initVarPicture(); + pic_align = alignment; + initCCItem(); } -void CComponentsPicture::initVarPicture() +void CComponentsPicture::initCCItem() { pic_width = pic_height = 0; pic_painted = false; @@ -195,7 +192,7 @@ void CComponentsPicture::paintPicture() void CComponentsPicture::paint(bool do_save_bg) { - initVarPicture(); + initCCItem(); paintInit(do_save_bg); paintPicture(); } @@ -207,9 +204,9 @@ void CComponentsPicture::hide(bool no_restore) } -CComponentsChannelLogo::CComponentsChannelLogo( const int x_pos, const int y_pos, const int w, const int h, +CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, const uint64_t& channelId, const std::string& channelName, - const int alignment, bool has_shadow, + const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) :CComponentsPicture(x_pos, y_pos, w, h, "", alignment, has_shadow, @@ -246,11 +243,11 @@ void CComponentsChannelLogo::initVarPictureChannellLogo() if (!has_logo) pic_name = tmp_logo; -// #ifdef DEBUG_CC +#ifdef DEBUG_CC printf("\t[CComponentsChannelLogo] %s: init image: %s (has_logo=%d, channel_id=%" PRIu64 ")\n", __func__, pic_name.c_str(), has_logo, channel_id); -// #endif +#endif - initVarPicture(); + initCCItem(); } void CComponentsChannelLogo::paint(bool do_save_bg) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index dd45ec449..0b2710be9 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -43,9 +43,6 @@ Picture is usable like each other CCItems. class CComponentsPicture : public CComponentsItem { protected: - ///initialize all required attributes - void initVarPicture(); - ///some internal modes for icon and image handling enum { @@ -62,25 +59,36 @@ class CComponentsPicture : public CComponentsItem bool pic_paint, pic_paintBg, pic_painted, do_paint; int pic_align, pic_x, pic_y, pic_width, pic_height; int pic_max_w, pic_max_h, pic_paint_mode; - - void init( const int x_pos, const int y_pos, const std::string& image_name, const int alignment, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow); - + + void init( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, + const int &alignment, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_background, + fb_pixel_t color_shadow); + + ///initialize all required attributes + void initCCItem(); ///initialize position of picture object dependendly from settings void initPosition(); void paintPicture(); - + public: - CComponentsPicture( const int x_pos, const int y_pos, const int w, const int h, - const std::string& image_name, const int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - + CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, + const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + virtual inline void setPictureOffset(const unsigned char offset){pic_offset = offset;}; virtual inline void setPicturePaint(bool paint_p){pic_paint = paint_p;}; virtual inline void setPicturePaintBackground(bool paintBg){pic_paintBg = paintBg;}; virtual void setPicture(const std::string& picture_name); virtual void setPictureAlign(const int alignment); - + virtual inline bool isPicPainted(){return pic_painted;}; virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); virtual void hide(bool no_restore = false); @@ -101,10 +109,14 @@ class CComponentsChannelLogo : public CComponentsPicture, CPictureViewer bool has_logo; public: - CComponentsChannelLogo( const int x_pos, const int y_pos, const int w, const int h, - const uint64_t& channelId =0, const std::string& channelName = "", - const int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, + const uint64_t& channelId =0, + const std::string& channelName = "", + const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); void setChannel(const uint64_t& channelId, const std::string& channelName); void setPicture(const std::string& picture_name); From 6327804c8a4427de518b706840bf684649d8eea2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Feb 2014 10:09:56 +0100 Subject: [PATCH 35/67] CComponentsPicture: add debug output for handled item dimensions and pos Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/14a3546b5fd791c8088c6f3af925dd39a8b6da47 Author: Thilo Graf Date: 2014-02-03 (Mon, 03 Feb 2014) --- src/gui/components/cc_item_picture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index d1a109b0a..94f7af613 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -143,6 +143,11 @@ void CComponentsPicture::initCCItem() int sw = (shadow ? shadow_w :0); width = max(max(pic_width, pic_max_w), width) + sw ; height = max(max(pic_height, pic_max_h), height) + sw ; + +#ifdef DEBUG_CC + printf("[CComponentsPicture] %s initialized Image: ====>> %s\n\titem x = %d\n\tdx = %d (image dx = %d)\n\titem y = %d\n\titem dy = %d (image dy = %d)\n", + __func__, pic_name.c_str(), x, width, pic_width, y, height, pic_height); +#endif } void CComponentsPicture::initPosition() From 0781fc000b890bb9a42f73cef4e6fcc19f686073 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Feb 2014 11:14:52 +0100 Subject: [PATCH 36/67] CComponentsWindow: remove redundant init of header and footer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a6eb67d4567eb7b71788e161715267f91c5e1ca8 Author: Thilo Graf Date: 2014-02-05 (Wed, 05 Feb 2014) --- src/gui/components/cc_frm_window.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index b1c207c2a..de7f91888 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -212,10 +212,6 @@ void CComponentsWindow::initCCWItems() #ifdef DEBUG_CC printf("[CComponentsWindow] [%s - %d] init items...\n", __func__, __LINE__); #endif - initHeader(); - initFooter(); - initBody(); - //add/remove header if required if (ccw_show_header){ initHeader(); @@ -236,6 +232,8 @@ void CComponentsWindow::initCCWItems() } } + initBody(); + //add header, body and footer items only one time if (ccw_head) if (!ccw_head->isAdded()) From e3d12f21e1f9761fe6df0f2aab269e9b2965ffd3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 6 Feb 2014 22:51:18 +0100 Subject: [PATCH 37/67] plugins: type for listed plugins on blue key is more selectable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e97ea955c99f49938ba31376cd0dcb6f262f1195 Author: vanhofen Date: 2014-02-06 (Thu, 06 Feb 2014) Origin message was: ------------------ - plugins: type for listed plugins on blue key is more selectable --- data/locale/deutsch.locale | 3 ++- data/locale/english.locale | 3 ++- src/gui/personalize.cpp | 19 +++++++++---------- src/gui/personalize.h | 1 + src/gui/user_menue.cpp | 17 +++++++++++++---- src/gui/user_menue_setup.cpp | 2 +- src/system/locals.h | 3 ++- src/system/locals_intern.h | 3 ++- src/system/settings.cpp | 8 ++++++-- src/system/settings.h | 10 +++++++--- 10 files changed, 45 insertions(+), 24 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5e9d660d0..6798da110 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1612,7 +1612,7 @@ personalize.pinhint Personalisierungs PIN Code eingeben personalize.pinprotect ja personalize.pinstatus mit PIN personalize.plugins Plugins -personalize.usermenu_plugin_type Plugin Typ +personalize.usermenu_plugin_types Anzuzeigende Plugin-Typen wählen personalize.usermenu_preferred_buttons Bevorzugte Tasten zuweisen personalize.usermenu_show_cancel Zeige Schalter "Abbrechen" personalize.visible sichtbar @@ -1971,6 +1971,7 @@ usermenu.head Benutzermenü usermenu.item_bar ---- Trennung ---- usermenu.item_epg_misc EPG Funktionen usermenu.item_none (frei) +usermenu.item_plugin_types Plugin-Typen usermenu.item_vtxt Teletext usermenu.msg_info_is_empty Es wurde kein Name für dieses Menü vergeben.\nVerwende Standardname:\n usermenu.msg_warning_name Sie haben mehrere Menüpunkte für dieses Menü angelegt,\naber keinen neuen Namen festgelegt.\nEs ist daher empfohlen, einen neuen Namen zu vergeben! diff --git a/data/locale/english.locale b/data/locale/english.locale index e666ec168..5812d0dab 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1612,7 +1612,7 @@ personalize.pinhint Enter the Personalization PIN Code personalize.pinprotect Yes personalize.pinstatus Require PIN personalize.plugins Plugins -personalize.usermenu_plugin_type Plugin type +personalize.usermenu_plugin_types Choose Plugin types to show personalize.usermenu_preferred_buttons Assigning of preferred keys personalize.usermenu_show_cancel Show "Cancel"-Button personalize.visible Visible @@ -1971,6 +1971,7 @@ usermenu.head User menu usermenu.item_bar ---- Boarder ---- usermenu.item_epg_misc EPG functions usermenu.item_none (empty) +usermenu.item_plugin_types Plugin types usermenu.item_vtxt Videotext usermenu.msg_info_is_empty You don't have definied a name for this menu!\nUsing default name:\n usermenu.msg_warning_name You have more than one items created for this menu,\nbut none new name for this menue defined.\nIt is recommended to enter a new name! diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index e5fda5015..9aaac7edf 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -195,15 +195,6 @@ const CMenuOptionChooser::keyval PERSONALIZE_PROTECT_MODE_OPTIONS[CPersonalizeGu { CPersonalizeGui::PERSONALIZE_PROTECT_MODE_PIN_PROTECTED , LOCALE_PERSONALIZE_PINPROTECT },// The menu/option is protected by a PIN }; -#define PERSONALIZE_UMENU_PLUGIN_TYPE_MAX 4 -const CMenuOptionChooser::keyval PERSONALIZE_UMENU_PLUGIN_TYPE[PERSONALIZE_UMENU_PLUGIN_TYPE_MAX] = -{ - { CPlugins::P_TYPE_GAME , LOCALE_MAINMENU_GAMES }, - { CPlugins::P_TYPE_TOOL , LOCALE_MAINMENU_TOOLS }, - { CPlugins::P_TYPE_SCRIPT , LOCALE_MAINMENU_SCRIPTS }, - { CPlugins::P_TYPE_LUA , LOCALE_MAINMENU_LUA } -}; - CPersonalizeGui::CPersonalizeGui() : CPINProtection(g_settings.personalize_pincode) { width = 0; @@ -461,8 +452,16 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(GenericMenuSeparatorLine); p_widget->addItem(GenericMenuSeparator); - p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPE, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE], PERSONALIZE_UMENU_PLUGIN_TYPE, PERSONALIZE_UMENU_PLUGIN_TYPE_MAX, true)); p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + + pluginSelectionMenu = new CMenuWidget(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, NEUTRINO_ICON_SETTINGS); + pluginSelectionMenu->addIntroItems(LOCALE_MAINMENU_SETTINGS); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_GAMES, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_TOOLS, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_SCRIPTS, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_LUA, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + + p_widget->addItem(new CMenuForwarder(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, true, NULL, pluginSelectionMenu)); } diff --git a/src/gui/personalize.h b/src/gui/personalize.h index cb537d4b4..817176cb9 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -146,6 +146,7 @@ class CPersonalizeGui : public CMenuTarget, public CChangeObserver, public CPINP CMenuWidget* fkeyMenu; CMenuWidget* plMenu; CMenuWidget* tmpW; + CMenuWidget *pluginSelectionMenu; int width, widget_count, shortcut, options_count; bool show_usermenu, show_pin_setup; diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 7a1ce177f..e76c25ee5 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -324,25 +324,34 @@ bool CUserMenu::showUserMenu(int button) menu->addItem(menu_item, false); break; #endif - case SNeutrinoSettings::ITEM_PLUGIN: + case SNeutrinoSettings::ITEM_PLUGIN_TYPES: { char id[5]; int cnt = 0; for (unsigned int count = 0; count < (unsigned int) g_PluginList->getNumberOfPlugins(); count++) { - bool show = g_PluginList->getType(count) == g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE]; + bool show = false; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_GAME; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_SCRIPT; +#if ENABLE_LUA + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; +#endif if (show && !g_PluginList->isHidden(count)) { sprintf(id, "%d", count); menu_items++; - menu_prev = SNeutrinoSettings::ITEM_PLUGIN; + menu_prev = SNeutrinoSettings::ITEM_PLUGIN_TYPES; neutrino_msg_t d_key = g_PluginList->getKey(count); //printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count)); StreamFeaturesChanger = new CStreamFeaturesChangeExec(); keyhelper.get(&key,&icon, d_key); menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, StreamFeaturesChanger, id, key, icon); - menu->addItem(menu_item, 0); cnt++; } diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 539065c2e..2c7ae6de2 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -79,7 +79,7 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN { SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD }, { SNeutrinoSettings::ITEM_FAVORITS, LOCALE_FAVORITES_MENUEADD }, { SNeutrinoSettings::ITEM_TECHINFO, LOCALE_EPGMENU_STREAMINFO }, - { SNeutrinoSettings::ITEM_PLUGIN, LOCALE_TIMERLIST_PLUGIN }, + { SNeutrinoSettings::ITEM_PLUGIN_TYPES, LOCALE_USERMENU_ITEM_PLUGIN_TYPES }, { SNeutrinoSettings::ITEM_VTXT, LOCALE_USERMENU_ITEM_VTXT }, { SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO }, { SNeutrinoSettings::ITEM_BOXINFO, LOCALE_EXTRA_DBOXINFO }, diff --git a/src/system/locals.h b/src/system/locals.h index fff99ba4c..3e94dbda8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1639,7 +1639,7 @@ typedef enum LOCALE_PERSONALIZE_PINPROTECT, LOCALE_PERSONALIZE_PINSTATUS, LOCALE_PERSONALIZE_PLUGINS, - LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPE, + LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, LOCALE_PERSONALIZE_USERMENU_PREFERRED_BUTTONS, LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, LOCALE_PERSONALIZE_VISIBLE, @@ -1998,6 +1998,7 @@ typedef enum LOCALE_USERMENU_ITEM_BAR, LOCALE_USERMENU_ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_NONE, + LOCALE_USERMENU_ITEM_PLUGIN_TYPES, LOCALE_USERMENU_ITEM_VTXT, LOCALE_USERMENU_MSG_INFO_IS_EMPTY, LOCALE_USERMENU_MSG_WARNING_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7700d888d..cdfab817f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1639,7 +1639,7 @@ const char * locale_real_names[] = "personalize.pinprotect", "personalize.pinstatus", "personalize.plugins", - "personalize.usermenu_plugin_type", + "personalize.usermenu_plugin_types", "personalize.usermenu_preferred_buttons", "personalize.usermenu_show_cancel", "personalize.visible", @@ -1998,6 +1998,7 @@ const char * locale_real_names[] = "usermenu.item_bar", "usermenu.item_epg_misc", "usermenu.item_none", + "usermenu.item_plugin_types", "usermenu.item_vtxt", "usermenu.msg_info_is_empty", "usermenu.msg_warning_name", diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 42bb69cd1..098c47c80 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -103,10 +103,14 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE {"personalize_feat_key_vtxt" , CPersonalizeGui::PERSONALIZE_FEAT_KEY_BLUE}, {"personalize_feat_key_rclock" , CPersonalizeGui::PERSONALIZE_FEAT_KEY_AUTO}, - //plugin type - {"personalize_usermenu_plugin_type" , CPlugins::P_TYPE_TOOL }, //user menu {"personalize_usermenu_show_cancel" , true}, + + //plugin types + {"personalize_usermenu_plugin_type_games" , false}, + {"personalize_usermenu_plugin_type_tools" , true}, + {"personalize_usermenu_plugin_type_scripts" , false}, + {"personalize_usermenu_plugin_type_lua" , true}, }; CScanSettings::CScanSettings(void) diff --git a/src/system/settings.h b/src/system/settings.h index b4aa6ee09..b84dbe163 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -234,11 +234,15 @@ struct SNeutrinoSettings P_FEAT_KEY_VTXT, P_FEAT_KEY_RC_LOCK, - //plugins type - P_UMENU_PLUGIN_TYPE, //user menu P_UMENU_SHOW_CANCEL, + //plugins types + P_UMENU_PLUGIN_TYPE_GAMES, + P_UMENU_PLUGIN_TYPE_TOOLS, + P_UMENU_PLUGIN_TYPE_SCRIPTS, + P_UMENU_PLUGIN_TYPE_LUA, + P_SETTINGS_MAX }; @@ -654,7 +658,7 @@ struct SNeutrinoSettings ITEM_VTXT = 11, ITEM_TECHINFO = 13, ITEM_REMOTE = 14, - ITEM_PLUGIN = 15, + ITEM_PLUGIN_TYPES = 15, ITEM_IMAGEINFO = 16, ITEM_BOXINFO = 17, ITEM_CAM = 18, From 7aac9fbdbe5fbfc895a5fd1e2e640abf76159726 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 6 Feb 2014 19:33:59 +0100 Subject: [PATCH 38/67] src/gui/color.cpp: Rework functions for color conversions, using float. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3cfd885698d33a8a39f05ac03157a3b9a045677 Author: Michael Liebmann Date: 2014-02-06 (Thu, 06 Feb 2014) --- src/gui/color.cpp | 188 ++++++++++++++++++++++++---------------------- src/gui/color.h | 22 +++--- 2 files changed, 110 insertions(+), 100 deletions(-) diff --git a/src/gui/color.cpp b/src/gui/color.cpp index d0f28b7f4..99c44bb22 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -89,130 +89,138 @@ void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, b protectColor(r,g,b, protect); } -unsigned char getBrightnessRGB(fb_pixel_t color) +uint8_t getBrightnessRGB(fb_pixel_t color) { RgbColor rgb; - rgb.r = (color & 0x00FF0000) >> 16; - rgb.g = (color & 0x0000FF00) >> 8; - rgb.b = color & 0x000000FF; + rgb.r = (uint8_t)((color & 0x00FF0000) >> 16); + rgb.g = (uint8_t)((color & 0x0000FF00) >> 8); + rgb.b = (uint8_t) (color & 0x000000FF); return rgb.r > rgb.g ? (rgb.r > rgb.b ? rgb.r : rgb.b) : (rgb.g > rgb.b ? rgb.g : rgb.b); } -fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br) +fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp) { int br_ = (int)getBrightnessRGB(color); br_ += br; if (br_ < 0) br_ = 0; if (br_ > 255) br_ = 255; - return changeBrightnessRGB(color, (unsigned char)br_); + return changeBrightnessRGB(color, (uint8_t)br_, transp); } -void changeBrightnessRGBRel2(RgbColor *rgb, int br) +fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp) { - fb_pixel_t color = (((rgb->r << 16) & 0x00FF0000) | - ((rgb->g << 8) & 0x0000FF00) | - ((rgb->b ) & 0x000000FF)); - int br_ = (int)getBrightnessRGB(color); - br_ += br; - if (br_ < 0) br_ = 0; - if (br_ > 255) br_ = 255; - HsvColor hsv; - Rgb2Hsv(rgb, &hsv); - hsv.v = br_; - Hsv2Rgb(&hsv, rgb); + uint8_t tr = SysColor2Hsv(color, &hsv); + hsv.v = (float)br / (float)255; + if (!transp) + tr = 0xFF; + return Hsv2SysColor(&hsv, tr); } -fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br) +fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr) { - HsvColor hsv; RgbColor rgb; - - unsigned char tr; - tr = (color & 0xFF000000) >> 24; - rgb.r = (color & 0x00FF0000) >> 16; - rgb.g = (color & 0x0000FF00) >> 8; - rgb.b = color & 0x000000FF; - - Rgb2Hsv(&rgb, &hsv); - hsv.v = br; - Hsv2Rgb(&hsv, &rgb); - + Hsv2Rgb(hsv, &rgb); return (((tr << 24) & 0xFF000000) | ((rgb.r << 16) & 0x00FF0000) | ((rgb.g << 8) & 0x0000FF00) | ((rgb.b ) & 0x000000FF)); } +uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv) +{ + uint8_t tr; + RgbColor rgb; + tr = (uint8_t)((color & 0xFF000000) >> 24); + rgb.r = (uint8_t)((color & 0x00FF0000) >> 16); + rgb.g = (uint8_t)((color & 0x0000FF00) >> 8); + rgb.b = (uint8_t) (color & 0x000000FF); + Rgb2Hsv(&rgb, hsv); + return tr; +} + void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb) { - unsigned char region, remainder, p, q, t; + float f_H = hsv->h; + float f_S = hsv->s; + float f_V = hsv->v; + if (f_S == 0) { + rgb->r = (uint8_t)(f_V * 255); + rgb->g = (uint8_t)(f_V * 255); + rgb->b = (uint8_t)(f_V * 255); - if (hsv->s == 0) { - rgb->r = hsv->v; - rgb->g = hsv->v; - rgb->b = hsv->v; - return; + } else { + float f_R; + float f_G; + float f_B; + float hh = f_H; + if (hh >= 360) hh = 0; + hh /= 60; + int i = (int)hh; + float ff = hh - (float)i; + float p = f_V * (1 - f_S); + float q = f_V * (1 - (f_S * ff)); + float t = f_V * (1 - (f_S * (1 - ff))); + + switch (i) { + case 0: + f_R = f_V; f_G = t; f_B = p; + break; + case 1: + f_R = q; f_G = f_V; f_B = p; + break; + case 2: + f_R = p; f_G = f_V; f_B = t; + break; + case 3: + f_R = p; f_G = q; f_B = f_V; + break; + case 4: + f_R = t; f_G = p; f_B = f_V; + break; + case 5: + default: + f_R = f_V; f_G = p; f_B = q; + break; + } + rgb->r = (uint8_t)(f_R * 255); + rgb->g = (uint8_t)(f_G * 255); + rgb->b = (uint8_t)(f_B * 255); } - - region = hsv->h / 43; - remainder = (hsv->h - (region * 43)) * 6; - - p = (hsv->v * (255 - hsv->s)) >> 8; - q = (hsv->v * (255 - ((hsv->s * remainder) >> 8))) >> 8; - t = (hsv->v * (255 - ((hsv->s * (255 - remainder)) >> 8))) >> 8; - - switch (region) { - case 0: - rgb->r = hsv->v; rgb->g = t; rgb->b = p; - break; - case 1: - rgb->r = q; rgb->g = hsv->v; rgb->b = p; - break; - case 2: - rgb->r = p; rgb->g = hsv->v; rgb->b = t; - break; - case 3: - rgb->r = p; rgb->g = q; rgb->b = hsv->v; - break; - case 4: - rgb->r = t; rgb->g = p; rgb->b = hsv->v; - break; - default: - rgb->r = hsv->v; rgb->g = p; rgb->b = q; - break; - } - - return; } void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv) { - unsigned char rgbMin, rgbMax; + float f_R = (float)rgb->r / (float)255; + float f_G = (float)rgb->g / (float)255; + float f_B = (float)rgb->b / (float)255; - rgbMin = rgb->r < rgb->g ? (rgb->r < rgb->b ? rgb->r : rgb->b) : (rgb->g < rgb->b ? rgb->g : rgb->b); - rgbMax = rgb->r > rgb->g ? (rgb->r > rgb->b ? rgb->r : rgb->b) : (rgb->g > rgb->b ? rgb->g : rgb->b); + float min = f_R < f_G ? (f_R < f_B ? f_R : f_B) : (f_G < f_B ? f_G : f_B); + float max = f_R > f_G ? (f_R > f_B ? f_R : f_B) : (f_G > f_B ? f_G : f_B); + float delta = max - min; - hsv->v = rgbMax; - if (hsv->v == 0) { - hsv->h = 0; - hsv->s = 0; - return; + float f_V = max; + float f_H = 0; + float f_S = 0; + + if (delta == 0) { //gray + f_S = 0; + f_H = 0; + } else { + f_S = (delta / max); + if (f_R >= max) + f_H = (f_G - f_B) / delta; + else if (f_G >= max) + f_H = 2 + (f_B - f_R) / delta; + else + f_H = 4 + (f_R - f_G) / delta; + + f_H *= 60; + if (f_H < 0) + f_H += 360; } - - hsv->s = 255 * long(rgbMax - rgbMin) / hsv->v; - if (hsv->s == 0) { - hsv->h = 0; - return; - } - - if (rgbMax == rgb->r) - hsv->h = 0 + 43 * (rgb->g - rgb->b) / (rgbMax - rgbMin); - else if (rgbMax == rgb->g) - hsv->h = 85 + 43 * (rgb->b - rgb->r) / (rgbMax - rgbMin); - else - hsv->h = 171 + 43 * (rgb->r - rgb->g) / (rgbMax - rgbMin); - - return; + hsv->h = f_H; + hsv->s = f_S; + hsv->v = f_V; } diff --git a/src/gui/color.h b/src/gui/color.h index f25513b9b..a9a45313d 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -120,22 +120,24 @@ int convertSetupAlpha2Alpha(unsigned char alpha); void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, bool protect=true); typedef struct { - unsigned char r; - unsigned char g; - unsigned char b; + uint8_t r; + uint8_t g; + uint8_t b; } RgbColor; typedef struct { - unsigned char h; - unsigned char s; - unsigned char v; + float h; + float s; + float v; } HsvColor; -unsigned char getBrightnessRGB(fb_pixel_t color); +uint8_t getBrightnessRGB(fb_pixel_t color); -fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br); -fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br); -void changeBrightnessRGBRel2(RgbColor *rgb, int br); +fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp=true); +fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp=true); + +fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr=0xFF); +uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv); From 3739771ff722b566a92afb9c6805d9dcff2b28ac Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 7 Feb 2014 02:01:45 +0100 Subject: [PATCH 39/67] src/gui/color.cpp: Fix compiler warnings (-Wconversion) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/176460cf800aaf5c193cca9a3cc0716b0731f2ad Author: Michael Liebmann Date: 2014-02-07 (Fri, 07 Feb 2014) --- src/gui/color.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 99c44bb22..7bc2ec4d0 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -39,9 +39,9 @@ int convertSetupColor2RGB(const unsigned char r, const unsigned char g, const unsigned char b) { - unsigned char red = int( float(255./100.)*float(r) ); - unsigned char green = int( float(255./100.)*float(g) ); - unsigned char blue = int( float(255./100.)*float(b) ); + unsigned char red = (unsigned char)( float(2.55)*float(r) ); + unsigned char green = (unsigned char)( float(2.55)*float(g) ); + unsigned char blue = (unsigned char)( float(2.55)*float(b) ); return (red << 16) | (green << 8) | blue; } @@ -50,8 +50,8 @@ int convertSetupAlpha2Alpha(unsigned char alpha) { if(alpha == 0) return 0xFF; else if(alpha >= 100) return 0; - unsigned char a = 100 - alpha; - int ret = int( float(0xFF/100.)*float(a) ); + unsigned char a = (unsigned char)(100 - alpha); + int ret = int( float(2.55)*float(a) ); return ret; } @@ -66,7 +66,7 @@ void recalcColor(unsigned char &orginal, int fade) color=255; if(color<0) color=0; - orginal = color; + orginal = (unsigned char)color; } void protectColor( unsigned char &r, unsigned char &g, unsigned char &b, bool protect ) From 7e78f773b8a68a7ac083fdb67a23dc968f510595 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 6 Feb 2014 08:32:40 +0100 Subject: [PATCH 40/67] CImageInfo: use correct class name Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4614d6a54fd27189b5b8715d2148d23cf4900b3f Author: Thilo Graf Date: 2014-02-06 (Thu, 06 Feb 2014) --- src/gui/imageinfo.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index d60f2df96..150c6dc9e 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -63,9 +63,8 @@ class CImageInfo : public CMenuTarget std::string getLicenseText(); void ShowWindow(); void ScrollLic(bool scrollDown); - - //CComponentsWindowMax *cc_win; - CComponentsWindow *cc_win; + + CComponentsWindowMax *cc_win; CComponentsForm *cc_info; CComponentsPIP *cc_tv; CComponentsInfoBox *cc_lic; From caf0d7db19b5a18d8eae6cc39983609da6d3c5cf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Feb 2014 09:29:20 +0100 Subject: [PATCH 41/67] CComponentsWindow: fix missing define of header position Position is strictly top and left within of Window Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c6221581edf1ea0a64b4aedd2ad46e7e73690076 Author: Thilo Graf Date: 2014-02-07 (Fri, 07 Feb 2014) --- src/gui/components/cc_frm_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index de7f91888..f5021d580 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -165,7 +165,7 @@ void CComponentsWindow::initHeader() //set header properties //TODO: assigned properties with internal header objekt have no effect! if (ccw_head){ ccw_head->setWidth(width-2*fr_thickness); -// ccw_head->setPos(0, 0); + ccw_head->setPos(0, 0); ccw_head->setIcon(ccw_icon_name); ccw_head->setCaption(ccw_caption, ccw_align_mode); ccw_head->setDefaultButtons(ccw_buttons); From 062ffc5d6f9162640d70c8b04044ba0bf298339d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 7 Feb 2014 18:05:06 +0100 Subject: [PATCH 42/67] add pseudo AdZap timertype Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c7968edc44cf7e0ec11e4dc375d7f7fb73648c9 Author: Jacek Jendrzej Date: 2014-02-07 (Fri, 07 Feb 2014) Origin message was: ------------------ -add pseudo AdZap timertype --- lib/timerdclient/timerdclient.cpp | 20 +++++++++++++++----- lib/timerdclient/timerdclient.h | 13 +++++++++++++ lib/timerdclient/timerdtypes.h | 3 ++- src/gui/epgview.cpp | 28 +++++++++++++++++----------- src/timerd/timermanager.cpp | 3 +++ 5 files changed, 50 insertions(+), 17 deletions(-) diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index 44429ed6b..63aed7d6e 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -28,7 +28,7 @@ #include #include - +int CTimerdClient::adzap_eventID = 0; unsigned char CTimerdClient::getVersion () const { return CTimerdMsg::ACTVERSION; @@ -253,7 +253,11 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, return -1; } } - + bool adzaptimer = false; + if(evType == CTimerd::TIMER_ADZAP){ + evType = CTimerd::TIMER_ZAPTO; + adzaptimer = true; + } CTimerd::TransferEventInfo tei; CTimerd::TransferRecordingInfo tri; CTimerdMsg::commandAddTimer msgAddTimer; @@ -270,7 +274,8 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, } /* else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || */ else if (evType == CTimerd::TIMER_ZAPTO || - evType == CTimerd::TIMER_IMMEDIATE_RECORD ) + evType == CTimerd::TIMER_IMMEDIATE_RECORD || + evType == CTimerd::TIMER_ADZAP) { CTimerd::EventInfo *ei=static_cast(data); tei.apids = ei->apids; @@ -318,15 +323,20 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, CTimerdMsg::responseAddTimer response; receive_data((char*)&response, sizeof(response)); close_connection(); - + + if(adzaptimer){ + adzap_eventID = response.eventID;//set adzap flag + } return( response.eventID); } //------------------------------------------------------------------------- void CTimerdClient::removeTimerEvent( int evId) { - CTimerdMsg::commandRemoveTimer msgRemoveTimer; + if(evId == adzap_eventID) + adzap_eventID = 0;//reset adzap flag + CTimerdMsg::commandRemoveTimer msgRemoveTimer; msgRemoveTimer.eventID = evId; send(CTimerdMsg::CMD_REMOVETIMER, (char*) &msgRemoveTimer, sizeof(msgRemoveTimer)); diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 16bdcad77..59a41b260 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -61,6 +61,7 @@ class CTimerdClient:private CBasicClient void registerEvent(unsigned int eventID, unsigned int clientID, const char * const udsName); void unRegisterEvent(unsigned int eventID, unsigned int clientID); + static int adzap_eventID; bool isTimerdAvailable(); // check if timerd is running @@ -151,6 +152,18 @@ class CTimerdClient:private CBasicClient eventInfo.recordingSafety = false; return addTimerEvent(CTimerd::TIMER_ZAPTO, &eventInfo, announcetime, alarmtime, stoptime); }; + // adds new adzap timer event //pseudo TIMER_ADZAP + int addAdZaptoTimerEvent(const t_channel_id channel_id, time_t alarmtime) + { + CTimerd::EventInfo eventInfo; + eventInfo.channel_id = channel_id; + eventInfo.epgID = 1; + eventInfo.epg_starttime = 0; + eventInfo.apids = 0; + eventInfo.recordingSafety = false; + return addTimerEvent(CTimerd::TIMER_ADZAP, &eventInfo, 0, alarmtime, 0); + }; + #if 0 int addNextProgramTimerEvent(CTimerd::EventInfo eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0) diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index 9ec69b56c..a741318d6 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -68,7 +68,8 @@ class CTimerd TIMER_REMIND, TIMER_SLEEPTIMER, TIMER_EXEC_PLUGIN, - TIMER_IMMEDIATE_RECORD + TIMER_IMMEDIATE_RECORD, + TIMER_ADZAP }; enum CTimerEventStates diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4cadb4fd5..a3223abf8 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -784,17 +784,24 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_page_up: if(isCurrentEPG(channel_id)){ - g_settings.wzap_time++; - if(g_settings.wzap_time>9) - g_settings.wzap_time = 9; + if(g_settings.wzap_time> 14) + g_settings.wzap_time+=5; + else + g_settings.wzap_time++; + if(g_settings.wzap_time>60) + g_settings.wzap_time = 0; showTimerEventBar(true, true); } break; case CRCInput::RC_page_down: if(isCurrentEPG(channel_id)){ - g_settings.wzap_time--; + if(g_settings.wzap_time> 19) + g_settings.wzap_time-=5; + else + g_settings.wzap_time--; + if(g_settings.wzap_time<0) - g_settings.wzap_time = 0; + g_settings.wzap_time = 60; showTimerEventBar(true, true); } break; @@ -886,11 +893,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start //CTimerdClient timerdclient; if (g_Timerd->isTimerdAvailable()) { - if(g_settings.wzap_time && isCurrentEPG(channel_id)){ - g_Timerd->addZaptoTimerEvent(channel_id, - time (NULL) + (g_settings.wzap_time * 60), - 0, 0, - 0, 0, 0); + if(!g_Timerd->adzap_eventID && g_settings.wzap_time && isCurrentEPG(channel_id)){ + g_Timerd->addAdZaptoTimerEvent(channel_id, + time (NULL) + (g_settings.wzap_time * 60)); + loop = false; }else{ g_Timerd->addZaptoTimerEvent(channel_id, epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), @@ -1183,7 +1189,7 @@ void CEpgData::showTimerEventBar (bool pshow, bool webzap) /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); std::string tmp_but_name; - if(g_settings.wzap_time && webzap){ + if(g_settings.wzap_time && webzap && !g_Timerd->adzap_eventID){ tmp_but_name = g_Locale->getText(LOCALE_ADZAP); tmp_but_name += " "+ to_string(g_settings.wzap_time) + " "; tmp_but_name += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 5493f126d..6d08e8391 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1286,6 +1286,9 @@ void CTimerEvent_Zapto::announceEvent() //------------------------------------------------------------ void CTimerEvent_Zapto::fireEvent() { + if(CTimerdClient::adzap_eventID == eventID) + CTimerdClient::adzap_eventID = 0;//reset adzap flag + CTimerManager::getInstance()->getEventServer()->sendEvent(CTimerdClient::EVT_ZAPTO, CEventServer::INITID_TIMERD, &eventInfo, From ec8f4a8913746fd8e0494cba3a1024ffc600ab33 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 7 Feb 2014 22:14:32 +0100 Subject: [PATCH 43/67] menue-hints: fix display of nonlocalized hints Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e24e68dddfb5d019eaae702fea98be5d580dd82a Author: vanhofen Date: 2014-02-07 (Fri, 07 Feb 2014) Origin message was: ------------------ - menue-hints: fix display of nonlocalized hints --- src/gui/widget/menue.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a3581c486..5ce614589 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -818,7 +818,7 @@ void CMenuWidget::checkHints() { GenericMenuBack->setHint("", NONEXISTANT_LOCALE); for (unsigned int i= 0; i< items.size(); i++) { - if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE) { + if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE || !items[i]->hintText.empty()) { has_hints = true; break; } @@ -1118,7 +1118,7 @@ void CMenuWidget::paintHint(int pos) CMenuItem* item = items[pos]; - if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) { + if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { if (info_box) { savescreen ? info_box->hide(false) : info_box->kill(); hint_painted = false; @@ -1126,7 +1126,7 @@ void CMenuWidget::paintHint(int pos) return; } - if (item->hint == NONEXISTANT_LOCALE) + if (item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) return; int iheight = item->getHeight(); @@ -1153,7 +1153,7 @@ void CMenuWidget::paintHint(int pos) } //init infobox - std::string str = g_Locale->getText(item->hint); + std::string str = item->hintText.empty() ? g_Locale->getText(item->hint) : item->hintText; if (info_box){ info_box->setDimensionsAll(x, ypos2, iwidth, hint_height); info_box->setFrameThickness(2); From 1e1122f44d6c1fd3cc9ef6ae87ec9318c38bf6fd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Feb 2014 22:40:22 +0100 Subject: [PATCH 44/67] yWeb: fix typo; THX to TheDuke Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c52b66068f0f612b628da00a1a04dc6115df586e Author: vanhofen Date: 2014-02-08 (Sat, 08 Feb 2014) Origin message was: ------------------ - yWeb: fix typo; THX to TheDuke --- src/nhttpd/web/Y_Blocks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index f10a0d762..d9fc4081a 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -347,7 +347,7 @@ function do_submit()
- + From bd5e6f5ec605019123c6018adb3316d0bed39302 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 10 Feb 2014 21:14:54 +0100 Subject: [PATCH 49/67] CControlAPI:: -add SignalInfoCGI Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d01e2152a3e4c9389ea62b4e219d80dc827ebe7 Author: Jacek Jendrzej Date: 2014-02-10 (Mon, 10 Feb 2014) --- .../tuxboxapi/coolstream/controlapi.cpp | 33 ++++++++++++++++++- src/nhttpd/tuxboxapi/coolstream/controlapi.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index c1e23697c..01a85382f 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -49,6 +49,8 @@ #include "neutrinoapi.h" #include "controlapi.h" #include +#include + 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 @@ -210,7 +213,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= // settings {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling - {"file", &CControlAPI::FileCGI, "+xml"}, + {"file", &CControlAPI::FileCGI, "+xml"} }; @@ -1756,6 +1759,34 @@ 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; + hh->printf("SIG:%3u\n", sig); + } + if ( parame_empty || (hh->ParamList["1"] == "snr") ){ + unsigned int snr = frontend->getSignalNoiseRatio() & 0xFFFF; + snr = (snr & 0xFFFF) * 100 / 65535; + hh->printf("SNR:%3u\n", snr); + } + if ( parame_empty || (hh->ParamList["1"] == "ber") ){ + unsigned int ber = frontend->getBitErrorRate(); + hh->printf("BER:%3u\n", ber); + } + }else + hh->SendError(); +} + //----------------------------------------------------------------------------- void CControlAPI::SendStreamInfo(CyhookHandler *hh) { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index 33d969ae6..ce7f7d9a3 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -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; From 9d5762395e80dfc4c0b3d5ea74fd4a123d20626c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Feb 2014 21:50:34 +0100 Subject: [PATCH 50/67] CControlAPI: SignalInfoCGI: don't show description in explicit calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/63d66538ce7f42a3ce8515510d1590157a98f838 Author: vanhofen Date: 2014-02-10 (Mon, 10 Feb 2014) Origin message was: ------------------ - CControlAPI: SignalInfoCGI: don't show description in explicit calls --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 01a85382f..b61e35409 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1772,16 +1772,22 @@ void CControlAPI::SignalInfoCGI(CyhookHandler *hh) if ( parame_empty || (hh->ParamList["1"] == "sig") ){ unsigned int sig = frontend->getSignalStrength() & 0xFFFF; sig = (sig & 0xFFFF) * 100 / 65535; - hh->printf("SIG:%3u\n", sig); + 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; - hh->printf("SNR:%3u\n", snr); + if (parame_empty) + hh->printf("SNR: "); + hh->printf("%3u\n", snr); } if ( parame_empty || (hh->ParamList["1"] == "ber") ){ unsigned int ber = frontend->getBitErrorRate(); - hh->printf("BER:%3u\n", ber); + if (parame_empty) + hh->printf("BER: "); + hh->printf("%3u\n", ber); } }else hh->SendError(); From 308c8ce00a99e6c6b3642fabd4bf06061399e7ca Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 12 Feb 2014 05:45:51 +0100 Subject: [PATCH 51/67] yWeb: Synchronize volume/audiomute settings yWeb => GUI Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/92fce346c00fd4af5f834daf5bcd986c8c4760a1 Author: Michael Liebmann Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/driver/rcinput.cpp | 8 ++++++++ src/driver/volume.cpp | 9 +++++++++ src/driver/volume.h | 1 + src/neutrino.cpp | 8 ++++++++ src/neutrinoMessages.h | 5 ++++- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 8 +++++--- src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp | 2 ++ 7 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index b1b2d895f..b0c22373b 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -865,6 +865,14 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::EVT_HDMI_CEC_STANDBY; *data = 0; break; + case NeutrinoMessages::EVT_SET_MUTE : + *msg = NeutrinoMessages::EVT_SET_MUTE; + *data = *(char*) p; + break; + case NeutrinoMessages::EVT_SET_VOLUME : + *msg = NeutrinoMessages::EVT_SET_VOLUME; + *data = *(char*) p; + break; default: printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID ); } diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index a8fe704a3..af9a0d178 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -74,6 +74,15 @@ void CVolume::setvol(int vol) CZapit::getInstance()->SetVolume(vol); } +void CVolume::setVolumeExt(int vol) +{ + g_settings.current_volume = vol; + CZapit::getInstance()->SetVolume(vol); + CVFD::getInstance()->showVolume(vol); + if (CNeutrinoApp::getInstance()->isMuted() && vol > 0) + CAudioMute::getInstance()->AudioMute(false, true); +} + void CVolume::setVolume(const neutrino_msg_t key) { neutrino_msg_t msg = key; diff --git a/src/driver/volume.h b/src/driver/volume.h index ecf019734..430ed7444 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -48,6 +48,7 @@ class CVolume : public CChangeObserver void setvol(int vol); void setVolume(const neutrino_msg_t key); + void setVolumeExt(int vol); void SetCurrentPid(int pid) { apid = pid; } void SetCurrentChannel(t_channel_id id) { channel_id = id; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1a7252e03..1ac315627 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3045,6 +3045,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } + else if (msg == NeutrinoMessages::EVT_SET_MUTE) { + g_audioMute->AudioMute((int)data, true); + return messages_return::handled; + } + else if (msg == NeutrinoMessages::EVT_SET_VOLUME) { + g_volume->setVolumeExt((int)data); + 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 51a1b2cab..a0b042ae6 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -153,7 +153,10 @@ struct NeutrinoMessages { EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */ EVT_HDMI_CEC_VIEW_ON = CRCInput::RC_WithData + 26, - EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27 + EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27, + + EVT_SET_MUTE = CRCInput::RC_WithData + 28, + EVT_SET_VOLUME = CRCInput::RC_WithData + 29 }; enum { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index b61e35409..283ce2871 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -781,12 +781,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 @@ -794,7 +796,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 diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 4f285b586..83d8f78a1 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -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"); } //------------------------------------------------------------------------- From 6e374152301aa3402cbfd4bb5885810e938aedee Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 12 Feb 2014 05:46:04 +0100 Subject: [PATCH 52/67] CTimerList: Fix displaying and saving reminder timer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b2446667e9c43945d8465f636c2ac050c1dcf856 Author: Michael Liebmann Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/gui/timerlist.cpp | 7 ++++--- src/gui/timerlist.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ee78b7b10..827cb877b 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -261,6 +261,7 @@ CTimerList::CTimerList() listmaxshow = 0; Timer = new CTimerdClient(); skipEventID=0; + timerNew_message = ""; /* most probable default */ saved_dispmode = (int)CVFD::MODE_TVRADIO; @@ -338,7 +339,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) data= &eventinfo; } else if (timerNew.eventType==CTimerd::TIMER_REMIND) - data= timerNew.message; + data = (void*)timerNew_message.c_str(); else if (timerNew.eventType==CTimerd::TIMER_EXEC_PLUGIN) { if (strcmp(timerNew.pluginName, "---") == 0) @@ -1218,9 +1219,9 @@ int CTimerList::newTimer() CMenuOptionChooser* m8 = new CMenuOptionChooser(LOCALE_TIMERLIST_STANDBY, &timerNew_standby_on, TIMERLIST_STANDBY_OPTIONS, TIMERLIST_STANDBY_OPTION_COUNT, false); - std::string timerNew_message(timerNew.message); + timerNew_message = std::string(timerNew.message); CStringInputSMS timerSettings_msg(LOCALE_TIMERLIST_MESSAGE, &timerNew_message, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.,:!?/ "); - CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew.message, &timerSettings_msg ); + CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew_message, &timerSettings_msg ); strcpy(timerNew.pluginName,"---"); CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 0266c6e04..c05c7f486 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -65,6 +65,7 @@ class CTimerList : public CMenuTarget int timerNew_standby_on; std::string timerNew_channel_name; std::string m_weekdaysStr; + std::string timerNew_message; int timer_apids_dflt; int timer_apids_std; From 35fd0b2d83fe0b3f3429494330ed109c73613d5a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Feb 2014 08:50:19 +0100 Subject: [PATCH 53/67] yWeb: increase version by counting commits since last increase Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c4b12508ac9e03ccd265a82ff29a6e758e31751 Author: vanhofen Date: 2014-02-12 (Wed, 12 Feb 2014) Origin message was: ------------------ - yWeb: increase version by counting commits since last increase --- src/nhttpd/web/Y_Version.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 173750aaa..5f8cfc6a9 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.44 -date=09.08.2013 +version=2.8.0.58 +date=12.02.2014 type=Release info=Port CST From 7ab316f72ed48842aebe74fd08c571144d722c37 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Feb 2014 08:59:39 +0100 Subject: [PATCH 54/67] yWeb: add signal strength to boxcontrol menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1bfe94a6e140a9ab31add849550cf23013704c7 Author: vanhofen Date: 2014-02-12 (Wed, 12 Feb 2014) Origin message was: ------------------ - yWeb: add signal strength to boxcontrol menu --- src/nhttpd/web/Y_Boxcontrol_Menue.yhtm | 97 +++++++++++++++++++++++++- src/nhttpd/web/Y_Main.css | 24 +++++++ src/nhttpd/web/Y_Version.txt | 2 +- src/nhttpd/web/languages/Deutsch | 2 + src/nhttpd/web/languages/English | 2 + 5 files changed, 125 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 993857228..027dc585d 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -1,10 +1,68 @@ -{=var-set:cancache=yPInstall=} {=include-block:Y_Blocks.txt;head=} @@ -138,6 +206,32 @@ function init(){ +
+

{=L:bc.menue.signal=}

+
+
+
SIG %
+
Wellcome to yWeb
Welcome to yWeb
{=L:language=} - - + + + CEC:
{=L:bc.control.playback=}{=L:bc.control.recording_mode=}
+ + + + +
..
+ +
+
SNR %
+ + + + + +
..
+
+
+
BER
+
+
+ {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~~

Switch to

@@ -155,6 +249,7 @@ function init(){ diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index a2283ebe7..b9f71adfe 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -557,6 +557,30 @@ tr { margin-top: 10px; border: #FF8e42 solid 1px; } +.y_text_boxcontrol_table_progress { + width: 114px; + height: 12px; + padding: 0; + margin-bottom: 5px; + border: #FF8e42 solid 1px; + border-top: 0 none; + + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(left, #ff0000 0%, #ffff00 74%, #ffff00 75%, #00ff00 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(0%,#ff0000), color-stop(74%,#ffff00), color-stop(75%,#ffff00), color-stop(100%,#00ff00)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* IE10+ */ + background: linear-gradient(to right, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff0000', endColorstr='#00ff00',GradientType=1 ); /* IE6-9 */ +} +.y_text_boxcontrol_div_progress { + width: 112px; + border: #FF8e42 solid 1px; + font-size: 9px; + margin-top: 5px; + margin-bottom: -1px; +} .y_epg_info { border: 1px solid #CCCCCC; background-color: white; diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 5f8cfc6a9..56230142c 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.58 +version=2.8.0.59 date=12.02.2014 type=Release info=Port CST diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 8673724a9..3ce68695e 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -99,6 +99,8 @@ bc.menue.switch_to_radio=Zum Radio umschalten bc.menue.webinf_slavebox=Webinterface der SlaveBox bc.menue.volumen_display=Lautstärke Anzeige +bc.menue.signal=Signalstärke + ========= Boxcontrol bc.control.freemem=FreeMem bc.control.lock=sperren diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index c5ff7241a..7bd7a6689 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -101,6 +101,8 @@ bc.menue.switch_to_radio=switch to Radio bc.menue.webinf_slavebox=Webinterface der SlaveBox bc.menue.volumen_display=volumen display +bc.menue.signal=Signal strength + ========= Boxcontrol bc.control.freemem=FreeMem bc.control.lock=lock From 8d760e9dfb07d13cae89910638deee8998620fa7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Feb 2014 09:24:37 +0100 Subject: [PATCH 55/67] pluginlist: simplify 06f7be9c17b51ce748e803e569423ccb47312bfb Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/565b62477b0069c54b6bcc6635fa80ab75a3ea78 Author: vanhofen Date: 2014-02-12 (Wed, 12 Feb 2014) Origin message was: ------------------ - pluginlist: simplify 06f7be9c17b51ce748e803e569423ccb47312bfb --- src/gui/pluginlist.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 41e6eece0..7291153f4 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -324,10 +324,9 @@ void CPluginList::paint() width = w_max( 500, 0 ); height = h_max( 526, 50 ); // 2*25 pixel frei listmaxshow = (height-theight-0)/fheight; - int multiplicator = pluginlist.size(); - if (listmaxshow < pluginlist.size()) - multiplicator = listmaxshow; - height = theight+0+multiplicator*fheight; // recalc height + if (pluginlist.size() < listmaxshow) + listmaxshow = pluginlist.size(); + height = theight+0+listmaxshow*fheight; // recalc height x=getScreenStartX( width ); y=getScreenStartY( height ); From 3375b332d54719055fef0560551d9c2b877dbc35 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 12 Feb 2014 13:29:26 +0100 Subject: [PATCH 56/67] doc controlapi: add documentation for '/control/signal' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b28d38cea8bde7b7e9ce5a4e605bb5375528db3 Author: vanhofen Date: 2014-02-12 (Wed, 12 Feb 2014) Origin message was: ------------------ - doc controlapi: add documentation for '/control/signal' --- src/nhttpd/doc/nhttpd_controlapi.html | 40 ++++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 2632352cc..7eae99bb2 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -199,6 +199,11 @@ http://dbox/control/screenshot + + 43. Signalstärke anzeigen + + http://dbox/control/signal +     @@ -1777,19 +1782,6 @@ ok
 
-
- - -
41. Plugins neu laden
-
Handler: http://dbox/control/reloadplugins
-
-Parameter: keine
-Rückgabe: ok
-
-Die Pluginliste wird neu geladen. - - -
@@ -1840,6 +1832,28 @@ Beispiel:
>>>http://dbox/control/screenshot?osd=0&video=1
ok
  + + + +
43. Signalstärke zeigen
+
Handler: http://dbox/control/signal
+
+Parameter: keine oder sig, snr, ber

+Rückgabe:
+SIG: 100
+SNR: 90
+BER: 0
+
+Signalstärke SIG in %, SNR in % und BER wird ausgegeben. +Wird ein spezieller Wert als Parameter angegeben, wird keine Beschreibung ausgegeben. +
+
+Beispiel:
+
+>>>http://dbox/control/signal?sig
+100
+   

From 9fcec0d30de060c6d70c5d19ea4c4af051bc269c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Feb 2014 16:27:12 +0400 Subject: [PATCH 57/67] gui/hdd_menu.cpp: disable 1min sleep option; fix restore hotplug for mdev system Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8020de8bfe55c8baed7c09984c80994f847cfe32 Author: [CST] Focus Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/gui/hdd_menu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index f0459a8dc..006ab82ce 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -75,7 +75,7 @@ const CMenuOptionChooser::keyval HDD_FILESYS_OPTIONS[HDD_FILESYS_OPTION_COUNT] = const CMenuOptionChooser::keyval HDD_SLEEP_OPTIONS[HDD_SLEEP_OPTION_COUNT] = { { 0, LOCALE_OPTIONS_OFF }, - { 12, LOCALE_HDD_1MIN }, + //{ 12, LOCALE_HDD_1MIN }, { 60, LOCALE_HDD_5MIN }, { 120, LOCALE_HDD_10MIN }, { 240, LOCALE_HDD_20MIN }, @@ -277,6 +277,9 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&) const char hdidle[] = "/sbin/hd-idle"; bool have_hdidle = !access(hdidle, X_OK); + if (g_settings.hdd_sleep < 60) + g_settings.hdd_sleep = 60; + if (have_hdidle) { system("kill $(pidof hd-idle)"); int sleep_seconds = g_settings.hdd_sleep; @@ -516,7 +519,11 @@ _remount: } f = fopen("/proc/sys/kernel/hotplug", "w"); if(f) { +#ifdef ASSUME_MDEV + fprintf(f, "/sbin/mdev\n"); +#else fprintf(f, "/sbin/hotplug\n"); +#endif fclose(f); } From 0cec69fb1954024c594bad02739b330aaa8cf6eb Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Feb 2014 16:29:57 +0400 Subject: [PATCH 58/67] system/helpers.cpp: change wakeup_hdd function to use hdd_get_standby/hdd_flush Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/10eb8869d6b5e448fe5a055545de37ddb7ef066f Author: [CST] Focus Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/system/helpers.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 0f00424a6..df8fc7228 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -79,12 +79,24 @@ bool file_exists(const char *filename) void wakeup_hdd(const char *hdd_dir) { - if(!check_dir(hdd_dir)){ + if(!check_dir(hdd_dir) && hdd_get_standby(hdd_dir)){ std::string wakeup_file = hdd_dir; wakeup_file += "/.wakeup"; + int fd = open(wakeup_file.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC); + if (fd >= 0) { + unsigned char buf[512]; + memset(buf, 0xFF, sizeof(buf)); + for (int i = 0; i < 20; i++) { + if (write(fd, buf, sizeof(buf)) < 0) { + perror("write to .wakeup"); + break; + } + } + fdatasync(fd); + close(fd); + } + hdd_flush(hdd_dir); remove(wakeup_file.c_str()); - creat(wakeup_file.c_str(),S_IREAD|S_IWRITE); - sync(); } } //use for script with full path From 993a18f71d5e0d2b6ffdb2cf11f7a43bf4fda28c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Feb 2014 16:30:41 +0400 Subject: [PATCH 59/67] gui/movieplayer.cpp: remove absolute has_hdd variable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/16fa40818f9f613cc74e2e210c1623884fac846e Author: [CST] Focus Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/gui/movieplayer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5d630dcc9..45b037fa7 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -66,7 +66,6 @@ extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CInfoClock *InfoClock; -extern bool has_hdd; #define TIMESHIFT_SECONDS 3 @@ -356,8 +355,7 @@ bool CMoviePlayerGui::SelectFile() full_name = ""; printf("CMoviePlayerGui::SelectFile: isBookmark %d timeshift %d isMovieBrowser %d\n", isBookmark, timeshift, isMovieBrowser); - if (has_hdd) - wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); + wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); if (timeshift) { t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); From 1a8fd9bec3cc9a74c09c7d688510f0889bbcf8c1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Feb 2014 16:31:35 +0400 Subject: [PATCH 60/67] driver/record.cpp: use wakeup_hdd(); save xml before record start Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee38ad27503f3600d436531012101c7abf8bd4e6 Author: [CST] Focus Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/driver/record.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 088e92e35..f2fb366fc 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -143,26 +143,25 @@ int CRecordInstance::GetStatus() record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) { - int fd; - std::string tsfile; - time_t msg_start_time = time(0); CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START)); if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg) hintBox.paint(); - tsfile = std::string(filename) + ".ts"; - bool standby = hdd_get_standby(Directory.c_str()); + wakeup_hdd(Directory.c_str()); + std::string tsfile = std::string(filename) + ".ts"; printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]); - fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU); + int fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU); if(fd < 0) { perror(tsfile.c_str()); hintBox.hide(); return RECORD_INVALID_DIRECTORY; } + SaveXml(); + CGenPsi psi; numpids = 0; if (allpids.PIDs.vpid != 0){ @@ -203,8 +202,6 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } psi.genpsi(fd); - if (standby) - hdd_flush(tsfile.c_str()); #if 0 if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS)) @@ -222,16 +219,17 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) record = NULL; close(fd); unlink(tsfile.c_str()); + std::string xmlfile = std::string(filename) + ".xml"; + unlink(xmlfile.c_str()); hintBox.hide(); return RECORD_FAILURE; } -printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux()); + printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux()); if(!autoshift) CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing start_time = time(0); - SaveXml(); CCamManager::getInstance()->Start(channel->getChannelID(), CCamManager::RECORD); From 50ad12c582c62339d0c56fb8185dfe478a54f8ab Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 12 Feb 2014 16:41:41 +0400 Subject: [PATCH 61/67] neutrino.cpp: pause sectionsd on shutdown before saving epg, stop epgscan to restore live channel id in case shutdown started from standby mode, fix hdd wakeup on record announce Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a9e3666b0aa9d56b0c3e072040163f2399c159d9 Author: [CST] Focus Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/neutrino.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1ac315627..af3e0e685 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -127,7 +127,6 @@ int old_b_id = -1; CHintBox * reloadhintBox = 0; -bool has_hdd; CInfoClock *InfoClock; int allow_flash = 1; @@ -2833,9 +2832,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) break; } } - if(has_hdd) { - wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); - } + wakeup_hdd(recordingDir); } if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { @@ -3089,7 +3086,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) frameBuffer->paintBackground(); videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); + CEpgScan::getInstance()->Stop(); if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { + g_Sectionsd->setPauseScanning(true); saveEpg(true);// true CVFD::MODE_SHUTDOWN } CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); From 4bae7ef436356dde57095e01cda63b52a4e4d8d4 Mon Sep 17 00:00:00 2001 From: martii Date: Wed, 12 Feb 2014 21:06:18 +0100 Subject: [PATCH 62/67] gui/hdd_menu: correct option count Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6895281091783b61cc7cb670ee87903a249dd991 Author: martii Date: 2014-02-12 (Wed, 12 Feb 2014) --- src/gui/hdd_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 006ab82ce..9c3dd1852 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -71,7 +71,7 @@ const CMenuOptionChooser::keyval HDD_FILESYS_OPTIONS[HDD_FILESYS_OPTION_COUNT] = { 1, LOCALE_HDD_REISER }, { 2, LOCALE_OPTIONS_OFF } }; -#define HDD_SLEEP_OPTION_COUNT 7 +#define HDD_SLEEP_OPTION_COUNT 6 const CMenuOptionChooser::keyval HDD_SLEEP_OPTIONS[HDD_SLEEP_OPTION_COUNT] = { { 0, LOCALE_OPTIONS_OFF }, From 1dae34a82fd143ed068d137b0a5100b72c61b43c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 6 Feb 2014 10:06:21 +0100 Subject: [PATCH 63/67] CComponentsForm, CSignalBar: rename offset vars Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2c79060b8b98cb6b3d33ab8a8b890df806e9a59 Author: Thilo Graf Date: 2014-02-06 (Thu, 06 Feb 2014) --- src/gui/components/cc_frm.cpp | 8 ++++---- src/gui/components/cc_frm.h | 6 +++--- src/gui/components/cc_frm_signalbars.cpp | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 7ae3f9490..37bda8853 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -110,8 +110,8 @@ void CComponentsForm::initVarForm() //CComponentsForm v_cc_items.clear(); cc_item_type = CC_ITEMTYPE_FRM; - append_h_offset = 0; - append_v_offset = 0; + append_x_offset = 0; + append_y_offset = 0; } void CComponentsForm::addCCItem(CComponentsItem* cc_Item) @@ -303,7 +303,7 @@ void CComponentsForm::paintCCItems() //set required x-position to item: //append vertical if (xpos == CC_APPEND){ - auto_x += append_h_offset; + auto_x += append_x_offset; cc_item->setRealXPos(auto_x + xpos); auto_x += w_item; } @@ -320,7 +320,7 @@ void CComponentsForm::paintCCItems() //set required y-position to item //append hor if (ypos == CC_APPEND){ - auto_y += append_v_offset; + auto_y += append_y_offset; cc_item->setRealYPos(auto_y + ypos); auto_y += h_item; } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index bbd60e263..d532cdbfc 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -39,8 +39,8 @@ class CComponentsForm : public CComponentsItem ///generates next possible index for an item, see also cc_item_index, getIndex(), setIndex() int genIndex(); - int append_h_offset; - int append_v_offset; + int append_x_offset; + int append_y_offset; public: CComponentsForm(); @@ -70,7 +70,7 @@ class CComponentsForm : public CComponentsItem ///return size (count) of available items virtual size_t size(){return v_cc_items.size();}; - virtual void setAppendOffset(const int &h_offset, const int& v_offset){append_h_offset = h_offset; append_v_offset = v_offset;}; + virtual void setAppendOffset(const int &x_offset, const int& y_offset){append_x_offset = x_offset; append_y_offset = y_offset;}; }; #endif diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index df2e1d27d..1b2d21295 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -63,7 +63,7 @@ CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int void CSignalBar::initDimensions() { //set current required dimensions and font size - sb_item_height = max(height, SB_MIN_HEIGHT) - 2*fr_thickness - append_h_offset; + sb_item_height = max(height, SB_MIN_HEIGHT) - 2*fr_thickness - append_x_offset; sb_item_top = height/2 - sb_item_height/2; if (sb_scale_height == -1) sb_scale_height = sb_item_height; @@ -99,8 +99,8 @@ void CSignalBar::initVarSigBar() { corner_rad = 0; corner_type = 0; - append_h_offset = 2; - append_v_offset = 2; + append_x_offset = 2; + append_y_offset = 2; height = SB_MIN_HEIGHT; sb_scale_height = -1; @@ -148,9 +148,9 @@ void CSignalBar::initSBarValue() } //move and set dimensions - int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_v_offset; + int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset; int vlbl_h = sb_scale->getHeight(); - int vlbl_y = sb_item_height/2 + sb_item_top - vlbl_h/2 - append_h_offset; + int vlbl_y = sb_item_height/2 + sb_item_top - vlbl_h/2 - append_x_offset; sb_vlbl->setDimensionsAll(vlbl_x, vlbl_y, sb_vlbl_width, vlbl_h); //set current text and body color color @@ -176,7 +176,7 @@ void CSignalBar::initSBarName() //move and set dimensions int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth(); int lbl_h = sb_vlbl->getHeight(); - int lbl_y = sb_item_height/2 + sb_item_top - lbl_h/2 - append_h_offset; + int lbl_y = sb_item_height/2 + sb_item_top - lbl_h/2 - append_x_offset; sb_lbl->setDimensionsAll(lbl_x, lbl_y, sb_lbl_width, lbl_h); //set current text and body color @@ -308,7 +308,7 @@ void CSignalBox::initSignalItems() // int corr_y = sbx_bar_height%2; // int sb_h = sbx_bar_height - corr_y; - int sbar_h = sbx_bar_height - fr_thickness - append_v_offset/2; + int sbar_h = sbx_bar_height - fr_thickness - append_y_offset/2; int sbar_w = sbx_bar_width - 2*fr_thickness; int sbar_x = sbx_bar_x + fr_thickness; int scale_h = sbar_h * 76 / 100; From 9de76bc073b05bf9b072d117a8d5b995257a3507 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 13 Feb 2014 18:17:59 +0100 Subject: [PATCH 64/67] CInfoViewer: Fix display progress bar with large fonts Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0be3cb731df9549be6345f906636184d999413cd Author: Michael Liebmann Date: 2014-02-13 (Thu, 13 Feb 2014) --- src/gui/infoviewer.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 1c13e020c..883883f91 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -219,10 +219,15 @@ void CInfoViewer::start () ChanNameY = BoxStartY + (ChanHeight / 2) + SHADOW_OFFSET; //oberkante schatten? ChanInfoX = BoxStartX + (ChanWidth / 3); - time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight()+5; + time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight(); time_left_width = 2 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getWidth(); /* still a kludge */ time_dot_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); time_width = time_left_width* 2+ time_dot_width; + + if (clock) { + delete clock; + clock = NULL; + } } void CInfoViewer::changePB() @@ -257,7 +262,6 @@ void CInfoViewer::paintTime (bool show_dot) if (clock == NULL){ clock = new CComponentsFrmClock(); clock->doPaintBg(false); - clock->setClockActiv(false); } clock->setColorBody(COL_INFOBAR_PLUS_0); @@ -770,8 +774,11 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con if(ChannelName.empty()) chann_size = 1; chname_width += (chname_width/chann_size/2); + + int tmpY = ((ChanNameY + time_height) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset() + + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitOffset()); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( - ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, + ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, prov_name, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8 } @@ -1544,17 +1551,17 @@ void CInfoViewer::display_Info(const char *current, const char *next, pb_shadow = 0; timescale->setShadowOnOff(false); } + int tmpY = CurrInfoY - height - ChanNameY + time_height - + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset()/3; switch(g_settings.infobar_progressbar) //set progressbar position { case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BELOW_CH_NAME: - pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 6)) ; pb_h = (pb_h/3); -// pb_color = 0; + pb_starty = ChanNameY + (tmpY-pb_h)/2; break; case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BELOW_CH_NAME_SMALL: - pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 5)) ; pb_h = (pb_h/5); -// pb_color = 0; + pb_starty = ChanNameY + (tmpY-pb_h)/2; break; case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BETWEEN_EVENTS: pb_starty = CurrInfoY + ((pb_h / 3)-(pb_h/5)) ; From c259eb1dc8abe37c355b025222e4d08875333212 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 13 Feb 2014 18:18:59 +0100 Subject: [PATCH 65/67] CComponentsFrmClock: Fix thread handling - Set clock activ = false for default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddc826ab511a1b90b4a0bafed455475654a49603 Author: Michael Liebmann Date: 2014-02-13 (Thu, 13 Feb 2014) --- src/gui/channellist.cpp | 2 +- src/gui/components/cc_frm_clock.cpp | 12 ++++++++++-- src/gui/components/cc_frm_clock.h | 4 ++-- src/gui/test_menu.cpp | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 91eaa3395..92cad4d56 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2123,7 +2123,7 @@ void CChannelList::paintHead() if (g_Sectionsd->getIsTimeSet()) { if (headerClock == NULL) { - headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M"); + headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M", true); headerClock->setClockBlink("%H %M"); headerClock->setClockIntervall(1); diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index c3d6e6bfe..e329ed275 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -76,11 +76,10 @@ void CComponentsFrmClock::initVarClock( const int& x_pos, const int& y_pos, cons cl_thread = 0; cl_interval = 1; - activeClock = true; cl_blink_str = ""; paintClock = false; - activeClock = activ; + activeClock = activ; if (activeClock) startThread(); } @@ -373,3 +372,12 @@ Font** CComponentsFrmClock::getClockFont() return cl_font; } + +void CComponentsFrmClock::setClockActiv(bool activ/* = true*/) +{ + activeClock = activ; + if (activ && !cl_thread) + startThread(); + if (!activ && cl_thread) + stopThread(); +} diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index f9065f877..81e0e7a59 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -94,7 +94,7 @@ class CComponentsFrmClock : public CComponentsForm public: CComponentsFrmClock( const int& x_pos = 1, const int& y_pos = 1, const int& w = 200, const int& h = 48, - const char* format_str = "%H:%M", bool activ=true, bool has_shadow = CC_SHADOW_OFF, + const char* format_str = "%H:%M", bool activ=false, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); virtual ~CComponentsFrmClock(); @@ -134,7 +134,7 @@ class CComponentsFrmClock : public CComponentsForm virtual void refresh() { initCCLockItems(); } ///set clock activ/inactiv - virtual void setClockActiv(bool activ = true){activeClock = activ;}; + virtual void setClockActiv(bool activ = true); }; #endif diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index ef833b272..b6a8efcba 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -610,7 +610,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "running_clock"){ if (clock_r == NULL){ - clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S"); + clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S", true); clock_r->setClockFont(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); clock_r->setClockIntervall(1); // clock_r->doPaintBg(false); From 746c78cb4e9242eaec85ec5caa969bafd18c8f33 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 13 Feb 2014 20:12:31 +0100 Subject: [PATCH 66/67] CControlAPI::EpgSearchXMLCGI convert channelname to xml Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e2e14e13439f16f7590d9c56578051182edfb71 Author: Jacek Jendrzej Date: 2014-02-13 (Thu, 13 Feb 2014) --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 283ce2871..3bb368d39 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1395,7 +1395,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) struct tm *tmStartZeit = localtime(&eventIterator->startTime); if(xml_forat){ hh->printf("\t"); - hh->printf("\t\t%s\n",NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()); + hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()).c_str());; hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.title.c_str()).c_str()); hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info1.c_str()).c_str()); hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str()); From c21df2be59ef38dc24da8a769b6cd786b7ac48c5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 14 Feb 2014 17:21:57 +0100 Subject: [PATCH 67/67] cables.xml: update as suggested by OneOfNine Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5707fe19a43608f6f86efa55160e847ec327bc94 Author: vanhofen Date: 2014-02-14 (Fri, 14 Feb 2014) Origin message was: ------------------ - cables.xml: update as suggested by OneOfNine --- data/cables.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/cables.xml b/data/cables.xml index 6ea231499..610fa2fc8 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -266,6 +266,9 @@ + + + @@ -309,6 +312,7 @@ +