From 898f7d7cdb9217760a2ff4ae3d60de9a5040c42f Mon Sep 17 00:00:00 2001 From: gixxpunk Date: Sat, 13 Oct 2012 17:10:25 +0200 Subject: [PATCH 001/116] Fix daylight saving time bug in timers (backport from tuxbox-cvs) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/636f7cef050b131b13ad58994b5e5ec2e5ee3aaa Author: gixxpunk Date: 2012-10-13 (Sat, 13 Oct 2012) Origin message was: ------------------ - Fix daylight saving time bug in timers (backport from tuxbox-cvs) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/stringinput_ext.cpp | 2 -- src/gui/widget/stringinput_ext.h | 1 - src/nhttpd/yhttpd_core/helper.cpp | 1 + 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 2f80729bc..44f29523f 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -516,7 +516,6 @@ void CDateInput::onBeforeExec() sprintf( value, "%02d.%02d.%04d %02d:%02d", tmTime->tm_mday, tmTime->tm_mon+1, tmTime->tm_year+1900, tmTime->tm_hour, tmTime->tm_min); - dst = tmTime->tm_isdst; } void CDateInput::onAfterExec() @@ -529,7 +528,6 @@ void CDateInput::onAfterExec() tmTime.tm_year -= 1900; tmTime.tm_sec = 0; - //tmTime.tm_isdst = dst; tmTime.tm_isdst = -1; if(tmTime.tm_year>129) diff --git a/src/gui/widget/stringinput_ext.h b/src/gui/widget/stringinput_ext.h index 42b632391..22ed53bb5 100644 --- a/src/gui/widget/stringinput_ext.h +++ b/src/gui/widget/stringinput_ext.h @@ -167,7 +167,6 @@ class CDateInput : public CExtendedInput { private: time_t* time; - int dst; protected: virtual void onBeforeExec(); diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 68d7b55e3..38b188ba2 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -44,6 +44,7 @@ void correctTime(struct tm *zt) { zt->tm_hour = minmax(zt->tm_hour, 0, 23); zt->tm_min = minmax(zt->tm_min, 0, 59); zt->tm_sec = minmax(zt->tm_sec, 0, 59); + zt->tm_isdst = -1; } //============================================================================= // Strings From c68517da219286cc7e8b88f292049a18262a363c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 14 Oct 2012 07:41:21 +0200 Subject: [PATCH 002/116] Timerlist: Ask if the timer of a running recording to be deleted. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/295efb1e0767f393ad9f5f2f7a45264c7b2b51b9 Author: Michael Liebmann Date: 2012-10-14 (Sun, 14 Oct 2012) Origin message was: ------------------ * Timerlist: Ask if the timer of a running recording to be deleted. ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/timerlist.cpp | 25 ++++++++++++++++++++++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index aee35cc1e..1ceef9b91 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1664,6 +1664,7 @@ timerbar.recordevent Aufnehmen timerlist.alarmtime Alarmzeit timerlist.apids Audio PIDs timerlist.apids_dflt Voreingestellte Tonspuren aufn. +timerlist.ask_to_delete Das Löschen des Timers beendet auch die laufende Aufnahme!\n%sTrotzdem fortsetzen? timerlist.bouquetselect Bouquet wählen timerlist.channel Kanal timerlist.channelselect Kanal wählen diff --git a/data/locale/english.locale b/data/locale/english.locale index d6c2b9976..61268eaa1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1664,6 +1664,7 @@ timerbar.recordevent Record timerlist.alarmtime Alarm time timerlist.apids Audio PIDs timerlist.apids_dflt record default audio streams +timerlist.ask_to_delete Deleting of the timer ends the current recording\n%sTo continue anyway? timerlist.bouquetselect choose bouquet timerlist.channel Channel timerlist.channelselect choose channel diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f5835073f..99dbd4591 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -571,9 +572,27 @@ int CTimerList::show() } else if ((msg == CRCInput::RC_red) && !(timerlist.empty())) { - Timer->removeTimerEvent(timerlist[selected].eventID); - skipEventID=timerlist[selected].eventID; - update=true; + bool killTimer = true; + if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) { + std::string title = ""; + char buf1[1024]; + CEPGData epgdata; + CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata); + memset(buf1, '\0', sizeof(buf1)); + if (epgdata.title != "") + title = "(" + epgdata.title + ")\n"; + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { + killTimer = false; + update = false; + } + } + if (killTimer) { + Timer->removeTimerEvent(timerlist[selected].eventID); + skipEventID=timerlist[selected].eventID; + update = true; + } } else if (msg==CRCInput::RC_green) { diff --git a/src/system/locals.h b/src/system/locals.h index 857ffefc8..c2abe62f3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1691,6 +1691,7 @@ typedef enum LOCALE_TIMERLIST_ALARMTIME, LOCALE_TIMERLIST_APIDS, LOCALE_TIMERLIST_APIDS_DFLT, + LOCALE_TIMERLIST_ASK_TO_DELETE, LOCALE_TIMERLIST_BOUQUETSELECT, LOCALE_TIMERLIST_CHANNEL, LOCALE_TIMERLIST_CHANNELSELECT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7f13792bb..a3047b3cd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1691,6 +1691,7 @@ const char * locale_real_names[] = "timerlist.alarmtime", "timerlist.apids", "timerlist.apids_dflt", + "timerlist.ask_to_delete", "timerlist.bouquetselect", "timerlist.channel", "timerlist.channelselect", From 9ddb345518eb03d4055bd56c67cda1b3514344a8 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 14 Oct 2012 11:15:57 +0100 Subject: [PATCH 003/116] Fix english.locale Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/76efa8b033cf176c0df9a25147331b6877f61ccf Author: Michael Liebmann Date: 2012-10-14 (Sun, 14 Oct 2012) Origin message was: ------------------ * Fix english.locale ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 61268eaa1..f2453031e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1664,7 +1664,7 @@ timerbar.recordevent Record timerlist.alarmtime Alarm time timerlist.apids Audio PIDs timerlist.apids_dflt record default audio streams -timerlist.ask_to_delete Deleting of the timer ends the current recording\n%sTo continue anyway? +timerlist.ask_to_delete Deletion of timer stops current recording!\n%sContinue anyway? timerlist.bouquetselect choose bouquet timerlist.channel Channel timerlist.channelselect choose channel From aed5fa411bfd544d9018acdd4402ff27a0c7e558 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 14 Oct 2012 17:03:43 +0200 Subject: [PATCH 004/116] neutrino.cpp: dvbtime fix update when box boot from deep standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3192a161f9fee32fd838af1273870b9e48ac43ad Author: Jacek Jendrzej Date: 2012-10-14 (Sun, 14 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a73662d29..c6b875f40 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3200,7 +3200,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) /* wasshift = */ CRecordManager::getInstance()->StopAutoRecord(); - if(!CRecordManager::getInstance()->RecordingStatus()) { + if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) { g_Zapit->setStandby(true); } else { g_Zapit->stopPlayBack(); @@ -3208,7 +3208,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) videoDecoder->Standby(true); - g_Sectionsd->setPauseScanning(true); + g_Sectionsd->setPauseScanning(!fromDeepStandby); g_Sectionsd->setServiceChanged(0, false); if(!CRecordManager::getInstance()->RecordingStatus() ) { From a91b8e5c22a3a55c34f3e102bcbabc38e5502a87 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 14 Oct 2012 17:05:43 +0200 Subject: [PATCH 005/116] unused funktions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5428d36da4c918b5f9ad8272b8ecde790339b5fe Author: Jacek Jendrzej Date: 2012-10-14 (Sun, 14 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 4 ++-- src/gui/filebrowser.h | 4 ++-- src/zapit/src/frontend.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 4e7f07f1f..18d431de1 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -232,7 +232,7 @@ unsigned char SMSKeyInput::getOldKey() const { return m_oldKey; } - +#if 0 const timeval* SMSKeyInput::getOldKeyTime() const { return &m_oldKeyTime; @@ -248,7 +248,7 @@ int SMSKeyInput::getTimeout() const { return m_timeout; } - +#endif void SMSKeyInput::setTimeout(int timeout) { m_timeout = timeout; diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index 3a20ab783..b1e92dabf 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -92,7 +92,7 @@ public: * @return the last key calculated by #handleMsg(neutrino_msg_t) */ unsigned char getOldKey() const; - +#if 0 /** * Returns time of last key push. * resolution: usecs @@ -106,7 +106,7 @@ public: time_t getOldKeyTimeSec() const; int getTimeout() const; - +#endif /** * Sets the timeout. * @param timeout keypresses within this period are taken as a diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 6b9088957..6bbb58eb0 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1033,7 +1033,7 @@ bool CFrontend::tuneChannel(CZapitChannel * /*channel*/, bool /*nvod*/) return false; return tuneFrequency(&transponder->second.feparams, transponder->second.polarization, false); } - +#if 0 bool CFrontend::retuneChannel(void) { mutex.lock(); @@ -1044,7 +1044,7 @@ bool CFrontend::retuneChannel(void) mutex.unlock(); return tuneFrequency(&transponder->second.feparams, transponder->second.polarization, true); } - +#endif int CFrontend::tuneFrequency(FrontendParameters * feparams, uint8_t polarization, bool nowait) { TP_params TP; From f15aa5b83fc1eab21b4dd6a6abf38159aa0ff92e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 15 Oct 2012 12:49:57 +0400 Subject: [PATCH 006/116] driver/genpsi.c: add fdatasync, this should wakeup hdd before record started Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/767a7d3871a887413f878bd6c10a9b49ecebc6d2 Author: [CST] Focus Date: 2012-10-15 (Mon, 15 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/genpsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/genpsi.c b/src/driver/genpsi.c index 381f0ac50..6724369ea 100644 --- a/src/driver/genpsi.c +++ b/src/driver/genpsi.c @@ -278,5 +278,6 @@ int genpsi(int fd2) //-- finish -- avPids.vpid=0; avPids.nba=0; + fdatasync(fd2); return 1; } From bcfaa7986a2d1fe3250a1778ca0e3bd3e330de1b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 15 Oct 2012 12:53:09 +0400 Subject: [PATCH 007/116] driver/record.cpp: stop radiotext before record start Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2a93f2dfdf5c957258276e00c7f9d67775f33740 Author: [CST] Focus Date: 2012-10-15 (Mon, 15 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 222f956e5..da3a29682 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1605,6 +1605,8 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend * g_Zapit->setRecordMode( true ); if(last_mode == NeutrinoMessages::mode_standby) g_Zapit->stopPlayBack(); + if ((live_channel_id == channel_id) && g_Radiotext) + g_Radiotext->radiotext_stop(); } if(last_mode == NeutrinoMessages::mode_standby) { //CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_standby); From 4bdd3aadc0a0a428aba004a5a281771456759e54 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 15 Oct 2012 13:02:03 +0400 Subject: [PATCH 008/116] neutrino.cpp: stop radiotext when going to standby and in stop_daemons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b97ed139c4e5423e3a6cd77c55d60dfdc0635e44 Author: [CST] Focus Date: 2012-10-15 (Mon, 15 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c6b875f40..673b81d87 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3200,6 +3200,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) /* wasshift = */ CRecordManager::getInstance()->StopAutoRecord(); + if(mode == mode_radio && g_Radiotext) + g_Radiotext->radiotext_stop(); + if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) { g_Zapit->setStandby(true); } else { @@ -3560,6 +3563,10 @@ void stop_daemons(bool stopall) tuxtxt_stop(); tuxtxt_close(); + if (g_Radiotext) { + delete g_Radiotext; + g_Radiotext = NULL; + } printf("httpd shutdown\n"); pthread_cancel(nhttpd_thread); pthread_join(nhttpd_thread, NULL); From 122e3fade5f675db20e3047a1869a4d2a60fb073 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 15 Oct 2012 12:10:28 +0200 Subject: [PATCH 009/116] miscsettings_menu.cpp: fix segfault on ZEE/HD1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f85251128ca2bb52a2f9fd0cefa50c156bedf347 Author: Jacek Jendrzej Date: 2012-10-15 (Mon, 15 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/miscsettings_menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 409d0ddd4..f19fc3994 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -227,7 +227,8 @@ int CMiscMenue::showMiscSettingsMenu() int res = misc_menue.exec(NULL, ""); delete fanNotifier; delete sectionsdConfigNotifier; - delete miscNotifier; + if(cs_get_revision() > 7) + delete miscNotifier; return res; } From fdb113c9b335c3a96d084644b27e7b3919010c94 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Oct 2012 15:42:10 +0200 Subject: [PATCH 010/116] fix memleak Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3db5f7f7c72d5f86204ffd320b499b417595787 Author: Jacek Jendrzej Date: 2012-10-16 (Tue, 16 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/motorcontrol.cpp | 4 ++-- src/gui/scan.cpp | 2 +- src/neutrino.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 8b43f99f5..627535772 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -308,7 +308,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) default: //printf("[motorcontrol] message received...\n"); if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) - delete (unsigned char*) data; + delete[] (unsigned char*) data; break; } } @@ -424,7 +424,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) default: //printf("[motorcontrol] message received...\n"); if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) - delete (unsigned char*) data; + delete[] (unsigned char*) data; break; } } diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index e11f0c099..e3b50c908 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -431,7 +431,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; default: if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) - delete (unsigned char*) data; + delete[] (unsigned char*) data; break; } return msg; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 673b81d87..3b7777dab 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2289,7 +2289,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if( res != messages_return::unhandled ) { if( ( msg>= CRCInput::RC_WithData ) && ( msg< CRCInput::RC_WithData+ 0x10000000 ) ) - delete (unsigned char*) data; + delete[] (unsigned char*) data; return( res & ( 0xFFFFFFFF - messages_return::unhandled ) ); } @@ -2810,7 +2810,7 @@ _repeat: ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); } - delete (unsigned char*) data; + delete[] (unsigned char*) data; return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_RECORDING_ENDED) { From 5af262a6104112bc5fc6107da00f4f683bb7cca7 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 16 Oct 2012 19:53:15 +0400 Subject: [PATCH 011/116] locals: add locale for slow record warning option Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5179aedb32dbe6460c4353b6920dd4ba240aa784 Author: [CST] Focus Date: 2012-10-16 (Tue, 16 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index f2453031e..a7ee4a06b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -925,6 +925,7 @@ menu.hint_record_apply Apply record options menu.hint_record_chandir Create directory with name of channel\nto store recording menu.hint_record_dir Select directory to store recordings menu.hint_record_end Stop direct record after max. time\nor after current event end time +menu.hint_record_slow_warn Show warning, when record buffer is close to overflow menu.hint_record_tdir Select directory to save timeshift recordings\nin temporary timeshift mode menu.hint_record_time Record time before stop when\nusing direct record with record button menu.hint_record_timeafter Stop record after event end\nin minutes @@ -1491,6 +1492,7 @@ recordingmenu.save_in_channeldir Save in channel dir recordingmenu.server server recordingmenu.server_mac MAC address recordingmenu.setupnow activate changes +recordingmenu.slow_warn Enable slow record warning recordingmenu.timeshift Timeshift recordingmenu.tsdir Timeshift directory recordingmenu.vcr vcr diff --git a/src/system/locals.h b/src/system/locals.h index c2abe62f3..29b828e6e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -952,6 +952,7 @@ typedef enum LOCALE_MENU_HINT_RECORD_CHANDIR, LOCALE_MENU_HINT_RECORD_DIR, LOCALE_MENU_HINT_RECORD_END, + LOCALE_MENU_HINT_RECORD_SLOW_WARN, LOCALE_MENU_HINT_RECORD_TDIR, LOCALE_MENU_HINT_RECORD_TIME, LOCALE_MENU_HINT_RECORD_TIMEAFTER, @@ -1518,6 +1519,7 @@ typedef enum LOCALE_RECORDINGMENU_SERVER, LOCALE_RECORDINGMENU_SERVER_MAC, LOCALE_RECORDINGMENU_SETUPNOW, + LOCALE_RECORDINGMENU_SLOW_WARN, LOCALE_RECORDINGMENU_TIMESHIFT, LOCALE_RECORDINGMENU_TSDIR, LOCALE_RECORDINGMENU_VCR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a3047b3cd..8cf65aa5a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -952,6 +952,7 @@ const char * locale_real_names[] = "menu.hint_record_chandir", "menu.hint_record_dir", "menu.hint_record_end", + "menu.hint_record_slow_warn", "menu.hint_record_tdir", "menu.hint_record_time", "menu.hint_record_timeafter", @@ -1518,6 +1519,7 @@ const char * locale_real_names[] = "recordingmenu.server", "recordingmenu.server_mac", "recordingmenu.setupnow", + "recordingmenu.slow_warn", "recordingmenu.timeshift", "recordingmenu.tsdir", "recordingmenu.vcr", From 4c0de3ae90b55212ee41b4d704638c852bd628eb Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 16 Oct 2012 19:53:47 +0400 Subject: [PATCH 012/116] settings: add option to enable/disable slow record warning Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b6ad61b0de8af2a484493248db53ff9e2fec73da Author: [CST] Focus Date: 2012-10-16 (Tue, 16 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/record_setup.cpp | 4 ++++ src/neutrino.cpp | 6 ++++-- src/system/settings.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index aced80cda..599754ece 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -199,6 +199,10 @@ int CRecordSetup::showRecordSetup() end_of_recording->setHint("", LOCALE_MENU_HINT_RECORD_END); recordingSettings->addItem(end_of_recording); + CMenuOptionChooser* slow_warn = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SLOW_WARN, &g_settings.recording_slow_warning, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + slow_warn->setHint("", LOCALE_MENU_HINT_RECORD_SLOW_WARN); + recordingSettings->addItem(slow_warn); + //template //CStringInput recordingSettings_filenameTemplate(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template[0], 21, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_IPSETUP_HINT_2, "%/-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "); //CMenuForwarder* mf11 = new CMenuForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template[0], &recordingSettings_filenameTemplate); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3b7777dab..db8db3ba2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -582,14 +582,15 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_stopsectionsd = configfile.getBool("recording_stopsectionsd" , false ); g_settings.recording_audio_pids_default = configfile.getInt32("recording_audio_pids_default", TIMERD_APIDS_STD | TIMERD_APIDS_AC3); g_settings.recording_zap_on_announce = configfile.getBool("recording_zap_on_announce" , false); - g_settings.shutdown_timer_record_type = configfile.getBool("shutdown_timer_record_type" , false); + g_settings.shutdown_timer_record_type = configfile.getBool("shutdown_timer_record_type" , false); g_settings.recording_stream_vtxt_pid = configfile.getBool("recordingmenu.stream_vtxt_pid" , false); g_settings.recording_stream_pmt_pid = configfile.getBool("recordingmenu.stream_pmt_pid" , false); g_settings.recording_choose_direct_rec_dir = configfile.getInt32( "recording_choose_direct_rec_dir", 0 ); g_settings.recording_epg_for_filename = configfile.getBool("recording_epg_for_filename" , true); g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , false); - g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); + g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); + g_settings.recording_slow_warning = configfile.getBool("recording_recording_slow_warning" , true); // default plugin for movieplayer g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); @@ -1004,6 +1005,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool ("recording_epg_for_filename" , g_settings.recording_epg_for_filename ); configfile.setBool ("recording_epg_for_end" , g_settings.recording_epg_for_end ); configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); + configfile.setBool ("recording_slow_warning" , g_settings.recording_slow_warning ); // default plugin for movieplayer configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); diff --git a/src/system/settings.h b/src/system/settings.h index d3f04a3e5..84f3f4bca 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -326,6 +326,7 @@ struct SNeutrinoSettings int recording_epg_for_end; int recording_save_in_channeldir; int recording_zap_on_announce; + int recording_slow_warning; int shutdown_timer_record_type; int filesystem_is_utf8; From e90a37df9ee1893b7110525d436b38a0fc4655e2 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 16 Oct 2012 19:58:58 +0400 Subject: [PATCH 013/116] driver/record.cpp: use slow record warning option. this warning tested for generic setup with usb hdd and meant to early tell if record buffer usage reach watermark, where user have chance to stop some of records and save others from overflow under high load. if your think you getting false warnings, disable it Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d771f625a0683b3a3f65fa1f6e0498f79bf59315 Author: [CST] Focus Date: 2012-10-16 (Tue, 16 Oct 2012) ------------------ This commit was generated by Migit --- 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 da3a29682..636149ff0 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1182,7 +1182,7 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data error_display = false; warn_display = false; DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); - } else if (warn_display) { + } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW)); } From 7828a3d38644853589479925077de876959f9eee Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 Oct 2012 13:34:13 +0200 Subject: [PATCH 014/116] neutrino.cpp: fix c&p error in recording_slow_warning Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7eb4f3b9c187a02fa3602489b73f3f1c7b082266 Author: vanhofen Date: 2012-10-17 (Wed, 17 Oct 2012) Origin message was: ------------------ - neutrino.cpp: fix c&p error in recording_slow_warning ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index db8db3ba2..00de5d9b7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -590,7 +590,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_epg_for_filename = configfile.getBool("recording_epg_for_filename" , true); g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , false); g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); - g_settings.recording_slow_warning = configfile.getBool("recording_recording_slow_warning" , true); + g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); // default plugin for movieplayer g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); From 8c4b49dad7f598ab93172458fcd2265a6957aebd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 17 Oct 2012 13:53:12 +0200 Subject: [PATCH 015/116] deutsch.locale: add locals for slow_record stuff Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58f8e4e45249938509c2e07e1795c7fb69c6bb25 Author: vanhofen Date: 2012-10-17 (Wed, 17 Oct 2012) Origin message was: ------------------ - deutsch.locale: add locals for slow_record stuff ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1ceef9b91..e45ffccfe 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -925,6 +925,7 @@ menu.hint_record_apply Hiermit werden die Aufnahmeoptionen übernommen menu.hint_record_chandir Diese Option speichert Aufnahmen mit dem Namen des Kanals\nin ein eigenes Verzeichnis menu.hint_record_dir Hier wählen Sie das Aufnahmeverzeichnis menu.hint_record_end Hier können Sie wählen zwischen max. Aufnahmezeit\noder anhand der EPG-Daten +menu.hint_record_slow_warn Zeige Warnung, wenn Aufnahmepuffer zu überlaufen droht menu.hint_record_tdir Wählen Sie eine Verzeichnis für Ihre Timeshift-Aufnahmen\nim temporären Timeshiftmodus menu.hint_record_time Hier wird die maximale Zeit in Stunden eingetragen außer\nSie stoppen die Aufnahme vorzeitig menu.hint_record_timeafter Hier kann die Endzeit für den Aufnahmetimer eingestellt werden,\nein Wert von 2, beendet die Aufnahme 2 Minuten nach dem Sendungsende @@ -1491,6 +1492,7 @@ recordingmenu.save_in_channeldir Speichere im Kanalverzeichnis recordingmenu.server Server recordingmenu.server_mac MAC-Adresse recordingmenu.setupnow Einstellungen jetzt übernehmen +recordingmenu.slow_warn Warnung bei langsamen Aufnahmemedien recordingmenu.timeshift Timeshift recordingmenu.tsdir Timeshift Aufnahmeverzeichnis recordingmenu.vcr Videorekorder From 7d937f846a248784eeafac6be8031539c60d876f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 Oct 2012 15:34:50 +0200 Subject: [PATCH 016/116] infoviewer_bb.cpp: dont show CA Status in TS mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8474038c27280bdc77711c31d2d60490f40988bd Author: Jacek Jendrzej Date: 2012-10-17 (Wed, 17 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 7502bad65..2a3c235db 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -711,14 +711,22 @@ void CInfoViewerBB::paint_ca_icons(int caid, char * icon, int &icon_space_offset void CInfoViewerBB::showIcon_CA_Status(int notfirst) { + + if (g_settings.casystem_display == 3) + return; + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()){ + if (g_settings.casystem_display == 2) { + fta = true; + showOne_CAIcon(); + } + return; + } + int caids[] = { 0x900, 0xD00, 0xB00, 0x1800, 0x0500, 0x0100, 0x600, 0x2600, 0x4a00, 0x0E00 }; const char * white = (char *) "white"; const char * yellow = (char *) "yellow"; int icon_space_offset = 0; - if (g_settings.casystem_display == 3) - return; - if(!g_InfoViewer->chanready) { if (g_settings.casystem_display == 2) { fta = true; From 5118d4bdf9578eeb56ba743e1947d949613d5b19 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 Oct 2012 21:39:44 +0200 Subject: [PATCH 017/116] movieplayer: show current AudioName in infoviewer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3fd2a73d775ad55971e3604576f2e261316f26bd Author: Jacek Jendrzej Date: 2012-10-17 (Wed, 17 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.cpp | 11 +++-- src/gui/movieplayer.cpp | 95 +++++++++++++++++++++++++++------------ src/gui/movieplayer.h | 5 ++- 3 files changed, 77 insertions(+), 34 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 2a3c235db..006a529b7 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -233,10 +234,13 @@ void CInfoViewerBB::getBBButtonInfo() text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN]; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; - if (!g_RemoteControl->current_PIDs.APIDs.empty()) { + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){ + text = CMoviePlayerGui::getInstance().CurrentAudioName(); + }else if (!g_RemoteControl->current_PIDs.APIDs.empty()) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; - if (text.empty()) + if (text.empty()){ text = g_RemoteControl->current_PIDs.APIDs[selected].desc; + } } break; case CInfoViewerBB::BUTTON_SUBS: @@ -711,10 +715,9 @@ void CInfoViewerBB::paint_ca_icons(int caid, char * icon, int &icon_space_offset void CInfoViewerBB::showIcon_CA_Status(int notfirst) { - if (g_settings.casystem_display == 3) return; - if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()){ + if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode() && !CMoviePlayerGui::getInstance().timeshift){ if (g_settings.casystem_display == 2) { fta = true; showOne_CAIcon(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d2b299c5b..52d40ac9a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -697,6 +697,9 @@ void CMoviePlayerGui::callInfoViewer(const int duration, const int curr_pos) CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID()); return; } + currentaudioname = "Unk"; + getCurrentAudioName( is_file_player, currentaudioname); + if (isMovieBrowser && p_movie_info) { g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1, duration, curr_pos); @@ -721,6 +724,68 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; } +void CMoviePlayerGui::addAudioFormat(int count, std::string &apidtitle, bool file_player, bool& enabled) +{ + switch(ac3flags[count]) + { + case 1: /*AC3,EAC3*/ + if (apidtitle.find("AC3") == std::string::npos || file_player) + apidtitle.append(" (AC3)"); + break; + case 2: /*teletext*/ + apidtitle.append(" (Teletext)"); + enabled = false; + break; + case 3: /*MP2*/ + apidtitle.append("( MP2)"); + break; + case 4: /*MP3*/ + apidtitle.append(" (MP3)"); + break; + case 5: /*AAC*/ + apidtitle.append(" (AAC)"); + break; + case 6: /*DTS*/ + apidtitle.append(" (DTS)"); + enabled = false; + break; + case 7: /*MLP*/ + apidtitle.append(" (MLP)"); + break; + default: + break; + } +} + +void CMoviePlayerGui::getCurrentAudioName( bool file_player, std::string &audioname) +{ + if(file_player && !numpida){ + playback->FindAllPids(apids, ac3flags, &numpida, language); + /* fix current pid in case of file play */ + if(numpida) + currentapid = apids[0]; + } + bool dumm = true; + for (unsigned int count = 0; count < numpida; count++) { + + if(currentapid == apids[count]){ + if(!file_player){ + getAudioName(apids[count], audioname); + return ; + }else if (!language[count].empty()){ + audioname = language[count]; + addAudioFormat(count, audioname, file_player, dumm); + return ; + } + char apidnumber[20]; + sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]); + audioname = apidnumber; + addAudioFormat(count, audioname, file_player, dumm); + return ; + } + } +} + void CMoviePlayerGui::selectAudioPid(bool file_player) { CMenuWidget APIDSelector(LOCALE_APIDSELECTOR_HEAD, NEUTRINO_ICON_AUDIO); @@ -753,36 +818,8 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]); apidtitle = apidnumber; } + addAudioFormat(count, apidtitle, file_player, enabled); - switch(ac3flags[count]) - { - case 1: /*AC3,EAC3*/ - if (apidtitle.find("AC3") == std::string::npos || file_player) - apidtitle.append(" (AC3)"); - break; - case 2: /*teletext*/ - apidtitle.append(" (Teletext)"); - enabled = false; - break; - case 3: /*MP2*/ - apidtitle.append("( MP2)"); - break; - case 4: /*MP3*/ - apidtitle.append(" (MP3)"); - break; - case 5: /*AAC*/ - apidtitle.append(" (AAC)"); - break; - case 6: /*DTS*/ - apidtitle.append(" (DTS)"); - enabled = false; - break; - case 7: /*MLP*/ - apidtitle.append(" (MLP)"); - break; - default: - break; - } char cnt[5]; sprintf(cnt, "%d", count); CMenuForwarderNonLocalized * item = new CMenuForwarderNonLocalized(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1)); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 1ede8b215..31125f1a1 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -69,7 +69,7 @@ class CMoviePlayerGui : public CMenuTarget std::string full_name; std::string file_name; - + std::string currentaudioname; bool playing; CMoviePlayerGui::state playstate; int speed; @@ -112,6 +112,8 @@ class CMoviePlayerGui : public CMenuTarget void fillPids(); bool getAudioName(int pid, std::string &apidtitle); void selectAudioPid(bool file_player); + void getCurrentAudioName( bool file_player, std::string &audioname); + void addAudioFormat(int count, std::string &apidtitle, bool file_player, bool& enabled ); void handleMovieBrowser(neutrino_msg_t msg, int position = 0); bool SelectFile(); @@ -127,6 +129,7 @@ class CMoviePlayerGui : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); bool Playing() { return playing; }; + std::string CurrentAudioName() { return currentaudioname; }; int timeshift; int file_prozent; }; From f3f4ca02a532f8a65aecef3a7a98ff74087af72a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 Oct 2012 22:54:45 +0200 Subject: [PATCH 018/116] movieplayer.cpp: fix current pid in case of file play Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7580d928f3b2f8e24bc1f7ce6a7a497718b8b237 Author: Jacek Jendrzej Date: 2012-10-17 (Wed, 17 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 52d40ac9a..7d2f038e4 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -726,6 +726,7 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) void CMoviePlayerGui::addAudioFormat(int count, std::string &apidtitle, bool file_player, bool& enabled) { + enabled = true; switch(ac3flags[count]) { case 1: /*AC3,EAC3*/ @@ -761,7 +762,6 @@ void CMoviePlayerGui::getCurrentAudioName( bool file_player, std::string &audion { if(file_player && !numpida){ playback->FindAllPids(apids, ac3flags, &numpida, language); - /* fix current pid in case of file play */ if(numpida) currentapid = apids[0]; } @@ -775,12 +775,20 @@ void CMoviePlayerGui::getCurrentAudioName( bool file_player, std::string &audion }else if (!language[count].empty()){ audioname = language[count]; addAudioFormat(count, audioname, file_player, dumm); + if(!dumm && (count < numpida)){ + currentapid = apids[count+1]; + continue; + } return ; } char apidnumber[20]; sprintf(apidnumber, "Stream %d %X", count + 1, apids[count]); audioname = apidnumber; addAudioFormat(count, audioname, file_player, dumm); + if(!dumm && (count < numpida)){ + currentapid = apids[count+1]; + continue; + } return ; } } @@ -796,7 +804,6 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) if(file_player && !numpida){ playback->FindAllPids(apids, ac3flags, &numpida, language); - /* fix current pid in case of file play */ if(numpida) currentapid = apids[0]; } @@ -819,6 +826,10 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) apidtitle = apidnumber; } addAudioFormat(count, apidtitle, file_player, enabled); + if(defpid && !enabled && (count < numpida)){ + currentapid = apids[count+1]; + defpid = false; + } char cnt[5]; sprintf(cnt, "%d", count); From 21e6592357a359c46a3f914e78bfa82f9e1ee0d1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 18 Oct 2012 13:53:13 +0400 Subject: [PATCH 019/116] gui/start_wizard.cpp: ask about initial settings on satellite box only Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d4c6165ac91e312fbfc160cf9f5991cc7394810 Author: [CST] Focus Date: 2012-10-18 (Thu, 18 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/start_wizard.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 29a4ef9fe..292bcc9f1 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -105,7 +105,10 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) res = CScanSetup::getInstance()->exec(NULL, ""); CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO); } - bool init_settings = file_exists("/var/tuxbox/config/initial/"); + bool init_settings = false; + if (g_info.delivery_system == DVB_S) + init_settings = file_exists("/var/tuxbox/config/initial/"); + if(init_settings && (res != menu_return::RETURN_EXIT_ALL)) { if (ShowMsgUTF(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), From f14b819bac136c1a87d2cb1c511fdbb587866f12 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 18 Oct 2012 17:11:56 +0200 Subject: [PATCH 020/116] buttons.cpp: -fix skip last button txt Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/840ba47db1261b26ece9d204cce0ac31709aea0b Author: Jacek Jendrzej Date: 2012-10-18 (Thu, 18 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index bffb99a66..a97a5a3bc 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -132,7 +132,7 @@ int paintButtons( const int &x, //workaround for to small screen (1) int skip_last_button_txt = false; - if( (w_footer > 0) && ( (w_button*cnt) > (uint) w_footer) ){ + if( (w_footer > 0) && ( ((w_button*cnt) + ((cnt -1) * w_space)) > (uint) w_footer) ){ w_button= ((w_footer+w_max_icon)/(cnt)); skip_last_button_txt = true; } From 3e28f86c8565e3965f067060882f222f521c7492 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 18 Oct 2012 17:17:00 +0200 Subject: [PATCH 021/116] bouquetlist.cpp: fix width for buttontext Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a6f9467c97eda26fc492651d72f924f7cbb482c Author: Jacek Jendrzej Date: 2012-10-18 (Thu, 18 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 009885b51..80adc7b31 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -292,24 +292,40 @@ int CBouquetList::doMenu() return 0; } +const struct button_label CBouquetListButtons[4] = +{ + { NEUTRINO_ICON_BUTTON_RED, LOCALE_CHANNELLIST_FAVS}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_PROVS}, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_CHANNELLIST_SATS}, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_CHANNELLIST_HEAD} +}; + /* bShowChannelList default to true, returns new bouquet or -1/-2 */ int CBouquetList::show(bool bShowChannelList) { neutrino_msg_t msg; neutrino_msg_data_t data; int res = -1; + int icol_w, icol_h; + int w_max_text = 0; + int w_max_icon = 0; + for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ + int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText (CBouquetListButtons[count].locale),true); + w_max_text = std::max(w_max_icon, w_text); + frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); + w_max_icon = std::max(w_max_icon, icol_w); + } //if(Bouquets.size()==0) // return res; - + int need_width = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0])*(w_max_icon + w_max_text + 20); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - width = w_max (g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth()*52, 20);//500 + width = w_max (need_width, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth()*52);//500 height = h_max (16 * fheight, 40); /* assuming all color icons must have same size */ - int icol_w, icol_h; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); footerHeight = std::max(icol_h+8, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8); //TODO get footerHeight from buttons @@ -579,14 +595,6 @@ void CBouquetList::paintItem(int pos) } } -const struct button_label CBouquetListButtons[4] = -{ - { NEUTRINO_ICON_BUTTON_RED, LOCALE_CHANNELLIST_FAVS}, - { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_PROVS}, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_CHANNELLIST_SATS}, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_CHANNELLIST_HEAD} -}; - void CBouquetList::paintHead() { frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); From dfdebd67eacc9d7321470fe18b15b4119ddff23c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 18 Oct 2012 20:21:19 +0200 Subject: [PATCH 022/116] neutrino.cpp: make sleeptimer similar to shutdown with MsgBox at announce Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5002a8bfa7350f0777a6ecff8a88a41d649f3750 Author: Jacek Jendrzej Date: 2012-10-18 (Thu, 18 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 24 ++++++++---------------- src/neutrino.h | 1 + 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 00de5d9b7..0e46f62ff 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -227,6 +227,7 @@ CNeutrinoApp::CNeutrinoApp() TVchannelList = NULL; RADIOchannelList = NULL; skipShutdownTimer = false; + skipSleepnTimer = false; current_muted = 0; recordingstatus = 0; g_channel_list_changed = 0; @@ -2724,28 +2725,19 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { - if( mode != mode_scart ) - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SLEEPTIMERBOX_ANNOUNCE)); + if( mode != mode_scart && mode != mode_standby) + skipSleepnTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); return messages_return::handled; } else if( msg == NeutrinoMessages::SLEEPTIMER) { - if(data) { - skipShutdownTimer = - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, - CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME - if(skipShutdownTimer) { - printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); - skipShutdownTimer = false; - return messages_return::handled; - } - else { - printf("NeutrinoMessages::SLEEPTIMER: shutdown\n"); - ExitRun(true, (cs_get_revision() > 7)); - } + if(skipSleepnTimer) { + printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); + skipSleepnTimer = false; + return messages_return::handled; } if(g_settings.shutdown_real) ExitRun(true, (cs_get_revision() > 7)); - else + else if(mode != mode_standby) standbyMode( true ); return messages_return::handled; } diff --git a/src/neutrino.h b/src/neutrino.h index 3ff32bf3e..bfdcb4232 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -118,6 +118,7 @@ private: int current_muted; bool skipShutdownTimer; + bool skipSleepnTimer; bool pbBlinkChange; int tvsort[LIST_MODE_LAST]; From b78de4a6d8d669b9636ab2d7a6222b8c08948ab4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 19 Oct 2012 10:53:43 +0200 Subject: [PATCH 023/116] update locale for commit dfdebd67eacc9d7321470fe18b15b4119ddff23c Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c50487fc8b6532bb3c22c067ba5f3792648b8c8b Author: Jacek Jendrzej Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index e45ffccfe..c9d6cc170 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1631,7 +1631,7 @@ settings.restore Image-Einstellungen: Wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? shutdown.recoding_query Aufnahme läuft. Trotzdem beenden? shutdowntimer.announce Die Box wird in 1 Min. heruntergefahren.\nShutdown abbrechen? -sleeptimerbox.announce Sleeptimer in 1 min +sleeptimerbox.announce Die Box wird in 1 Min. in Standby-Betrieb gehen.\nStandby-Betrieb abbrechen? sleeptimerbox.hint1 Ausschaltzeit in Min. (000=aus) sleeptimerbox.hint2 Die Box schaltet sich nach dieser Standby-Zeit aus. sleeptimerbox.hint3 Die Box schaltet sich bei Nichtbenutzen der FB aus. diff --git a/data/locale/english.locale b/data/locale/english.locale index a7ee4a06b..c4263b4eb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1631,7 +1631,7 @@ settings.restore Image-Settings: Restore settings.restore_warn This will replace all settings and reboot\nContinue ? shutdown.recoding_query You really want to to stop record ? shutdowntimer.announce Box will shutdown in 1 min.\nCancel Shutdown ? -sleeptimerbox.announce Sleeptimer in 1 min +sleeptimerbox.announce Box will standby in 1 min.\nCancel Standby ? sleeptimerbox.hint1 Shutdown time in min. (000=off) sleeptimerbox.hint2 The STB will shutdown after this time in standby. sleeptimerbox.hint3 The STB will shutdown, if remote not used. From d65b0f14658176348615b7dd766c6b02fd3fed97 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 19 Oct 2012 12:21:47 +0200 Subject: [PATCH 024/116] satellites.xml: update hotbird13 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d21f7ca946bfdbff0aba5411c6e19f6e2469fa60 Author: Jacek Jendrzej Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/satellites.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/satellites.xml b/data/satellites.xml index 4e23f57fc..66bad02de 100755 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -1375,7 +1375,7 @@ - + From 125a76695e0698a9abcaaf60b0733e1fd1050629 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 19 Oct 2012 19:19:55 +0400 Subject: [PATCH 025/116] gui/widget/components.h: change paint() do_save_bg arg default to false - save screen used rare Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/90d03ede274a3c7693daae872ee4f5303ef7e09a Author: [CST] Focus Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/components.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/components.h b/src/gui/widget/components.h index 78f2bed53..c7ec2586a 100644 --- a/src/gui/widget/components.h +++ b/src/gui/widget/components.h @@ -80,7 +80,7 @@ class CComponentsDetailLine : public CComponents fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ~CComponentsDetailLine(); - void paint(bool do_save_bg = true); + void paint(bool do_save_bg = false); void hide(); void setColor(fb_pixel_t color_line, fb_pixel_t color_shadow){col_line = color_line; col_shadow = color_shadow;}; void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; @@ -101,7 +101,7 @@ class CComponentsInfoBox : public CComponents CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h, bool has_shadow = true, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENTDARK_PLUS_0,fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - void paint(bool do_save_bg = true, bool fullPaint = false); + void paint(bool do_save_bg = false, bool fullPaint = false); void hide(); void restore(bool clear_ = true); void setColor(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;}; From 21d965079796cc3f5a7c6c6cd19b862d79f3d9b9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 19 Oct 2012 19:22:44 +0400 Subject: [PATCH 026/116] gui/widget/components.cpp: fix CComponentsInfoBox::hide(): call paint() with fullPaint=true to hide frame Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5d055324ec208566c98ebabb3dc5519a290205df Author: [CST] Focus Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/widget/components.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/components.cpp b/src/gui/widget/components.cpp index 52f64db69..be43e39b5 100644 --- a/src/gui/widget/components.cpp +++ b/src/gui/widget/components.cpp @@ -275,7 +275,7 @@ void CComponentsInfoBox::hide() col_body = col_frame = col_shadow = COL_BACKGROUND; //paint with background and restore, set last used colors - paint(false); + paint(false, true); col_body = c_tmp1; col_shadow = c_tmp2; col_frame = c_tmp3; From d75e4c51145d1ccbbf218d3fa4003e2d4fc1f3a0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 19 Oct 2012 19:30:28 +0400 Subject: [PATCH 027/116] gui/widget/menue.cpp: always call paintHint(-1) in hide() to clear hintbox; comment additional hintbox w/h from full_width/full_height - CComponents should clear itself; dont always save/restore menu hint screens - why it was enabled ?? comment GenericMenuBack->setHint() in ::exec - checkHints() do the same Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/405ac286e3cc73340f5b05c125a5342b2fa59de4 Author: [CST] Focus Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 48 ++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 23af427ce..3b6389265 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -491,10 +491,14 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) } } } +#if 0 GenericMenuBack->setHint("", NONEXISTANT_LOCALE); +#endif checkHints(); +#if 0 if (has_hints) GenericMenuBack->setHint(NEUTRINO_ICON_HINT_BACK, LOCALE_MENU_HINT_BACK); +#endif if(savescreen) { calcSize(); @@ -758,8 +762,9 @@ void CMenuWidget::hide() restoreScreen();//FIXME else { frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height); - paintHint(-1); + //paintHint(-1); } + paintHint(-1); /* setActive() paints item for hidden parent menu, if called from child menu */ for (unsigned int count = 0; count < items.size(); count++) @@ -878,8 +883,8 @@ void CMenuWidget::calcSize() if(total_pages > 1) sb_width=15; - full_width = ConnectLineBox_Width+width+sb_width+SHADOW_OFFSET; - full_height = height+RADIUS_LARGE+SHADOW_OFFSET*2+hint_height+INFO_BOX_Y_OFFSET; + full_width = /*ConnectLineBox_Width+*/width+sb_width+SHADOW_OFFSET; + full_height = height+RADIUS_LARGE+SHADOW_OFFSET*2 /*+hint_height+INFO_BOX_Y_OFFSET*/; setMenuPos(width - sb_width); } @@ -1039,14 +1044,14 @@ void CMenuWidget::saveScreen() background = new fb_pixel_t [full_width * full_height]; if(background) - frameBuffer->SaveScreen(x-ConnectLineBox_Width, y, full_width, full_height, background); + frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x-ConnectLineBox_Width, y, full_width, full_height, background); + frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height, background); } } @@ -1075,12 +1080,22 @@ void CMenuWidget::paintHint(int pos) if (hint_painted) { /* clear detailsline line */ - if (details_line != NULL) - details_line->restore(); + // TODO CComponents::hide with param restore ? or auto (if it have saved screens) ? + if (details_line != NULL) { + if (savescreen) + details_line->restore(); + else + details_line->hide(); + } /* clear info box */ - if (info_box != NULL) - if (pos == -1) - info_box->restore(); + if (info_box != NULL) { + if (pos == -1) { + if (savescreen) + info_box->restore(); + else + info_box->hide(); + } + } hint_painted = false; } if (pos < 0) @@ -1090,8 +1105,12 @@ void CMenuWidget::paintHint(int pos) //printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText(item->hint)); if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) { - if (info_box != NULL) - info_box->restore(); + if (info_box != NULL) { + if (savescreen) + info_box->restore(); + else + info_box->hide(); + } return; } @@ -1114,7 +1133,7 @@ void CMenuWidget::paintHint(int pos) details_line->setYPosDown(ypos2a); details_line->setHMarkDown(markh); } - details_line->paint(); + details_line->paint(savescreen); if (info_box == NULL) info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height); @@ -1123,7 +1142,8 @@ void CMenuWidget::paintHint(int pos) info_box->setYPos(ypos2); info_box->setWidth(iwidth); } - info_box->paint(); + /* force full paint - menu-over i.e. option chooser with pulldown can overwrite */ + info_box->paint(savescreen, true); int offset = 10; if (!item->hintIcon.empty()) { From de57f7c98a79ab764ad9623fce8fd6b75884c39b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 19 Oct 2012 19:21:18 +0200 Subject: [PATCH 028/116] movieplayer.cpp: fix adjusting audio PID name Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f5bf8ef85bc12f0810728de105e1313b7d098f7 Author: Jacek Jendrzej Date: 2012-10-19 (Fri, 19 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 7d2f038e4..6e5446e29 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -848,7 +848,7 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) APIDSelector.addItem(new CMenuOptionNumberChooser(NONEXISTANT_LOCALE, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance(), 0, 0, NONEXISTANT_LOCALE, - g_RemoteControl->current_PIDs.APIDs[i].desc)); + p_movie_info->audioPids[i].epgAudioPidName.c_str())); } } From ce7f43955918f71f30d8ca8374c17dee04caf522 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 20 Oct 2012 11:13:22 +0400 Subject: [PATCH 029/116] gui/osd_setup.cpp: set hints for channel list context menu -> settings, testing menu/hints over gui with save-screen. TODO: still small glitch at menu bottom, when switching hints on/off with help button, sometimes. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/483e9563e522da254960a5b5d093990d991c1666 Author: [CST] Focus Date: 2012-10-20 (Sat, 20 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 82a6df825..66abb6891 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -890,19 +890,30 @@ int COsdSetup::showContextChanlistMenu() menu_chanlist->enableFade(false); menu_chanlist->setSelected(cselected); - menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); + menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); - menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true)); - menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); - menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true)); - menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true)); + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); + menu_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); + menu_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_FOOT); + menu_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_COLORED); + menu_chanlist->addItem(mc); CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING); fontSettingsSubMenu->enableSaveScreen(true); fontSettingsSubMenu->enableFade(false); int i = 1; - fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); + fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); for (unsigned int j = 0; j < font_sizes_groups[i].count; j++) { @@ -910,7 +921,10 @@ int COsdSetup::showContextChanlistMenu() } fontSettingsSubMenu->addItem(GenericMenuSeparatorLine); fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey)); - menu_chanlist->addItem(new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, "", CRCInput::convertDigitToKey(0))); + + CMenuForwarder * mf = new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + mf->setHint("", LOCALE_MENU_HINT_FONTS); + menu_chanlist->addItem(mf); int res = menu_chanlist->exec(NULL, ""); cselected = menu_chanlist->getSelected(); From 65a0f6984bc1406e7f96f7b4fbb8207f8d8849a3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Oct 2012 13:20:49 +0200 Subject: [PATCH 030/116] Neutrino: Channel list: add method isEmpty() and use it, ported from tuxbox cvs (THX Gaucho316) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/35138088e3bab4df890e0d3232d9da46d08e0009 Author: Jacek Jendrzej Date: 2012-10-20 (Sat, 20 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 4 ++-- src/gui/channellist.cpp | 17 +++++++++++------ src/gui/channellist.h | 1 + src/gui/epgplus.cpp | 10 +++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 80adc7b31..9307341a3 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -498,7 +498,7 @@ int CBouquetList::show(bool bShowChannelList) } else if ( msg == CRCInput::RC_ok ) { - if(!bShowChannelList || Bouquets[selected]->channelList->getSize() > 0) { + if(!bShowChannelList || !Bouquets[selected]->channelList->isEmpty()) { zapOnExit = true; loop=false; } @@ -577,7 +577,7 @@ void CBouquetList::paintItem(int pos) CVFD::getInstance()->showMenuText(0, lname, -1, true); } else { if(npos < (int) Bouquets.size()) - iscurrent = Bouquets[npos]->channelList->getSize() > 0; + iscurrent = !Bouquets[npos]->channelList->isEmpty(); color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f7c8b1d57..8bd796915 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -689,11 +689,11 @@ int CChannelList::show() if (!bouquetList->Bouquets.empty()) { bool found = true; uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { + if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { found = false; nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0; for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) { - if(bouquetList->Bouquets[i]->channelList->getSize() > 0) { + if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) { found = true; nNext = i; break; @@ -711,11 +711,11 @@ int CChannelList::show() if (!bouquetList->Bouquets.empty()) { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { + if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { found = false; nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1; for(int i = nNext; i > 0; i--) { - if(bouquetList->Bouquets[i]->channelList->getSize() > 0) { + if(!bouquetList->Bouquets[i]->channelList->isEmpty()) { found = true; nNext = i; break; @@ -1186,7 +1186,7 @@ int CChannelList::numericZap(int key) channelList->addChannel(orgList->chanlist[i]); } } - if (channelList->getSize() != 0) { + if ( !channelList->isEmpty()) { channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID(), false); this->frameBuffer->paintBackground(); res = channelList->exec(); @@ -1206,7 +1206,7 @@ int CChannelList::numericZap(int key) if(channel) channelList->addChannel(channel); } } - if (channelList->getSize() != 0) { + if ( !channelList->isEmpty() ) { this->frameBuffer->paintBackground(); res = channelList->exec(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); @@ -1968,6 +1968,11 @@ void CChannelList::paint() showChannelLogo(); } +bool CChannelList::isEmpty() const +{ + return this->chanlist.empty(); +} + int CChannelList::getSize() const { return this->chanlist.size(); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index e3b360156..bf1b78319 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -146,6 +146,7 @@ public: int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); int getSize() const; + bool isEmpty() const; int getSelectedChannelIndex() const; void setSize(int newsize); int doChannelMenu(void); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 386285bcf..84e4d42df 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -883,11 +883,11 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu bool found = true; uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size(); //printf("**************************** EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext); - if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { + if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) { found = false; nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0; for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) { - if(bouquetList->Bouquets[i]->channelList->getSize() > 0) { + if(!bouquetList->Bouquets[i]->channelList->isEmpty() ) { found = true; nNext = i; break; @@ -909,11 +909,11 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu if (!bouquetList->Bouquets.empty()) { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); - if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { + if(bouquetList->Bouquets[nNext]->channelList->isEmpty()) { found = false; nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1; for(int i = nNext; i > 0; i--) { - if(bouquetList->Bouquets[i]->channelList->getSize() > 0) { + if(!bouquetList->Bouquets[i]->channelList->isEmpty()) { found = true; nNext = i; break; @@ -1261,7 +1261,7 @@ int CEPGplusHandler::exec (CMenuTarget * parent, const std::string & /*actionKey //channelList = CNeutrinoApp::getInstance()->channelList; int bnum = bouquetList->getActiveBouquetNumber(); current_bouquet = bnum; - if(!bouquetList->Bouquets.empty() && bouquetList->Bouquets[bnum]->channelList->getSize() > 0) + if(!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty() ) channelList = bouquetList->Bouquets[bnum]->channelList; else channelList = CNeutrinoApp::getInstance()->channelList; From ed37bca2fd257ef71bd6c2da437c50b72cb9067a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Oct 2012 13:26:27 +0200 Subject: [PATCH 031/116] disable tech.info if channelist is empty (fix possible segfault) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/775a4a72290fb6e263a62baa10a7a94f9702bc34 Author: Jacek Jendrzej Date: 2012-10-20 (Sat, 20 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/info_menue.cpp | 2 +- src/gui/user_menue.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index bb8470a48..c90c17b7d 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -79,7 +79,7 @@ int CInfoMenu::showMenu() mf->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO); info->addItem(mf); - mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, true, NULL, &streaminfo, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); + mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); info->addItem(mf); diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 2aa65eed7..1318fe662 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -288,7 +288,7 @@ bool CUserMenu::showUserMenu(int button) menu_prev = SNeutrinoSettings::ITEM_TECHINFO; streamInfo = new CStreamInfo2(); keyhelper.get(&key,&icon,CRCInput::RC_blue); - menu_item = new CMenuForwarder(LOCALE_EPGMENU_STREAMINFO, true, NULL, streamInfo, "-1", key, icon ); + menu_item = new CMenuForwarder(LOCALE_EPGMENU_STREAMINFO, !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, streamInfo, "-1", key, icon ); menu->addItem(menu_item, false); break; case SNeutrinoSettings::ITEM_GAMES: From 9ff2abcdb1901a2b109f9a50d94c957673d98889 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Oct 2012 14:16:19 +0200 Subject: [PATCH 032/116] zapit.h: change volue VOLUME_PERCENT_PCM on 100 as default Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d285f82dca101bbeb341f37339081183e9862b47 Author: Jacek Jendrzej Date: 2012-10-20 (Sat, 20 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/include/zapit/zapit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 2c77eb030..a87701afc 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -34,7 +34,7 @@ typedef volume_map_t::iterator volume_map_iterator_t; typedef std::pair volume_map_range_t; #define VOLUME_PERCENT_AC3 100 -#define VOLUME_PERCENT_PCM 75 +#define VOLUME_PERCENT_PCM 100 /* complete zapit start thread-parameters in a struct */ typedef struct ZAPIT_start_arg From f803f92af4d9ee25735e7007a33fc2edac250e34 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 21 Oct 2012 18:45:39 +0200 Subject: [PATCH 033/116] NeutrinoMessages fix memleak , ported from tuxbox cvs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c302dc90ded65bdffa10ff306b8a8d38a92e999 Author: Jacek Jendrzej Date: 2012-10-21 (Sun, 21 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/daemonc/remotecontrol.cpp | 20 ++++++++++---------- src/gui/infoviewer.cpp | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index a9f1937a8..11e5373f9 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -298,8 +298,8 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data tuxtxt_start(current_PIDs.PIDs.vtxtpid); } #endif - t_channel_id * p = new t_channel_id; - *p = current_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, ¤t_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTPIDS, (const neutrino_msg_data_t)p, false); processAPIDnames(); @@ -335,8 +335,8 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data { //printf("new program !\n"); - t_channel_id * p = new t_channel_id; - *p = current_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, ¤t_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg(NeutrinoMessages::EVT_NEXTPROGRAM, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory return messages_return::handled; @@ -382,8 +382,8 @@ void CRemoteControl::getSubChannels() } copySubChannelsToZapit(); - t_channel_id * p = new t_channel_id; - *p = current_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, ¤t_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory } } @@ -424,8 +424,8 @@ void CRemoteControl::getNVODs() copySubChannelsToZapit(); - t_channel_id * p = new t_channel_id; - *p = current_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, ¤t_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory if ( selected_subchannel == -1 ) @@ -570,8 +570,8 @@ void CRemoteControl::processAPIDnames() setAPID( 0 ); } - t_channel_id * p = new t_channel_id; - *p = current_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, ¤t_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTAPIDS, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0b6883847..5c5407530 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1273,16 +1273,16 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch /* of there is no EPG, send an event so that parental lock can work */ if (info.current_uniqueKey == 0 && info.next_uniqueKey == 0) { oldinfo = info; - t_channel_id *p = new t_channel_id; - *p = for_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, &for_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false); return info; } if (info.current_uniqueKey != oldinfo.current_uniqueKey || info.next_uniqueKey != oldinfo.next_uniqueKey) { if (info.flags & (CSectionsdClient::epgflags::has_current | CSectionsdClient::epgflags::has_next)) { - CSectionsdClient::CurrentNextInfo * _info = new CSectionsdClient::CurrentNextInfo; - *_info = info; + char *_info = new char[sizeof(CSectionsdClient::CurrentNextInfo)]; + memcpy(_info, &info, sizeof(CSectionsdClient::CurrentNextInfo)); neutrino_msg_t msg; if (info.flags & CSectionsdClient::epgflags::has_current) msg = NeutrinoMessages::EVT_CURRENTEPG; @@ -1290,8 +1290,8 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch msg = NeutrinoMessages::EVT_NEXTEPG; g_RCInput->postMsg(msg, (unsigned) _info, false ); } else { - t_channel_id *p = new t_channel_id; - *p = for_channel_id; + char *p = new char[sizeof(t_channel_id)]; + memcpy(p, &for_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false); // data is pointer to allocated memory } oldinfo = info; From c992dc4d5c8755fb6da9cbbe19bc169ecd3238d9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 11:03:05 +0400 Subject: [PATCH 034/116] gui/streaminfo2.cpp: fix crash, when shown without current channel (i.e. channel list empty) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/755ddcb3da34638a1d57425226cab2a6b31109b4 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/streaminfo2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d5e969656..94357d8b6 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -447,6 +447,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) int spaceoffset = 0,i = 0; int ypos1 = ypos; int box_width = width*2/3 - 10; + + yypos = ypos; if(box_h > 0) frameBuffer->paintBoxRel (0, ypos, box_width, box_h, COL_MENUHEAD_PLUS_0); From efb5320a4f2fc202f2f2ca4797e1220d6e061b04 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 12:24:55 +0400 Subject: [PATCH 035/116] gui/channellist.cpp: remove extra showChannelLogo(), fix channel logo - call paint() after paintHead(), use enum values for channel list mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9a271191b64f1ce8b8cb8f705f9d04ca89f29ae6 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 8bd796915..1f0845202 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -802,20 +802,19 @@ int CChannelList::show() else if ( msg == CRCInput::RC_blue ) { displayNext = !displayNext; - paint(); paintHead(); // update button bar - showChannelLogo(); + paint(); } else if ( msg == CRCInput::RC_green ) { int mode = CNeutrinoApp::getInstance()->GetChannelMode(); - if(mode){ + if(mode != LIST_MODE_FAV) { g_settings.channellist_sort_mode++; if(g_settings.channellist_sort_mode > 2) g_settings.channellist_sort_mode = 0; CNeutrinoApp::getInstance()->SetChannelMode(mode); - paint(); paintHead(); // update button bar + paint(); } } @@ -1624,7 +1623,7 @@ void CChannelList::paintButtonBar(bool is_current) { //printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected); unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode(); - int num_buttons = smode ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS; + int num_buttons = smode != LIST_MODE_FAV ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS; struct button_label Button[num_buttons]; const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE, From fbeed0470d60dbf967333784fd4a33aabafcd504 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 13:11:54 +0400 Subject: [PATCH 036/116] gui/channellist.cpp: dont paint channel list, if event list return menu_return::RETURN_EXIT_ALL Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/afdf9f30dd2925e307447e37cc77dd9b91bef405 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 1f0845202..e3ed2ecf9 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -622,13 +622,15 @@ int CChannelList::show() else if ((msg == CRCInput::RC_red) || (msg == CRCInput::RC_epg)) { hide(); + /* RETURN_EXIT_ALL on FAV/SAT buttons or messages_return::cancel_all from CNeutrinoApp::getInstance()->handleMsg() */ if ( g_EventList->exec(chanlist[selected]->channel_id, chanlist[selected]->getName()) == menu_return::RETURN_EXIT_ALL) { res = -2; loop = false; + } else { + paintHead(); + paint(); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } - paintHead(); - paint(); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } else if (msg == CRCInput::RC_yellow) { bShowBouquetList = true; From 4de110219b95ad6622c36f759084d82b1a2cb9aa Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 13:30:31 +0400 Subject: [PATCH 037/116] gui/channellist.cpp: not allow zap on scroll mode, if current neutrino mode is mode_ts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/50b17f58f4c5f647c02a8b1722f86ec1d1e22e20 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e3ed2ecf9..92c7f50d3 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -738,9 +738,11 @@ int CChannelList::show() } } else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { - this->new_mode_active = (this->new_mode_active ? 0 : 1); - paintHead(); - showChannelLogo(); + if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { + this->new_mode_active = (this->new_mode_active ? 0 : 1); + paintHead(); + showChannelLogo(); + } } else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) { if (this->historyMode) { //numeric zap From 98adb47df5d4d70d76588b5dec3ebc3765d95335 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 14:23:16 +0400 Subject: [PATCH 038/116] gui/bouquetlist.cpp: add updateSelection(), fix indent Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a0b42e9624f80b4d203b6b86f583141c3546211 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 118 +++++++++++++++------------------------- src/gui/bouquetlist.h | 1 + 2 files changed, 46 insertions(+), 73 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 9307341a3..ec5f9cdc5 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -71,9 +71,9 @@ CBouquetList::CBouquetList(const char * const Name) CBouquetList::~CBouquetList() { - for (std::vector::iterator it = Bouquets.begin(); it != Bouquets.end(); ++it) { - delete (*it); - } + for (std::vector::iterator it = Bouquets.begin(); it != Bouquets.end(); ++it) + delete (*it); + Bouquets.clear(); } @@ -144,7 +144,6 @@ bool CBouquetList::hasChannelID(t_channel_id channel_id) return false; } -extern CBouquetList * TVfavList; bool CBouquetList::adjustToChannelID(t_channel_id channel_id) { //printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", name.c_str(), channel_id, selected, Bouquets.size()); @@ -294,12 +293,29 @@ int CBouquetList::doMenu() const struct button_label CBouquetListButtons[4] = { - { NEUTRINO_ICON_BUTTON_RED, LOCALE_CHANNELLIST_FAVS}, - { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_PROVS}, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_CHANNELLIST_SATS}, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_CHANNELLIST_HEAD} + { NEUTRINO_ICON_BUTTON_RED, LOCALE_CHANNELLIST_FAVS}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_PROVS}, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_CHANNELLIST_SATS}, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_CHANNELLIST_HEAD} }; +void CBouquetList::updateSelection(int newpos) +{ + if((int) selected != newpos) { + int prev_selected = selected; + unsigned int oldliststart = liststart; + + selected = newpos; + liststart = (selected/listmaxshow)*listmaxshow; + if (oldliststart != liststart) + paint(); + else { + paintItem(prev_selected - liststart); + paintItem(selected - liststart); + } + } +} + /* bShowChannelList default to true, returns new bouquet or -1/-2 */ int CBouquetList::show(bool bShowChannelList) { @@ -415,72 +431,37 @@ int CBouquetList::show(bool bShowChannelList) paint(); } else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) { - selected=0; - liststart = (selected/listmaxshow)*listmaxshow; - paint(); + updateSelection(0); } else if ( msg == (neutrino_msg_t) g_settings.key_list_end ) { - selected=Bouquets.size()-1; - liststart = (selected/listmaxshow)*listmaxshow; - paint(); + updateSelection(Bouquets.size()-1); } else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) { - int step = 0; - int prev_selected = selected; - - step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 - selected -= step; -#if 0 - if((prev_selected-step) < 0) // because of uint - selected = Bouquets.size()-1; -#endif - if((prev_selected-step) < 0) { - if(prev_selected != 0 && step != 1) - selected = 0; + int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected - step; + if (new_selected < 0) { + if (selected != 0 && step != 1) + new_selected = 0; else - selected = Bouquets.size() - 1; + new_selected = Bouquets.size() - 1; } - paintItem(prev_selected - liststart); - unsigned int oldliststart = liststart; - liststart = (selected/listmaxshow)*listmaxshow; - if(oldliststart!=liststart) - paint(); - else - paintItem(selected - liststart); + updateSelection(new_selected); } else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) { - unsigned int step = 0; - unsigned int prev_selected = selected; - - step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 - selected += step; -#if 0 - if(selected >= Bouquets.size()) { - if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries - selected = 0; - else - selected = ((step == listmaxshow) && (selected < (((Bouquets.size() / listmaxshow) + 1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; - } -#endif - if(selected >= Bouquets.size()) { - if((Bouquets.size() - listmaxshow -1 < prev_selected) && (prev_selected != (Bouquets.size() - 1)) && (step != 1)) - selected = Bouquets.size() - 1; + int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected + step; + if (new_selected >= (int) Bouquets.size()) { + if ((Bouquets.size() - listmaxshow -1 < selected) && (selected != (Bouquets.size() - 1)) && (step != 1)) + new_selected = Bouquets.size() - 1; else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries - selected = 0; + new_selected = 0; else - selected = ((step == listmaxshow) && (selected < (((Bouquets.size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; + new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Bouquets.size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; } - - paintItem(prev_selected - liststart); - unsigned int oldliststart = liststart; - liststart = (selected/listmaxshow)*listmaxshow; - if(oldliststart!=liststart) - paint(); - else - paintItem(selected - liststart); + updateSelection(new_selected); } else if(msg == (neutrino_msg_t)g_settings.key_bouquet_up || msg == (neutrino_msg_t)g_settings.key_bouquet_down) { if(bShowChannelList) { @@ -522,17 +503,8 @@ int CBouquetList::show(bool bShowChannelList) pos = lmaxpos; } - int prevselected=selected; - selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ? - paintItem(prevselected - liststart); - unsigned int oldliststart = liststart; - liststart = (selected/listmaxshow)*listmaxshow; - if(oldliststart!=liststart) { - paint(); - } else { - paintItem(selected - liststart); - } - + int new_selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ? + updateSelection(new_selected); } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; @@ -578,8 +550,8 @@ void CBouquetList::paintItem(int pos) } else { if(npos < (int) Bouquets.size()) iscurrent = !Bouquets[npos]->channelList->isEmpty(); - color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; - bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; + color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; + bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); } diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 35dcb136f..41e76a07b 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -99,6 +99,7 @@ class CBouquetList void paintHead(); void hide(); int doMenu(); + void updateSelection(int newpos); public: CBouquetList(const char * const Name = NULL); From eb73a7bc123520c22482482c8c69eafe615b754d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 22 Oct 2012 15:49:55 +0400 Subject: [PATCH 039/116] gui/bouquetlist.cpp: fix message loop, if bouquet list is empty Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fad279231ec9b481605dbae305bd6ab8343c267 Author: [CST] Focus Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 104 +++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index ec5f9cdc5..9e1d81f2b 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -332,8 +332,7 @@ int CBouquetList::show(bool bShowChannelList) frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); w_max_icon = std::max(w_max_icon, icol_w); } - //if(Bouquets.size()==0) - // return res; + int need_width = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0])*(w_max_icon + w_max_text + 20); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); @@ -419,49 +418,54 @@ int CBouquetList::show(bool bShowChannelList) return -3; } } - else if(Bouquets.empty()) - continue; //FIXME msgs not forwarded to neutrino !! else if ( msg == CRCInput::RC_setup) { - int ret = doMenu(); - if(ret > 0) { - CNeutrinoApp::getInstance ()->g_channel_list_changed = true; - res = -4; - loop = false; - } else if(ret < 0) - paint(); + if (!Bouquets.empty()) { + int ret = doMenu(); + if(ret > 0) { + CNeutrinoApp::getInstance ()->g_channel_list_changed = true; + res = -4; + loop = false; + } else if(ret < 0) + paint(); + } } else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) { - updateSelection(0); + if (!Bouquets.empty()) + updateSelection(0); } else if ( msg == (neutrino_msg_t) g_settings.key_list_end ) { - updateSelection(Bouquets.size()-1); + if (!Bouquets.empty()) + updateSelection(Bouquets.size()-1); } else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) { - int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 - int new_selected = selected - step; - if (new_selected < 0) { - if (selected != 0 && step != 1) - new_selected = 0; - else - new_selected = Bouquets.size() - 1; + if (!Bouquets.empty()) { + int step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected - step; + if (new_selected < 0) { + if (selected != 0 && step != 1) + new_selected = 0; + else + new_selected = Bouquets.size() - 1; + } + updateSelection(new_selected); } - - updateSelection(new_selected); } else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) { - int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 - int new_selected = selected + step; - if (new_selected >= (int) Bouquets.size()) { - if ((Bouquets.size() - listmaxshow -1 < selected) && (selected != (Bouquets.size() - 1)) && (step != 1)) - new_selected = Bouquets.size() - 1; - else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries - new_selected = 0; - else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Bouquets.size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; + if (!Bouquets.empty()) { + int step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 + int new_selected = selected + step; + if (new_selected >= (int) Bouquets.size()) { + if ((Bouquets.size() - listmaxshow -1 < selected) && (selected != (Bouquets.size() - 1)) && (step != 1)) + new_selected = Bouquets.size() - 1; + else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries + new_selected = 0; + else + new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Bouquets.size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; + } + updateSelection(new_selected); } - updateSelection(new_selected); } else if(msg == (neutrino_msg_t)g_settings.key_bouquet_up || msg == (neutrino_msg_t)g_settings.key_bouquet_down) { if(bShowChannelList) { @@ -475,36 +479,36 @@ int CBouquetList::show(bool bShowChannelList) hide(); return -3; } - } - else if ( msg == CRCInput::RC_ok ) { - if(!bShowChannelList || !Bouquets[selected]->channelList->isEmpty()) { + if(!Bouquets.empty() && (!bShowChannelList || !Bouquets[selected]->channelList->isEmpty())) { zapOnExit = true; loop=false; } } else if (CRCInput::isNumeric(msg)) { - if (pos == lmaxpos) { - if (msg == CRCInput::RC_0) { + if (!Bouquets.empty()) { + if (pos == lmaxpos) { + if (msg == CRCInput::RC_0) { + chn = firstselected; + pos = lmaxpos; + } else { + chn = CRCInput::getNumericValue(msg); + pos = 1; + } + } else { + chn = chn * 10 + CRCInput::getNumericValue(msg); + pos++; + } + + if (chn > Bouquets.size()) { chn = firstselected; pos = lmaxpos; - } else { - chn = CRCInput::getNumericValue(msg); - pos = 1; } - } else { - chn = chn * 10 + CRCInput::getNumericValue(msg); - pos++; - } - if (chn > Bouquets.size()) { - chn = firstselected; - pos = lmaxpos; + int new_selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ? + updateSelection(new_selected); } - - int new_selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ? - updateSelection(new_selected); } else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; From b0b4b885ed3c724548315e2ef6d083e97f2b2de4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Oct 2012 14:00:01 +0200 Subject: [PATCH 040/116] nhttpd::controlapi.cpp:execute more comands on/off only once (fix doubleclick) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e3567dc09e4555003de68f01271c5ce6152d989 Author: Jacek Jendrzej Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- .../tuxboxapi/coolstream/controlapi.cpp | 66 ++++++++++++++----- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index d737dbf0a..f3afbad54 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -425,13 +425,21 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) { if (hh->ParamList["1"] == "on") // standby mode on { - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD); - hh->SendOk(); + if(CNeutrinoApp::getInstance()->getMode() == 4){ + hh->WriteLn("standby is already on"); + }else { + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD); + hh->SendOk(); + } } else if (hh->ParamList["1"] == "off")// standby mode off { - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD); - hh->SendOk(); + if(CNeutrinoApp::getInstance()->getMode() != 4){ + hh->WriteLn("standby is already off"); + }else { + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD); + hh->SendOk(); + } } else hh->SendError(); @@ -448,12 +456,29 @@ void CControlAPI::RCCGI(CyhookHandler *hh) { if (!(hh->ParamList.empty())) { - if (hh->ParamList["1"] == "lock") // lock remote control - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); - else if (hh->ParamList["1"] == "unlock")// unlock remote control - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); - else + static bool on_off = false; + if (hh->ParamList["1"] == "lock"){ // lock remote control + if(!on_off){ + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); + on_off = true; + }else{ + hh->WriteLn("remote is already locked"); + return; + } + } + else if (hh->ParamList["1"] == "unlock"){// unlock remote control + if(on_off){ + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); + on_off = false; + + }else{ + hh->WriteLn("remote is already unlocked"); + return; + } + } + else{ hh->SendError(); + } } hh->SendOk(); } @@ -1472,16 +1497,25 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) SendAllCurrentVAPid(hh); else if (hh->ParamList["1"] == "stopplayback") { - NeutrinoAPI->Zapit->stopPlayBack(); - NeutrinoAPI->Sectionsd->setPauseScanning(true); - hh->SendOk(); + if(!NeutrinoAPI->Zapit->isPlayBackActive()){ + hh->WriteLn("playback is already off"); + }else{ + NeutrinoAPI->Zapit->stopPlayBack(); + NeutrinoAPI->Sectionsd->setPauseScanning(true); + hh->SendOk(); + } } else if (hh->ParamList["1"] == "startplayback") { - NeutrinoAPI->Zapit->startPlayBack(); - NeutrinoAPI->Sectionsd->setPauseScanning(false); - dprintf("start playback requested..\n"); - hh->SendOk(); + if(NeutrinoAPI->Zapit->isPlayBackActive()){ + hh->WriteLn("playback is already on"); + }else{ + NeutrinoAPI->Zapit->startPlayBack(); + NeutrinoAPI->Sectionsd->setPauseScanning(false); + dprintf("start playback requested..\n"); + hh->SendOk(); + } + } else if (hh->ParamList["1"] == "statusplayback") hh->Write((char *) (NeutrinoAPI->Zapit->isPlayBackActive() ? "1" : "0")); From bb097d5d95194bd7cdb50a129bf4501573a01b88 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Oct 2012 15:52:07 +0200 Subject: [PATCH 041/116] rc_lock: lock for rc_lock, use only once, supplement to b0b4b885ed3c724548315e2ef6d083e97f2b2de4 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9a2d6aea26e402b892808a58f799ef091c2ebd25 Author: Jacek Jendrzej Date: 2012-10-22 (Mon, 22 Oct 2012) Origin message was: ------------------ rc_lock: lock for rc_lock, use only once, supplement to b0b4b885ed3c724548315e2ef6d083e97f2b2de4 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/rc_lock.cpp | 6 ++++++ src/gui/rc_lock.h | 5 +++-- src/neutrino.cpp | 5 +++-- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 9 ++++----- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/gui/rc_lock.cpp b/src/gui/rc_lock.cpp index 51e12a12d..2b7177692 100644 --- a/src/gui/rc_lock.cpp +++ b/src/gui/rc_lock.cpp @@ -38,6 +38,7 @@ #include const std::string CRCLock::NO_USER_INPUT = "noUserInput"; +bool CRCLock::locked = false; // -- Menue Handler Interface // -- Infinite Loop to lock remote control (until release lock key pressed) @@ -45,6 +46,9 @@ const std::string CRCLock::NO_USER_INPUT = "noUserInput"; int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) { + if(locked) + return menu_return::RETURN_EXIT_ALL; + if (parent) parent->hide(); @@ -55,7 +59,9 @@ int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_EXIT_ALL; // -- Lockup Box + locked = true; lockBox(); + locked = false; ShowLocalizedMessage(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO,450, no_input ? 5 : -1); return menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/rc_lock.h b/src/gui/rc_lock.h index 4e6ea758c..bd32757d0 100644 --- a/src/gui/rc_lock.h +++ b/src/gui/rc_lock.h @@ -36,12 +36,13 @@ // class CRCLock: public CMenuTarget { +private: + void lockBox(); public: static const std::string NO_USER_INPUT; int exec(CMenuTarget* parent, const std::string & actionKey); - void lockBox(); + static bool locked; }; - #endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0e46f62ff..ec4cd0b2a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3197,6 +3197,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(mode == mode_radio && g_Radiotext) g_Radiotext->radiotext_stop(); + lastMode = mode; + mode = mode_standby; + if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) { g_Zapit->setStandby(true); } else { @@ -3232,8 +3235,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(!CRecordManager::getInstance()->RecordingStatus()) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); - lastMode = mode; - mode = mode_standby; //fan speed if (g_info.has_fan) { int fspeed = 1; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index f3afbad54..109b00114 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -37,6 +37,8 @@ #include "gui/plugins.h"//for relodplugins #include #include +#include "gui/rc_lock.h" + // yhttpd #include "yhttpd.h" #include "ytypes_globals.h" @@ -456,20 +458,17 @@ void CControlAPI::RCCGI(CyhookHandler *hh) { if (!(hh->ParamList.empty())) { - static bool on_off = false; if (hh->ParamList["1"] == "lock"){ // lock remote control - if(!on_off){ + if(!CRCLock::locked){ NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); - on_off = true; }else{ hh->WriteLn("remote is already locked"); return; } } else if (hh->ParamList["1"] == "unlock"){// unlock remote control - if(on_off){ + if(CRCLock::locked){ NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); - on_off = false; }else{ hh->WriteLn("remote is already unlocked"); From 6d7ffeadd1e5f264442f8e670eca680aaf8d0f9c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Oct 2012 21:28:38 +0200 Subject: [PATCH 042/116] controlapi.cpp:revert to standard output Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf1dfdad7ce09b61844771868ae05ef8214530a5 Author: Jacek Jendrzej Date: 2012-10-22 (Mon, 22 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- .../tuxboxapi/coolstream/controlapi.cpp | 39 +++++-------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 109b00114..dfc1c5118 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -427,21 +427,15 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) { if (hh->ParamList["1"] == "on") // standby mode on { - if(CNeutrinoApp::getInstance()->getMode() == 4){ - hh->WriteLn("standby is already on"); - }else { + if(CNeutrinoApp::getInstance()->getMode() != 4) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD); - hh->SendOk(); - } + hh->SendOk(); } else if (hh->ParamList["1"] == "off")// standby mode off { - if(CNeutrinoApp::getInstance()->getMode() != 4){ - hh->WriteLn("standby is already off"); - }else { + if(CNeutrinoApp::getInstance()->getMode() == 4) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD); - hh->SendOk(); - } + hh->SendOk(); } else hh->SendError(); @@ -459,21 +453,13 @@ void CControlAPI::RCCGI(CyhookHandler *hh) if (!(hh->ParamList.empty())) { if (hh->ParamList["1"] == "lock"){ // lock remote control - if(!CRCLock::locked){ + if(!CRCLock::locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); - }else{ - hh->WriteLn("remote is already locked"); - return; - } } else if (hh->ParamList["1"] == "unlock"){// unlock remote control - if(CRCLock::locked){ + if(CRCLock::locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); - }else{ - hh->WriteLn("remote is already unlocked"); - return; - } } else{ hh->SendError(); @@ -1496,25 +1482,20 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) SendAllCurrentVAPid(hh); else if (hh->ParamList["1"] == "stopplayback") { - if(!NeutrinoAPI->Zapit->isPlayBackActive()){ - hh->WriteLn("playback is already off"); - }else{ + if(NeutrinoAPI->Zapit->isPlayBackActive()){ NeutrinoAPI->Zapit->stopPlayBack(); NeutrinoAPI->Sectionsd->setPauseScanning(true); - hh->SendOk(); } + hh->SendOk(); } else if (hh->ParamList["1"] == "startplayback") { - if(NeutrinoAPI->Zapit->isPlayBackActive()){ - hh->WriteLn("playback is already on"); - }else{ + if(!NeutrinoAPI->Zapit->isPlayBackActive()){ NeutrinoAPI->Zapit->startPlayBack(); NeutrinoAPI->Sectionsd->setPauseScanning(false); dprintf("start playback requested..\n"); - hh->SendOk(); } - + hh->SendOk(); } else if (hh->ParamList["1"] == "statusplayback") hh->Write((char *) (NeutrinoAPI->Zapit->isPlayBackActive() ? "1" : "0")); From 93c753baf188a62afd9976f0c772199c83a4374b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 23 Oct 2012 12:37:56 +0200 Subject: [PATCH 043/116] neutrino.cpp: blocking standby for multical Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4c976beb5548520d9430671ccf5926a2f4ecb72 Author: Jacek Jendrzej Date: 2012-10-23 (Tue, 23 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 13 ++++++++++--- src/neutrino.h | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ec4cd0b2a..35a5745f8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -228,6 +228,7 @@ CNeutrinoApp::CNeutrinoApp() RADIOchannelList = NULL; skipShutdownTimer = false; skipSleepnTimer = false; + lockStandbyCall = false; current_muted = 0; recordingstatus = 0; g_channel_list_changed = 0; @@ -3179,7 +3180,11 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) { //static bool wasshift = false; INFO("%s", bOnOff ? "ON" : "OFF" ); - + + if(lockStandbyCall) + return; + + lockStandbyCall = true; if( bOnOff ) { if( mode == mode_scart ) { //g_Controld->setScartMode( 0 ); @@ -3197,8 +3202,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(mode == mode_radio && g_Radiotext) g_Radiotext->radiotext_stop(); - lastMode = mode; - mode = mode_standby; if(!fromDeepStandby && !CRecordManager::getInstance()->RecordingStatus()) { g_Zapit->setStandby(true); @@ -3235,6 +3238,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(!CRecordManager::getInstance()->RecordingStatus()) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); + lastMode = mode; + mode = mode_standby; + //fan speed if (g_info.has_fan) { int fspeed = 1; @@ -3319,6 +3325,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) #endif StartSubtitles(); } + lockStandbyCall = false; } void CNeutrinoApp::radioMode( bool rezap) diff --git a/src/neutrino.h b/src/neutrino.h index bfdcb4232..4353bd076 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -120,7 +120,7 @@ private: bool skipShutdownTimer; bool skipSleepnTimer; bool pbBlinkChange; - + bool lockStandbyCall; int tvsort[LIST_MODE_LAST]; int radiosort[LIST_MODE_LAST]; From 1bd4b814b811c993a78891be72494da81c26479b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Oct 2012 15:24:34 +0400 Subject: [PATCH 044/116] english.locale: fix some theme menu locals Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7657effd8e0a98df350c3fc3a0f8f98f51cea0fe Author: [CST] Focus Date: 2012-10-23 (Tue, 23 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index c4263b4eb..f85e9dae9 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -262,12 +262,12 @@ colormenusetup.menucontent_selected Content selected colormenusetup.menuhead Header colorstatusbar.text Infobar colorthememenu.head Theme auswählen -colorthememenu.head2 Themes laden -colorthememenu.name Themename +colorthememenu.head2 Load themes +colorthememenu.name Theme name colorthememenu.neutrino_theme Neutrino Theme -colorthememenu.question Aktuelles Theme beibehalten? -colorthememenu.save aktuelles Theme speichern -colorthememenu.select1 Benutzer Theme +colorthememenu.question Use selected theme ? +colorthememenu.save Save current theme +colorthememenu.select1 User Theme colorthememenu.select2 Standard Theme cpu.freq Cpu frequency cpu.freq_default default frequency From b0a61fe6c75cab8ed1a646088b7fe06a6c6d6c26 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Oct 2012 16:15:53 +0400 Subject: [PATCH 045/116] gui/bouquetlist.cpp: bouquet id safe-checks Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d71ad8700a05f99bd422a0b837276a92eb9de14a Author: [CST] Focus Date: 2012-10-23 (Tue, 23 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 9e1d81f2b..f1e11d97b 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -171,7 +171,7 @@ bool CBouquetList::adjustToChannelID(t_channel_id channel_id) /* used in channellist to switch bouquets up/down */ int CBouquetList::showChannelList( int nBouquet) { - if (nBouquet == -1) + if ((nBouquet < 0)|| (nBouquet >= (int) Bouquets.size())) nBouquet = selected; int nNewChannel = Bouquets[nBouquet]->channelList->exec(); @@ -186,7 +186,7 @@ int CBouquetList::activateBouquet( int id, bool bShowChannelList) { int res = -1; - if(id < (int) Bouquets.size()) + if((id >= 0) && (id < (int) Bouquets.size())) selected = id; if (bShowChannelList) { From dbc4e3133ee8d7aeeb0b06bb065bf764431421a3 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Oct 2012 16:17:59 +0400 Subject: [PATCH 046/116] neutrino.cpp: workaround for (rare) crash, if old_b wrong Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf0286ec08c0e18a9208d0c3a702bf9151af95b9 Author: [CST] Focus Date: 2012-10-23 (Tue, 23 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 35a5745f8..86e871521 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2349,7 +2349,7 @@ _repeat: SetChannelMode(old_mode); bouquetList->activateBouquet(old_b, false); if(!bouquetList->Bouquets.empty()) - bouquetList->Bouquets[old_b]->channelList->setSelected(old_num); + bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->setSelected(old_num); StartSubtitles(mode == mode_tv); } else if(nNewChannel == -3) { // list mode changed From 681d2ba19db964c7488a1aa66970d7379ce5d691 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Oct 2012 18:20:58 +0400 Subject: [PATCH 047/116] neutrino.cpp: dont zap on record announce in standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e45d1301016c4e88f471831b16a99ec208a49a17 Author: [CST] Focus Date: 2012-10-23 (Tue, 23 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 86e871521..69aa17599 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2711,7 +2711,8 @@ _repeat: wakeup_hdd(g_settings.network_nfs_recordingdir); } } - if( g_settings.recording_zap_on_announce ) { + + if( g_settings.recording_zap_on_announce && (mode != mode_standby) ) { //TODO check transponder ? CRecordManager::getInstance()->StopAutoRecord(); if(!CRecordManager::getInstance()->RecordingStatus()) { From 8d45cb92ff95da495fe2e2f4087e09c0f46bf972 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 09:21:56 +0200 Subject: [PATCH 048/116] locales: supplement to 1bd4b81 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac752b70fb1b0440922c1bc1c4945202e24e30b3 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locales: supplement to 1bd4b81 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index f85e9dae9..f3b6e6d39 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -254,18 +254,18 @@ colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.sd_preset CRT colormenu.textcolor Text color -colormenu.themeselect select theme +colormenu.themeselect Select theme colormenu.timing OSD Timeouts colormenusetup.menucontent Content colormenusetup.menucontent_inactive Content inactive colormenusetup.menucontent_selected Content selected colormenusetup.menuhead Header colorstatusbar.text Infobar -colorthememenu.head Theme auswählen +colorthememenu.head Select theme colorthememenu.head2 Load themes colorthememenu.name Theme name colorthememenu.neutrino_theme Neutrino Theme -colorthememenu.question Use selected theme ? +colorthememenu.question Use selected theme? colorthememenu.save Save current theme colorthememenu.select1 User Theme colorthememenu.select2 Standard Theme From e18ec4a6a1d04e14b7e40411eeb793c64ab99a59 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 10:16:56 +0200 Subject: [PATCH 049/116] locals: some very tiny corrections Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dfbff310cc3811973f120305f7e7f5dd99948bfe Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locals: some very tiny corrections ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 6 +++--- data/locale/english.locale | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c9d6cc170..b3af1d8b4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -437,7 +437,7 @@ filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 flashupdate.actionreadflash lese Flash flashupdate.cantopenfile kann Datei nicht öffnen -flashupdate.cantopenmtd kann das MTD-Device nicht öffnen +flashupdate.cantopenmtd kann MTD nicht öffnen flashupdate.checkupdate_internet Online nach Updates suchen flashupdate.checkupdate_local Lokales Update flashupdate.currentversion_sep Installierte Version @@ -538,7 +538,7 @@ hdd_60min 60 min. hdd_activate Übernehmen hdd_check Dateisystemprüfung hdd_check_failed Festplattenprüfung fehlgeschlagen -hdd_ext3 Ext3fs +hdd_ext3 ext3 hdd_extended_settings Erweiterte Festplatteneinstellungen hdd_fast Schnell hdd_format Formatiere Festplatte @@ -1515,7 +1515,7 @@ satsetup.diseqc11 DiSEqC 1.1 satsetup.diseqc12 DiSEqC 1.2 satsetup.diseqc_advanced Erweiterte Auswahl satsetup.diseqc_com_uncom Committed/Uncommitted -satsetup.diseqc_input Diseqc Einspeisung +satsetup.diseqc_input DiSEqC Einspeisung satsetup.diseqc_uncom_com Uncommitted/Committed satsetup.diseqcrepeat DiSEqC-Wiederholungen satsetup.extended DiSEqC-Einstellungen diff --git a/data/locale/english.locale b/data/locale/english.locale index f3b6e6d39..61f7f7371 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -269,8 +269,8 @@ colorthememenu.question Use selected theme? colorthememenu.save Save current theme colorthememenu.select1 User Theme colorthememenu.select2 Standard Theme -cpu.freq Cpu frequency -cpu.freq_default default frequency +cpu.freq CPU frequency +cpu.freq_default Default frequency cpu.freq_normal Normal frequency cpu.freq_standby Standby frequency date.Apr Apr @@ -303,7 +303,7 @@ epglist.noevents EPG is not available... epgviewer.More_Screenings More Screenings on this Channel epgviewer.More_Screenings_short More Screenings epgviewer.nodetailed No detailed informations available -epgviewer.notfound no epg found +epgviewer.notfound No EPG found eventfinder.head Search in EPG eventfinder.keyword Keyword eventfinder.search Search @@ -437,7 +437,7 @@ filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 flashupdate.actionreadflash reading flashupdate.cantopenfile can't open file -flashupdate.cantopenmtd can't open mtd-device +flashupdate.cantopenmtd can't open MTD flashupdate.checkupdate_internet Check for online updates flashupdate.checkupdate_local Local update flashupdate.currentversion_sep Current version @@ -538,7 +538,7 @@ hdd_60min 60 min. hdd_activate Apply settings hdd_check Check filesystem hdd_check_failed HDD-check failed! -hdd_ext3 Ext3fs +hdd_ext3 ext3 hdd_extended_settings Extended HDD-Settings hdd_fast Fast hdd_format Formating drive... @@ -1515,7 +1515,7 @@ satsetup.diseqc11 DiSEqC 1.1 satsetup.diseqc12 DiSEqC 1.2 satsetup.diseqc_advanced Advanced satsetup.diseqc_com_uncom Commited/Uncommited -satsetup.diseqc_input Diseqc input +satsetup.diseqc_input DiSEqC input satsetup.diseqc_uncom_com Uncommited/Commited satsetup.diseqcrepeat DiSEqC-repeats satsetup.extended DiSEqC-Settings From 088ee662d7e7bbe5dd182b8e0b1205c18e7425b0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 24 Oct 2012 11:14:09 +0200 Subject: [PATCH 050/116] nhttpd/web/Y_Tools_Rcsim.yhtm: skip shutdown ask if box is in standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec48d24af244ba2e25c10c03a3e0b87e0728443b Author: Jacek Jendrzej Date: 2012-10-24 (Wed, 24 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Tools_Rcsim.yhtm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Tools_Rcsim.yhtm b/src/nhttpd/web/Y_Tools_Rcsim.yhtm index 5418f02c1..ff2157ed7 100644 --- a/src/nhttpd/web/Y_Tools_Rcsim.yhtm +++ b/src/nhttpd/web/Y_Tools_Rcsim.yhtm @@ -5,9 +5,13 @@ // From 1100717632a95692676aa2e21fbb342dc094ab78 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 24 Oct 2012 11:46:22 +0200 Subject: [PATCH 051/116] Commit c68517d: Fix delete query when multiple same channelid Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8681a9c39971483e3573770b39f8f91d5f48bc36 Author: Michael Liebmann Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ * Commit c68517d: Fix delete query when multiple same channelid ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 12 ++++++++++++ src/driver/record.h | 1 + src/gui/timerlist.cpp | 29 +++++++++++++++++------------ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 636149ff0..b3edb2b47 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1096,6 +1096,18 @@ bool CRecordManager::Stop(const t_channel_id channel_id) return (inst != NULL); } +bool CRecordManager::IsRecording(const CTimerd::RecordingStopInfo * recinfo) +{ + bool ret = false; + mutex.lock(); + CRecordInstance * inst = FindInstanceID(recinfo->eventID); + if(inst != NULL && recinfo->eventID == inst->GetRecordingId()) + ret = true; + mutex.unlock(); + printf("[%s] eventID: %d, channel_id: 0x%llx, ret: %d\n", __FUNCTION__, recinfo->eventID, recinfo->channel_id, ret); + return ret; +} + bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo) { bool ret = false; diff --git a/src/driver/record.h b/src/driver/record.h index 60d9e03fd..ac5ebc311 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -187,6 +187,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ bool Record(const t_channel_id channel_id, const char * dir = NULL, bool timeshift = false); bool Stop(const t_channel_id channel_id); bool Stop(const CTimerd::RecordingStopInfo * recinfo); + bool IsRecording(const CTimerd::RecordingStopInfo * recinfo); bool Update(const t_channel_id channel_id); bool ShowMenu(void); bool AskToStop(const t_channel_id channel_id, const int recid = 0); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 99dbd4591..406e10ef5 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -574,18 +574,23 @@ int CTimerList::show() { bool killTimer = true; if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) { - std::string title = ""; - char buf1[1024]; - CEPGData epgdata; - CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata); - memset(buf1, '\0', sizeof(buf1)); - if (epgdata.title != "") - title = "(" + epgdata.title + ")\n"; - snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); - if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { - killTimer = false; - update = false; + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = timerlist[selected].channel_id; + recinfo.eventID = timerlist[selected].eventID; + if (CRecordManager::getInstance()->IsRecording(&recinfo)) { + std::string title = ""; + char buf1[1024]; + CEPGData epgdata; + CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata); + memset(buf1, '\0', sizeof(buf1)); + if (epgdata.title != "") + title = "(" + epgdata.title + ")\n"; + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { + killTimer = false; + update = false; + } } } if (killTimer) { From f292d78f481ae6ba8cdcb402ed6b200b6bfacb08 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 13:12:05 +0200 Subject: [PATCH 052/116] locale: move unmaintained locale to subdir 'unmaintained/' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e250fcb247d3a81e644d0f1d00d67acfb22dac7 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locale: move unmaintained locale to subdir 'unmaintained/' ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/Makefile.am | 37 +++++++++++-------- .../locale/{ => unmaintained}/bayrisch.locale | 0 .../locale/{ => unmaintained}/bosanski.locale | 0 .../ch-baslerdeutsch.locale | 0 .../{ => unmaintained}/ch-berndeutsch.locale | 0 data/locale/{ => unmaintained}/czech.locale | 0 data/locale/{ => unmaintained}/dutch.locale | 0 .../locale/{ => unmaintained}/francais.locale | 0 data/locale/{ => unmaintained}/french.locale | 0 .../{ => unmaintained}/hungarian.locale | 0 .../locale/{ => unmaintained}/italiano.locale | 0 .../{ => unmaintained}/nederlands.locale | 0 data/locale/{ => unmaintained}/polski.locale | 0 .../{ => unmaintained}/portugues.locale | 0 data/locale/{ => unmaintained}/russkij.locale | 0 data/locale/{ => unmaintained}/slovak.locale | 0 data/locale/{ => unmaintained}/suomi.locale | 0 data/locale/{ => unmaintained}/svenska.locale | 0 18 files changed, 21 insertions(+), 16 deletions(-) rename data/locale/{ => unmaintained}/bayrisch.locale (100%) rename data/locale/{ => unmaintained}/bosanski.locale (100%) rename data/locale/{ => unmaintained}/ch-baslerdeutsch.locale (100%) rename data/locale/{ => unmaintained}/ch-berndeutsch.locale (100%) rename data/locale/{ => unmaintained}/czech.locale (100%) rename data/locale/{ => unmaintained}/dutch.locale (100%) rename data/locale/{ => unmaintained}/francais.locale (100%) rename data/locale/{ => unmaintained}/french.locale (100%) rename data/locale/{ => unmaintained}/hungarian.locale (100%) rename data/locale/{ => unmaintained}/italiano.locale (100%) rename data/locale/{ => unmaintained}/nederlands.locale (100%) rename data/locale/{ => unmaintained}/polski.locale (100%) rename data/locale/{ => unmaintained}/portugues.locale (100%) rename data/locale/{ => unmaintained}/russkij.locale (100%) rename data/locale/{ => unmaintained}/slovak.locale (100%) rename data/locale/{ => unmaintained}/suomi.locale (100%) rename data/locale/{ => unmaintained}/svenska.locale (100%) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 50d9e1356..4efec5237 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -1,22 +1,27 @@ installdir = $(DATADIR)/neutrino/locale -install_DATA = \ - bayrisch.locale \ - bosanski.locale \ - ch-baslerdeutsch.locale \ - ch-berndeutsch.locale \ - czech.locale \ +locale = \ deutsch.locale \ - english.locale \ - francais.locale \ - italiano.locale \ - nederlands.locale \ - polski.locale \ - portugues.locale \ - russkij.locale \ - slovak.locale \ - suomi.locale \ - svenska.locale + english.locale + +locale_unmaintained = \ + unmaintained/bayrisch.locale \ + unmaintained/bosanski.locale \ + unmaintained/ch-baslerdeutsch.locale \ + unmaintained/ch-berndeutsch.locale \ + unmaintained/czech.locale \ + unmaintained/francais.locale \ + unmaintained/italiano.locale \ + unmaintained/nederlands.locale \ + unmaintained/polski.locale \ + unmaintained/portugues.locale \ + unmaintained/russkij.locale \ + unmaintained/slovak.locale \ + unmaintained/suomi.locale \ + unmaintained/svenska.locale + +install_DATA = $(locale) +install_DATA += $(locale_unmaintained) if MAINTAINER_MODE diff --git a/data/locale/bayrisch.locale b/data/locale/unmaintained/bayrisch.locale similarity index 100% rename from data/locale/bayrisch.locale rename to data/locale/unmaintained/bayrisch.locale diff --git a/data/locale/bosanski.locale b/data/locale/unmaintained/bosanski.locale similarity index 100% rename from data/locale/bosanski.locale rename to data/locale/unmaintained/bosanski.locale diff --git a/data/locale/ch-baslerdeutsch.locale b/data/locale/unmaintained/ch-baslerdeutsch.locale similarity index 100% rename from data/locale/ch-baslerdeutsch.locale rename to data/locale/unmaintained/ch-baslerdeutsch.locale diff --git a/data/locale/ch-berndeutsch.locale b/data/locale/unmaintained/ch-berndeutsch.locale similarity index 100% rename from data/locale/ch-berndeutsch.locale rename to data/locale/unmaintained/ch-berndeutsch.locale diff --git a/data/locale/czech.locale b/data/locale/unmaintained/czech.locale similarity index 100% rename from data/locale/czech.locale rename to data/locale/unmaintained/czech.locale diff --git a/data/locale/dutch.locale b/data/locale/unmaintained/dutch.locale similarity index 100% rename from data/locale/dutch.locale rename to data/locale/unmaintained/dutch.locale diff --git a/data/locale/francais.locale b/data/locale/unmaintained/francais.locale similarity index 100% rename from data/locale/francais.locale rename to data/locale/unmaintained/francais.locale diff --git a/data/locale/french.locale b/data/locale/unmaintained/french.locale similarity index 100% rename from data/locale/french.locale rename to data/locale/unmaintained/french.locale diff --git a/data/locale/hungarian.locale b/data/locale/unmaintained/hungarian.locale similarity index 100% rename from data/locale/hungarian.locale rename to data/locale/unmaintained/hungarian.locale diff --git a/data/locale/italiano.locale b/data/locale/unmaintained/italiano.locale similarity index 100% rename from data/locale/italiano.locale rename to data/locale/unmaintained/italiano.locale diff --git a/data/locale/nederlands.locale b/data/locale/unmaintained/nederlands.locale similarity index 100% rename from data/locale/nederlands.locale rename to data/locale/unmaintained/nederlands.locale diff --git a/data/locale/polski.locale b/data/locale/unmaintained/polski.locale similarity index 100% rename from data/locale/polski.locale rename to data/locale/unmaintained/polski.locale diff --git a/data/locale/portugues.locale b/data/locale/unmaintained/portugues.locale similarity index 100% rename from data/locale/portugues.locale rename to data/locale/unmaintained/portugues.locale diff --git a/data/locale/russkij.locale b/data/locale/unmaintained/russkij.locale similarity index 100% rename from data/locale/russkij.locale rename to data/locale/unmaintained/russkij.locale diff --git a/data/locale/slovak.locale b/data/locale/unmaintained/slovak.locale similarity index 100% rename from data/locale/slovak.locale rename to data/locale/unmaintained/slovak.locale diff --git a/data/locale/suomi.locale b/data/locale/unmaintained/suomi.locale similarity index 100% rename from data/locale/suomi.locale rename to data/locale/unmaintained/suomi.locale diff --git a/data/locale/svenska.locale b/data/locale/unmaintained/svenska.locale similarity index 100% rename from data/locale/svenska.locale rename to data/locale/unmaintained/svenska.locale From 8d82a008c7654cfb4a4a3b0489659c3056193b5b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 15:14:39 +0200 Subject: [PATCH 053/116] locale: since focus deutsch.locale isn't longer the masterfile Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddef0da72494253ca7ab447765d0f397a32e34d0 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locale: since focus deutsch.locale isn't longer the masterfile ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/Makefile.am | 37 ++++++++++++++++------------- data/locale/_readme.txt | 9 ++++--- data/locale/check.locale.files | 2 +- data/locale/create-locals-update.pl | 2 +- data/locale/create.locals.h | 2 +- data/locale/create.locals_intern.h | 2 +- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 4efec5237..a88f19957 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -26,23 +26,28 @@ install_DATA += $(locale_unmaintained) if MAINTAINER_MODE +master.locale=english.locale + locals: sort-locals locals.h locals_intern.h install-locals -sort-locals: $(top_srcdir)/data/locale/deutsch.locale $(top_srcdir)/data/locale/english.locale - cat $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq > deutsch.locale - cat $(top_srcdir)/data/locale/english.locale | LC_ALL=C sort | uniq > english.locale - cp -f deutsch.locale english.locale $(top_srcdir)/data/locale +sort-locals: $(top_srcdir)/data/locale/$(master.locale) + for locale in $(locale); do \ + cat $(top_srcdir)/data/locale/$${locale} | LC_ALL=C sort | uniq > $${locale}; \ + done + cp -f $(locale) $(top_srcdir)/data/locale -ordercheck: $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq > /tmp/log - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | uniq | diff - /tmp/log || \ - (echo "ERROR: deutsch.locale not ordered or contains empty lines" && false) +ordercheck: $(top_srcdir)/data/locale/$(master.locale) + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq > /tmp/log + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | uniq | diff - /tmp/log || \ + (echo "ERROR: $(master.locale) not ordered or contains empty lines" && false) -locals.h: ordercheck $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | $(top_srcdir)/data/locale/create.locals.h +locals.h: ordercheck + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | \ + $(top_srcdir)/data/locale/create.locals.h -locals_intern.h: ordercheck $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq | $(top_srcdir)/data/locale/create.locals_intern.h +locals_intern.h: ordercheck + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | \ + $(top_srcdir)/data/locale/create.locals_intern.h check: locals.h locals_intern.h diff locals.h $(top_srcdir)/src/system @@ -50,11 +55,11 @@ check: locals.h locals_intern.h install-locals: locals.h locals_intern.h cp locals.h locals_intern.h $(top_srcdir)/src/system - @echo "Consider committing src/system/[locals.h,locals_intern.h]" - cp -f deutsch.locale english.locale $(top_srcdir)/data/locale - @echo "Consider committing data/locale/[deutsch.locale,english.locale]" + @echo "Consider committing src/system/[locals.h locals_intern.h]" + cp -f $(locale) $(top_srcdir)/data/locale + @echo "Consider committing data/locale/[$(locale)]" locals-clean: - rm -f locals.h locals_intern.h deutsch.locale english.locale + rm -f locals.h locals_intern.h $(locale) endif diff --git a/data/locale/_readme.txt b/data/locale/_readme.txt index cd4366866..ca063f2fb 100644 --- a/data/locale/_readme.txt +++ b/data/locale/_readme.txt @@ -12,7 +12,7 @@ directory: /var/tuxbox/config/locale or /share/tuxbox/neutrino/locale Master file: ------------ -deutsch.locale is considered the master file. +english.locale is considered the master file. Verfication of .locale files: @@ -27,15 +27,14 @@ Use the check.locale.files shell script for detecting How do I add a new locale string? --------------------------------- 1.) -First of all, add the new string to deutsch.locale while preserving +First of all, add the new string to english.locale while preserving the ordering. Do not add any empty lines. 2.) Enter the directory build_tmp/neutrino-hd/data/locale. 3.) -Use for sorting (deutsch.locale,english.locale) 'make sort-locals', use 'make ordercheck' to for -verification. +Use for sorting 'make sort-locals', use 'make ordercheck' to for verification. 4.) Create new versions of the files src/system/locals.h and src/system/locals_intern.h @@ -60,7 +59,7 @@ locale-files, src/system/locals.h, and src/system/locals_intern.h. Useful tools: ------------- -- emacs (add '(file-coding-system-alist (quote (("\\.locale\\'" . utf-8-unix) ("" undecided)))) to .emacs or use "C-x c utf-8 C-x C-f deutsch.locale") +- emacs (add '(file-coding-system-alist (quote (("\\.locale\\'" . utf-8-unix) ("" undecided)))) to .emacs or use "C-x c utf-8 C-x C-f english.locale") - iconv - sort - uxterm diff --git a/data/locale/check.locale.files b/data/locale/check.locale.files index ef63e8cfd..5b3cf27d1 100755 --- a/data/locale/check.locale.files +++ b/data/locale/check.locale.files @@ -1,5 +1,5 @@ #!/bin/sh -cut -d' ' -f1 deutsch.locale | sort | uniq > /tmp/log +cut -d' ' -f1 english.locale | sort | uniq > /tmp/log for i in *.locale; do \ echo $i:; \ echo "----------------"; \ diff --git a/data/locale/create-locals-update.pl b/data/locale/create-locals-update.pl index 7abc7aaad..91c0705f9 100755 --- a/data/locale/create-locals-update.pl +++ b/data/locale/create-locals-update.pl @@ -7,7 +7,7 @@ # Written by Barf on 2005-12-10. -$masterfilename = "deutsch.locale"; +$masterfilename = "english.locale"; $#ARGV == 0 || die("Usage: create-locals-update.pl file.locale."); diff --git a/data/locale/create.locals.h b/data/locale/create.locals.h index 6f0bbb788..11fe2fd20 100755 --- a/data/locale/create.locals.h +++ b/data/locale/create.locals.h @@ -1,5 +1,5 @@ #!/bin/bash -# usage: cut -d' ' -f1 deutsch.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./create.locals.h +# usage: cut -d' ' -f1 english.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./create.locals.h cat > locals.h < locals_intern.h < Date: Wed, 24 Oct 2012 15:45:57 +0200 Subject: [PATCH 054/116] locale: move scripts to subdir 'helpers/' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f0bfe2167c3c4f84e0e810ce7b58632a713101f4 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locale: move scripts to subdir 'helpers/' ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/Makefile.am | 4 ++-- data/locale/_readme.txt | 4 ++-- data/locale/{check.locale.files => helpers/check-locale} | 0 .../{create-locals-update.pl => helpers/create-locals-work} | 2 +- data/locale/{create.locals.h => helpers/create-locals.h} | 2 +- .../create-locals_intern.h} | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename data/locale/{check.locale.files => helpers/check-locale} (100%) rename data/locale/{create-locals-update.pl => helpers/create-locals-work} (95%) rename data/locale/{create.locals.h => helpers/create-locals.h} (93%) rename data/locale/{create.locals_intern.h => helpers/create-locals_intern.h} (97%) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index a88f19957..0199402f3 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -43,11 +43,11 @@ ordercheck: $(top_srcdir)/data/locale/$(master.locale) locals.h: ordercheck cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | \ - $(top_srcdir)/data/locale/create.locals.h + $(top_srcdir)/data/locale/helpers/create-locals.h locals_intern.h: ordercheck cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | \ - $(top_srcdir)/data/locale/create.locals_intern.h + $(top_srcdir)/data/locale/helpers/create-locals_intern.h check: locals.h locals_intern.h diff locals.h $(top_srcdir)/src/system diff --git a/data/locale/_readme.txt b/data/locale/_readme.txt index ca063f2fb..364b955ea 100644 --- a/data/locale/_readme.txt +++ b/data/locale/_readme.txt @@ -17,7 +17,7 @@ english.locale is considered the master file. Verfication of .locale files: ----------------------------- -Use the check.locale.files shell script for detecting +Use ./helpers/check-locale for detecting in master file - violations of the sorting order, - missing translations and - legacy strings. @@ -51,7 +51,7 @@ Or use for item 3-6 'make locals' 8.) To the extent possible, update other locale file. For this, the -Perl-script create-locals-update.pl may be useful. +Perl-script ./helpers/create-locals-work may be useful. 9.) If committing the changes to Git, commit both the involved diff --git a/data/locale/check.locale.files b/data/locale/helpers/check-locale similarity index 100% rename from data/locale/check.locale.files rename to data/locale/helpers/check-locale diff --git a/data/locale/create-locals-update.pl b/data/locale/helpers/create-locals-work similarity index 95% rename from data/locale/create-locals-update.pl rename to data/locale/helpers/create-locals-work index 91c0705f9..9dfe879b0 100755 --- a/data/locale/create-locals-update.pl +++ b/data/locale/helpers/create-locals-work @@ -9,7 +9,7 @@ $masterfilename = "english.locale"; -$#ARGV == 0 || die("Usage: create-locals-update.pl file.locale."); +$#ARGV == 0 || die("Usage: create-locals-work file.locale."); $no_errors = 0; $last_was_ok = 1; diff --git a/data/locale/create.locals.h b/data/locale/helpers/create-locals.h similarity index 93% rename from data/locale/create.locals.h rename to data/locale/helpers/create-locals.h index 11fe2fd20..efad5d9d8 100755 --- a/data/locale/create.locals.h +++ b/data/locale/helpers/create-locals.h @@ -1,5 +1,5 @@ #!/bin/bash -# usage: cut -d' ' -f1 english.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./create.locals.h +# usage: cut -d' ' -f1 english.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./helpers/create-locals.h cat > locals.h < locals_intern.h < Date: Wed, 24 Oct 2012 16:00:27 +0200 Subject: [PATCH 055/116] locale: fix logic in Makefile Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/725b8be0d644fb4c2e98d326f70568419a96723c Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locale: fix logic in Makefile ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 0199402f3..654d8eea9 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -34,7 +34,6 @@ sort-locals: $(top_srcdir)/data/locale/$(master.locale) for locale in $(locale); do \ cat $(top_srcdir)/data/locale/$${locale} | LC_ALL=C sort | uniq > $${locale}; \ done - cp -f $(locale) $(top_srcdir)/data/locale ordercheck: $(top_srcdir)/data/locale/$(master.locale) cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq > /tmp/log @@ -53,7 +52,7 @@ check: locals.h locals_intern.h diff locals.h $(top_srcdir)/src/system diff locals_intern.h $(top_srcdir)/src/system -install-locals: locals.h locals_intern.h +install-locals: sort-locals locals.h locals_intern.h cp locals.h locals_intern.h $(top_srcdir)/src/system @echo "Consider committing src/system/[locals.h locals_intern.h]" cp -f $(locale) $(top_srcdir)/data/locale From 6da9177fb1f0f5d2652781579281e0a39ad67754 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 16:08:52 +0200 Subject: [PATCH 056/116] locale: rework helperscripts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca88052c14c8653bfea6d0c7740476c639525e02 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - locale: rework helperscripts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/helpers/create-locals.h | 13 +++++-------- data/locale/helpers/create-locals_intern.h | 19 +++++-------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/data/locale/helpers/create-locals.h b/data/locale/helpers/create-locals.h index efad5d9d8..946b43138 100755 --- a/data/locale/helpers/create-locals.h +++ b/data/locale/helpers/create-locals.h @@ -1,6 +1,6 @@ #!/bin/bash # usage: cut -d' ' -f1 english.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./helpers/create-locals.h -cat > locals.h < locals.h < locals.h <> locals.h; - fi + echo $'\t'"LOCALE_$id," >> locals.h; done + cat >> locals.h < locals_intern.h < locals_intern.h < locals_intern.h <> locals_intern.h; - fi + echo $'\t'"\"$id\"," >> locals_intern.h; done + cat >> locals_intern.h < Date: Wed, 24 Oct 2012 18:11:06 +0400 Subject: [PATCH 057/116] gui/Makefile.am: add include path Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cd561d775f49933f9c34785b3d25739903a3c02a Author: [CST] Focus Date: 2012-10-24 (Wed, 24 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 629a488f2..9b5fad465 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -23,6 +23,7 @@ INCLUDES = \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/libnet \ -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/lib/libupnpclient \ @CURL_CFLAGS@ \ From 5b2362f40ea43eff51b161073e636d21d3096d04 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 24 Oct 2012 18:12:56 +0400 Subject: [PATCH 058/116] gui/cam_menu.cpp: send capmt on card/module init message Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/398f01ca50bae20ade703074faea6aba58a91212 Author: [CST] Focus Date: 2012-10-24 (Wed, 24 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/cam_menu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 6da597a76..be4d5668c 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -49,6 +49,8 @@ #include #include +#include +#include void CCAMMenuHandler::init(void) { @@ -269,6 +271,7 @@ int CCAMMenuHandler::handleCamMsg (const neutrino_msg_t msg, neutrino_msg_data_t snprintf(str, sizeof(str), "%s %d: %s", g_Locale->getText(SlotType == CA_SLOT_TYPE_CI ? LOCALE_CI_INIT_OK : LOCALE_SC_INIT_OK), (int)curslot+1, name); printf("CCAMMenuHandler::handleCamMsg: %s\n", str); + CCamManager::getInstance()->Start(CZapit::getInstance()->GetCurrentChannelID(), CCamManager::PLAY, true); ShowHintUTF(LOCALE_MESSAGEBOX_INFO, str); #if 0 showHintBox(LOCALE_MESSAGEBOX_INFO, str, CI_MSG_TIME); From 08941e670592c155a6846fb4ed3ad1379f83b1f5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 16:39:51 +0200 Subject: [PATCH 059/116] icons: move locale icons to a subdir 'locale/' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f92eb8e843b3fff09c42a56af9723d8654a80242 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - icons: move locale icons to a subdir 'locale/' ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 42 ++++++++++-------- data/icons/{ => locale}/deutsch.png | Bin data/icons/{ => locale}/english.png | Bin .../{ => locale/unmaintained}/bayrisch.png | Bin .../{ => locale/unmaintained}/bosanski.png | Bin .../unmaintained}/ch-baslerdeutsch.png | Bin .../unmaintained}/ch-berndeutsch.png | Bin .../icons/{ => locale/unmaintained}/czech.png | Bin .../icons/{ => locale/unmaintained}/dutch.png | Bin .../{ => locale/unmaintained}/francais.png | Bin .../{ => locale/unmaintained}/french.png | Bin .../{ => locale/unmaintained}/hungarian.png | Bin .../{ => locale/unmaintained}/italiano.png | Bin .../{ => locale/unmaintained}/nederlands.png | Bin .../{ => locale/unmaintained}/polski.png | Bin .../{ => locale/unmaintained}/portugues.png | Bin .../{ => locale/unmaintained}/russkij.png | Bin .../{ => locale/unmaintained}/slovak.png | Bin .../icons/{ => locale/unmaintained}/suomi.png | Bin .../{ => locale/unmaintained}/svenska.png | Bin 20 files changed, 24 insertions(+), 18 deletions(-) rename data/icons/{ => locale}/deutsch.png (100%) rename data/icons/{ => locale}/english.png (100%) rename data/icons/{ => locale/unmaintained}/bayrisch.png (100%) rename data/icons/{ => locale/unmaintained}/bosanski.png (100%) rename data/icons/{ => locale/unmaintained}/ch-baslerdeutsch.png (100%) rename data/icons/{ => locale/unmaintained}/ch-berndeutsch.png (100%) rename data/icons/{ => locale/unmaintained}/czech.png (100%) rename data/icons/{ => locale/unmaintained}/dutch.png (100%) rename data/icons/{ => locale/unmaintained}/francais.png (100%) rename data/icons/{ => locale/unmaintained}/french.png (100%) rename data/icons/{ => locale/unmaintained}/hungarian.png (100%) rename data/icons/{ => locale/unmaintained}/italiano.png (100%) rename data/icons/{ => locale/unmaintained}/nederlands.png (100%) rename data/icons/{ => locale/unmaintained}/polski.png (100%) rename data/icons/{ => locale/unmaintained}/portugues.png (100%) rename data/icons/{ => locale/unmaintained}/russkij.png (100%) rename data/icons/{ => locale/unmaintained}/slovak.png (100%) rename data/icons/{ => locale/unmaintained}/suomi.png (100%) rename data/icons/{ => locale/unmaintained}/svenska.png (100%) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 66dc9a37d..bd15fdfc6 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -1,6 +1,29 @@ installdir = $(DATADIR)/neutrino/icons -install_DATA = \ +locale = \ + locale/deutsch.png \ + locale/english.png + +locale_unmaintained = \ + locale/unmaintained/bayrisch.png \ + locale/unmaintained/bosanski.png \ + locale/unmaintained/ch-baslerdeutsch.png \ + locale/unmaintained/ch-berndeutsch.png \ + locale/unmaintained/czech.png \ + locale/unmaintained/francais.png \ + locale/unmaintained/italiano.png \ + locale/unmaintained/nederlands.png \ + locale/unmaintained/polski.png \ + locale/unmaintained/portugues.png \ + locale/unmaintained/russkij.png \ + locale/unmaintained/slovak.png \ + locale/unmaintained/suomi.png \ + locale/unmaintained/svenska.png + +install_DATA = $(locale) +install_DATA += $(locale_unmaintained) + +install_DATA += \ 0.png \ 1.png \ 16_9.png \ @@ -16,7 +39,6 @@ install_DATA = \ ats.png \ ats_gray.png \ audio.png \ - bayrisch.png \ biss_green.png \ biss_white.png \ biss_yellow.png \ @@ -24,15 +46,12 @@ install_DATA = \ bookmarkmanager.png \ border_lr.png \ border_ul.png \ - bosanski.png \ btn_record_active.png \ btn_record_inactive.png \ btn_stop.png \ ca.png \ ca2.png \ ca2_gray.png \ - ch-baslerdeutsch.png \ - ch-berndeutsch.png \ colors.png \ conax_green.png \ conax_white.png \ @@ -40,7 +59,6 @@ install_DATA = \ cw_green.png \ cw_white.png \ cw_yellow.png \ - czech.png \ d_green.png \ d_white.png \ d_yellow.png \ @@ -48,17 +66,13 @@ install_DATA = \ dd_avail.png \ dd_gray.png \ ddfill.png \ - deutsch.png \ down.png \ dutch.png \ ellinika.png \ - english.png \ error.png \ features.png \ file.png \ folder.png \ - francais.png \ - french.png \ games.png \ gelb.png \ gruen.png \ @@ -120,7 +134,6 @@ install_DATA = \ ird_green.png \ ird_white.png \ ird_yellow.png \ - italiano.png \ keybinding.png \ language.png \ lcd.png \ @@ -157,7 +170,6 @@ install_DATA = \ nds_green.png \ nds_white.png \ nds_yellow.png \ - nederlands.png \ network.png \ norsk.png \ not_mounted.png \ @@ -165,8 +177,6 @@ install_DATA = \ numericpad.png \ ok.png \ personalize.png \ - polski.png \ - portugues.png \ power.png \ powervu_green.png \ powervu_white.png \ @@ -210,7 +220,6 @@ install_DATA = \ right.png \ romania.png \ rot.png \ - russkij.png \ scan.jpg \ seca_green.png \ seca_white.png \ @@ -218,14 +227,11 @@ install_DATA = \ settings.png \ shell.png \ shutdown.jpg \ - slovak.png \ softupdate.png \ start.jpg \ streaming.png \ subt.png \ subt_gray.png \ - suomi.png \ - svenska.png \ timer.png \ tuner_1.png \ tuner_2.png \ diff --git a/data/icons/deutsch.png b/data/icons/locale/deutsch.png similarity index 100% rename from data/icons/deutsch.png rename to data/icons/locale/deutsch.png diff --git a/data/icons/english.png b/data/icons/locale/english.png similarity index 100% rename from data/icons/english.png rename to data/icons/locale/english.png diff --git a/data/icons/bayrisch.png b/data/icons/locale/unmaintained/bayrisch.png similarity index 100% rename from data/icons/bayrisch.png rename to data/icons/locale/unmaintained/bayrisch.png diff --git a/data/icons/bosanski.png b/data/icons/locale/unmaintained/bosanski.png similarity index 100% rename from data/icons/bosanski.png rename to data/icons/locale/unmaintained/bosanski.png diff --git a/data/icons/ch-baslerdeutsch.png b/data/icons/locale/unmaintained/ch-baslerdeutsch.png similarity index 100% rename from data/icons/ch-baslerdeutsch.png rename to data/icons/locale/unmaintained/ch-baslerdeutsch.png diff --git a/data/icons/ch-berndeutsch.png b/data/icons/locale/unmaintained/ch-berndeutsch.png similarity index 100% rename from data/icons/ch-berndeutsch.png rename to data/icons/locale/unmaintained/ch-berndeutsch.png diff --git a/data/icons/czech.png b/data/icons/locale/unmaintained/czech.png similarity index 100% rename from data/icons/czech.png rename to data/icons/locale/unmaintained/czech.png diff --git a/data/icons/dutch.png b/data/icons/locale/unmaintained/dutch.png similarity index 100% rename from data/icons/dutch.png rename to data/icons/locale/unmaintained/dutch.png diff --git a/data/icons/francais.png b/data/icons/locale/unmaintained/francais.png similarity index 100% rename from data/icons/francais.png rename to data/icons/locale/unmaintained/francais.png diff --git a/data/icons/french.png b/data/icons/locale/unmaintained/french.png similarity index 100% rename from data/icons/french.png rename to data/icons/locale/unmaintained/french.png diff --git a/data/icons/hungarian.png b/data/icons/locale/unmaintained/hungarian.png similarity index 100% rename from data/icons/hungarian.png rename to data/icons/locale/unmaintained/hungarian.png diff --git a/data/icons/italiano.png b/data/icons/locale/unmaintained/italiano.png similarity index 100% rename from data/icons/italiano.png rename to data/icons/locale/unmaintained/italiano.png diff --git a/data/icons/nederlands.png b/data/icons/locale/unmaintained/nederlands.png similarity index 100% rename from data/icons/nederlands.png rename to data/icons/locale/unmaintained/nederlands.png diff --git a/data/icons/polski.png b/data/icons/locale/unmaintained/polski.png similarity index 100% rename from data/icons/polski.png rename to data/icons/locale/unmaintained/polski.png diff --git a/data/icons/portugues.png b/data/icons/locale/unmaintained/portugues.png similarity index 100% rename from data/icons/portugues.png rename to data/icons/locale/unmaintained/portugues.png diff --git a/data/icons/russkij.png b/data/icons/locale/unmaintained/russkij.png similarity index 100% rename from data/icons/russkij.png rename to data/icons/locale/unmaintained/russkij.png diff --git a/data/icons/slovak.png b/data/icons/locale/unmaintained/slovak.png similarity index 100% rename from data/icons/slovak.png rename to data/icons/locale/unmaintained/slovak.png diff --git a/data/icons/suomi.png b/data/icons/locale/unmaintained/suomi.png similarity index 100% rename from data/icons/suomi.png rename to data/icons/locale/unmaintained/suomi.png diff --git a/data/icons/svenska.png b/data/icons/locale/unmaintained/svenska.png similarity index 100% rename from data/icons/svenska.png rename to data/icons/locale/unmaintained/svenska.png From 41cdeac1b8435bb95d9eb0edf3ef7bc79f9695c4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 16:51:25 +0200 Subject: [PATCH 060/116] icons: supplement to previous commit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/90e3ad99d8e3fbd77949e5f2127fa925021212f2 Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - icons: supplement to previous commit ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index bd15fdfc6..bc1fd54ac 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -67,7 +67,6 @@ install_DATA += \ dd_gray.png \ ddfill.png \ down.png \ - dutch.png \ ellinika.png \ error.png \ features.png \ From 5fcf24d1daf51aedb22513aebdec56afe4d25169 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 16:56:28 +0200 Subject: [PATCH 061/116] icons: supplement to previous commit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5cee221e46e98424190814affd4c1e5c1cf8c0ad Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - icons: supplement to previous commit ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index bc1fd54ac..f0396f365 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -121,7 +121,6 @@ install_DATA += \ hint_vfd.png \ hint_video.png \ home.png \ - hungarian.png \ icon_green.png \ icon_movieplayer.png \ icon_red.png \ From 3f047b95b704d85625c880cf36cb48d096e0c946 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 24 Oct 2012 17:25:16 +0200 Subject: [PATCH 062/116] icons: move orphaned icons to a subdir 'orphaned/' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f581006d0f4daf97160cbebe5e165d206363b77b Author: vanhofen Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ - icons: move orphaned icons to a subdir 'orphaned/' ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/Makefile.am | 3 --- data/icons/{ => locale/orphaned}/ellinika.png | Bin data/icons/{ => locale/orphaned}/norsk.png | Bin data/icons/{ => locale/orphaned}/romania.png | Bin 4 files changed, 3 deletions(-) rename data/icons/{ => locale/orphaned}/ellinika.png (100%) rename data/icons/{ => locale/orphaned}/norsk.png (100%) rename data/icons/{ => locale/orphaned}/romania.png (100%) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index f0396f365..4dd2afa5f 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -67,7 +67,6 @@ install_DATA += \ dd_gray.png \ ddfill.png \ down.png \ - ellinika.png \ error.png \ features.png \ file.png \ @@ -169,7 +168,6 @@ install_DATA += \ nds_white.png \ nds_yellow.png \ network.png \ - norsk.png \ not_mounted.png \ notyet.png \ numericpad.png \ @@ -216,7 +214,6 @@ install_DATA += \ res_hd.png \ res_sd.png \ right.png \ - romania.png \ rot.png \ scan.jpg \ seca_green.png \ diff --git a/data/icons/ellinika.png b/data/icons/locale/orphaned/ellinika.png similarity index 100% rename from data/icons/ellinika.png rename to data/icons/locale/orphaned/ellinika.png diff --git a/data/icons/norsk.png b/data/icons/locale/orphaned/norsk.png similarity index 100% rename from data/icons/norsk.png rename to data/icons/locale/orphaned/norsk.png diff --git a/data/icons/romania.png b/data/icons/locale/orphaned/romania.png similarity index 100% rename from data/icons/romania.png rename to data/icons/locale/orphaned/romania.png From d4073693d9c7297cd4ce3748f804249baa8fbf6a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 21 Oct 2012 17:50:04 +0200 Subject: [PATCH 063/116] Add file/directory functions to src/system/helpers.cpp - Required for 'update with settings' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/690786c37c1e21cfd15f31b786484899be50656f Author: Michael Liebmann Date: 2012-10-21 (Sun, 21 Oct 2012) Origin message was: ------------------ * Add file/directory functions to src/system/helpers.cpp - Required for 'update with settings' ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 229 +++++++++++++++++++++++++++++++++++++++++ src/system/helpers.h | 22 ++++ 2 files changed, 251 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index a564982e6..df2d2e880 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -33,6 +33,7 @@ #include /* or */ #include #include +#include #include #include @@ -235,3 +236,231 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree) printf("mem: total %ld cached %ld free %ld\n", kbtotal, cached, kbfree); return true; } + +std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) +{ + std::string result = str.erase(str.find_last_not_of(trimChars) + 1); + return result.erase(0, result.find_first_not_of(trimChars)); +} + +CFileHelpers::CFileHelpers() +{ + FileBufSize = 0xFFFF; + FileBuf = (char*)malloc(FileBufSize); + doCopyFlag = true; +} + +CFileHelpers::~CFileHelpers() +{ + if (FileBuf != NULL) + free(FileBuf); +} + +CFileHelpers* CFileHelpers::getInstance() +{ + static CFileHelpers* FileHelpers = NULL; + if(!FileHelpers) + FileHelpers = new CFileHelpers(); + return FileHelpers; +} + +bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) +{ + doCopyFlag = true; + unlink(Dst); + if ((fd1 = open(Src, O_RDONLY)) < 0) + return false; + if ((fd2 = open(Dst, O_WRONLY | O_CREAT)) < 0) { + close(fd2); + return false; + } + + long block; + off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); + lseek64(fd1, 0, SEEK_SET); + if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB + off64_t fsize64 = fsizeSrc64; + block = FileBufSize; + //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64); + while(fsize64 > 0) { + if(fsize64 < (off64_t)FileBufSize) + block = (long)fsize64; + read(fd1, FileBuf, block); + write(fd2, FileBuf, block); + fsize64 -= block; + if (!doCopyFlag) + break; + } + if (doCopyFlag) { + lseek64(fd2, 0, SEEK_SET); + off64_t fsizeDst64 = lseek64(fd2, 0, SEEK_END); + if (fsizeSrc64 != fsizeDst64) + return false; + } + } + else { // < 2GB + long fsizeSrc = lseek(fd1, 0, SEEK_END); + lseek(fd1, 0, SEEK_SET); + long fsize = fsizeSrc; + block = FileBufSize; + //printf("#####[%s] fsizeSrc: %ld 0x%08lX - normal file\n", __FUNCTION__, fsizeSrc, fsizeSrc); + while(fsize > 0) { + if(fsize < (long)FileBufSize) + block = fsize; + read(fd1, FileBuf, block); + write(fd2, FileBuf, block); + fsize -= block; + if (!doCopyFlag) + break; + } + if (doCopyFlag) { + lseek(fd2, 0, SEEK_SET); + long fsizeDst = lseek(fd2, 0, SEEK_END); + if (fsizeSrc != fsizeDst) + return false; + } + } + close(fd1); + close(fd2); + + if (!doCopyFlag) { + sync(); + unlink(Dst); + return false; + } + + chmod(Dst, mode); + return true; +} + +bool CFileHelpers::copyDir(const char *Src, const char *Dst) +{ + DIR *Directory; + struct dirent *CurrentFile; + static struct stat FileInfo; + char srcPath[PATH_MAX]; + char dstPath[PATH_MAX]; + char buf[PATH_MAX]; + + //open directory + if ((Directory = opendir(Src)) == NULL) + return false; + if (lstat(Src, &FileInfo) == -1) { + closedir(Directory); + return false; + } + // create directory + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(Src, buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + symlink(buf, Dst); + } + } + else { + // directory + if (createDir(Dst, FileInfo.st_mode & 0x0FFF) == false) { + if (errno != EEXIST) { + closedir(Directory); + return false; + } + } + } + + // read directory + while ((CurrentFile = readdir(Directory)) != NULL) { + // ignore '.' and '..' + if (strcmp(CurrentFile->d_name, ".") && strcmp(CurrentFile->d_name, "..")) { + strcpy(srcPath, Src); + strcat(srcPath, "/"); + strcat(srcPath, CurrentFile->d_name); + if (lstat(srcPath, &FileInfo) == -1) { + closedir(Directory); + return false; + } + strcpy(dstPath, Dst); + strcat(dstPath, "/"); + strcat(dstPath, CurrentFile->d_name); + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(srcPath, buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + symlink(buf, dstPath); + } + } + // is directory + else if (S_ISDIR(FileInfo.st_mode)) { + copyDir(srcPath, dstPath); + } + // is file + else if (S_ISREG(FileInfo.st_mode)) { + copyFile(srcPath, dstPath, FileInfo.st_mode & 0x0FFF); + } + } + } + closedir(Directory); + return true; +} + +bool CFileHelpers::createDir(const char *Dir, mode_t mode) +{ + char dirPath[PATH_MAX]; + DIR *dir; + if ((dir = opendir(Dir)) != NULL) { + closedir(dir); + errno = EEXIST; + return false; + } + + int ret = -1; + while (ret == -1) { + strcpy(dirPath, Dir); + ret = mkdir(dirPath, mode); + if ((errno == ENOENT) && (ret == -1)) { + char * pos = strrchr(dirPath,'/'); + if (pos != NULL) { + pos[0] = '\0'; + createDir(dirPath, mode); + } + } + else { + if (ret == 0) + return true; + if (errno == EEXIST) + return true; + else + return false; + } + } + errno = 0; + return true; +} + +bool CFileHelpers::removeDir(const char *Dir) +{ + DIR *dir; + struct dirent *entry; + char path[PATH_MAX]; + + dir = opendir(Dir); + if (dir == NULL) { + printf("Error opendir()\n"); + return false; + } + while ((entry = readdir(dir)) != NULL) { + if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) { + snprintf(path, (size_t) PATH_MAX, "%s/%s", Dir, entry->d_name); + if (entry->d_type == DT_DIR) + removeDir(path); + else + unlink(path); + } + } + closedir(dir); + rmdir(Dir); + + errno = 0; + return true; +} diff --git a/src/system/helpers.h b/src/system/helpers.h index c14938527..b3393a0d3 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -34,4 +34,26 @@ int check_dir(const char * dir); bool get_fs_usage(const char * dir, long &total, long &used); bool get_mem_usage(unsigned long &total, unsigned long &free); +std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); + +class CFileHelpers +{ + private: + int FileBufSize; + char *FileBuf; + int fd1, fd2; + + public: + CFileHelpers(); + ~CFileHelpers(); + static CFileHelpers* getInstance(); + bool doCopyFlag; + + bool copyFile(const char *Src, const char *Dst, mode_t mode); + bool copyDir(const char *Src, const char *Dst); + bool createDir(const char *Dir, mode_t mode); + bool removeDir(const char *Dir); + +}; + #endif From a1161694f8275c8f10fc1ee133e29c6c7160f118 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 21 Oct 2012 15:34:28 +0200 Subject: [PATCH 064/116] Fix compiler warning "missing sentinel functions call" in src/system/helpers.cpp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37c4b21ac37ebf1983d0ce5d12f8d940c2223df4 Author: Michael Liebmann Date: 2012-10-21 (Sun, 21 Oct 2012) Origin message was: ------------------ * Fix compiler warning "missing sentinel functions call" in src/system/helpers.cpp ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index df2d2e880..d68dcf67a 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -82,7 +82,7 @@ int my_system(const char * cmd, const char * arg1, const char * arg2, const char case 0: /* child process */ for(i = 3; i < maxfd; i++) close(i); - if(execlp(cmd, cmd, arg1, arg2, arg3, arg4, arg5, arg6, NULL)) + if(execlp(cmd, cmd, arg1, arg2, arg3, arg4, arg5, arg6, (char*)NULL)) { std::string txt = "ERROR: my_system \"" + (std::string) cmd + "\""; perror(txt.c_str()); From a3dd812987926ac75c11c74895da4fd094787327 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 13 Apr 2012 19:07:19 +0200 Subject: [PATCH 065/116] Software Update with apply the settings (Part1) - Settings are applied to the image before flashing - Use the function on the menu "Software Update => Expert functions => Write one partition => systemFS with settings" - Log output to /tmp/update.log for testing - Use settingsupdate.conf as config file Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b001b36f4ad3258041b24cb2423a457c6bd26d19 Author: Michael Liebmann Date: 2012-04-13 (Fri, 13 Apr 2012) Origin message was: ------------------ * Software Update with apply the settings (Part1) - Settings are applied to the image before flashing - Use the function on the menu "Software Update => Expert functions => Write one partition => systemFS with settings" - Log output to /tmp/update.log for testing - Use settingsupdate.conf as config file ------------------ This commit was generated by Migit --- data/Makefile.am | 2 +- data/settingsupdate.conf | 28 +++ src/gui/Makefile.am | 1 + src/gui/ext_update.cpp | 525 +++++++++++++++++++++++++++++++++++++++ src/gui/ext_update.h | 103 ++++++++ src/gui/update.cpp | 18 +- src/gui/update.h | 3 +- 7 files changed, 676 insertions(+), 4 deletions(-) create mode 100644 data/settingsupdate.conf create mode 100644 src/gui/ext_update.cpp create mode 100644 src/gui/ext_update.h diff --git a/data/Makefile.am b/data/Makefile.am index 7519719cd..468993836 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,4 +5,4 @@ SUBDIRS += lcd endif configdir = $(CONFIGDIR) -config_DATA = cables.xml satellites.xml encoding.conf tobackup.conf providermap.xml +config_DATA = cables.xml satellites.xml encoding.conf tobackup.conf providermap.xml settingsupdate.conf diff --git a/data/settingsupdate.conf b/data/settingsupdate.conf new file mode 100644 index 000000000..bae28ab75 --- /dev/null +++ b/data/settingsupdate.conf @@ -0,0 +1,28 @@ +# settings for logfile +Log=1 +LogFile=/tmp/update.log + + +## Mögliche Einträge: +#==================== +# ganzes Verzeichnis +#------------------- +# /var/etc + +# einzelne Datei +#---------------- +# /etc/init.d/rcS + +# Wildcards +#---------- +# /bin/*.sh + +#------------------------------------------------------------------------------------------------ +## Die Verzeichnisse "/", "/dev", "/proc", "/sys", "/mnt", "/tmp" können nicht gesichert werden!! +#------------------------------------------------------------------------------------------------ + +## Sicherungen +/etc/network +/etc/wpa_supplicant.conf +/var/etc +/var/tuxbox/config diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 9b5fad465..888d93806 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -51,6 +51,7 @@ libneutrino_gui_a_SOURCES = \ epgplus.cpp \ epgview.cpp \ eventlist.cpp \ + ext_update.cpp \ favorites.cpp \ filebrowser.cpp \ imageinfo.cpp \ diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp new file mode 100644 index 000000000..cd207c287 --- /dev/null +++ b/src/gui/ext_update.cpp @@ -0,0 +1,525 @@ +/* + update with settings - Neutrino-GUI + + Copyright (C) 2001 Steffen Hehn 'McClean' + and some other guys + Homepage: http://dbox.cyberphoria.org/ + + Copyright (C) 2012 M. Liebmann (micha-bbg) + + License: GPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#define UPDATE_DEBUG_TIMER +#define UPDATE_DEBUG + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CHintBox * hintBox = 0; + +CExtUpdate::CExtUpdate() +{ + imgFilename = ""; + mtdRamError = ""; + mtdNumber = -1; + MTDBufSize = 0xFFFF; + MTDBuf = (char*)malloc(MTDBufSize); + backupList = CONFIGDIR "/settingsupdate.conf"; + defaultBackup = CONFIGDIR; + + fUpdate = NULL; + updateLogBuf[0] = '\0'; + fLogEnabled = 1; + fLogfile = "/tmp/update.log"; + mountPkt = "/tmp/image_mount"; +} + +CExtUpdate::~CExtUpdate() +{ + if (MTDBuf != NULL) + free(MTDBuf); +} + +CExtUpdate* CExtUpdate::getInstance() +{ + static CExtUpdate* ExtUpdate = NULL; + if(!ExtUpdate) + ExtUpdate = new CExtUpdate(); + return ExtUpdate; +} + +bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::string & msg2) +{ + char buf[1024]; + + if (modus & RESET_UNLOAD) { + umount(mountPkt.c_str()); + snprintf(buf, sizeof(buf), "rmmod %s", mtdramDriver.c_str()); + my_system(buf); + } + if (modus & RESET_FD1) + close(fd1); + if (modus & RESET_FD2) + close(fd2); + if (modus & RESET_F1) + fclose(f1); + + if (msg2 == "") + snprintf(buf, sizeof(buf), "%s\n", msg1.c_str()); + else + snprintf(buf, sizeof(buf), "%s %s\n", msg1.c_str(), msg2.c_str()); + + if ((msg1 != "") || (msg2 != "")) { + mtdRamError = buf; + WRITE_UPDATE_LOG("ERROR: %s", buf); + printf(mtdRamError.c_str()); + } + if(hintBox) + hintBox->hide(); + return false; +} + +bool CExtUpdate::writemtdExt(const std::string & filename) +{ + imgFilename = "/tmp/" + FILESYSTEM_ENCODING_TO_UTF8_STRING(filename); + DBG_TIMER_START() + bool ret = writemtdExt(); + DBG_TIMER_STOP("Image bearbeiten") + if (!ret) { + if (mtdRamError != "") + DisplayErrorMessage(mtdRamError.c_str()); + } + else { + if ((mtdNumber < 3) || (mtdNumber > 4)) { + const char *err = "invalid mtdNumber\n"; + printf(err); + DisplayErrorMessage(err); + WRITE_UPDATE_LOG("ERROR: %s", err); + return false; + } + DisplayInfoMessage("Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden."); + WRITE_UPDATE_LOG("\n"); + WRITE_UPDATE_LOG("##### Settingsübernahme erfolgreich. #####\n"); + CFlashExpert::getInstance()->writemtd(filename, mtdNumber); + } + return ret; +} + +bool CExtUpdate::writemtdExt() +{ + if(!hintBox) + hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Image wird bearbeitet..."); + hintBox->paint(); + mtdRamError = ""; + std::string osrelease = ""; + mtdramDriver = ""; // driver path + char buf1[256] = ""; + char buf2[256] = ""; + + CMTDInfo * mtdInfo = CMTDInfo::getInstance(); + std::string mtdFilename = mtdInfo->findMTDsystem(); // /dev/mtdX + int mtdSize = mtdInfo->getMTDSize(mtdFilename); + int mtdEraseSize = mtdInfo->getMTDEraseSize(mtdFilename); + mtdNumber = mtdInfo->findMTDNumber(mtdFilename); + + // get osrelease + f1 = fopen("/proc/sys/kernel/osrelease", "r"); + if (f1) { + fgets(buf1, sizeof(buf1), f1); + buf1[strlen(buf1)-1] = '\0'; + osrelease = buf1; + fclose(f1); + } + else + return ErrorReset(0, "error with open /proc/sys/kernel/osrelease"); + + // check if mtdram driver is already loaded + f1 = fopen("/proc/modules", "r"); + bool mtdramLoad = false; + if (f1) { + while(fgets(buf1, sizeof(buf1), f1) != NULL) { + if (strstr(buf1, "mtdram") != NULL) { + mtdramLoad = true; + break; + } + } + } + else + return ErrorReset(0, "error with open /proc/modules"); + + if (!mtdramLoad) { + // check if exist mtdram driver + snprintf(buf1, sizeof(buf1), "/lib/modules/%s/mtdram.ko", osrelease.c_str()); + mtdramDriver = buf1; + f1 = fopen(mtdramDriver.c_str(), "r"); + if (f1) + fclose(f1); + else + return ErrorReset(0, "no mtdram driver available"); + // load mtdram driver + snprintf(buf1, sizeof(buf1), "insmod %s total_size=%d erase_size=%d 2>&1", mtdramDriver.c_str(), mtdSize/1024, mtdEraseSize/1024); + f1 = popen(buf1, "r"); + if (f1) { + buf1[0] = '\0'; + while (fgets(buf1, sizeof(buf1), f1) != NULL) {} + if (strstr(buf1, "insmod:") != NULL) + return ErrorReset(RESET_F1, buf1); + } + else + return ErrorReset(0, "error open mtdram driver"); + pclose(f1); + } + else { + DBG_MSG("mtdram driver is already loaded"); + } + + // find mtdram device + std::string mtdRamFilename = "", mtdBlockFileName = ""; + int mtdRamSize, mtdRamEraseSize, mtdRamNr = 0; + f1 = fopen("/proc/mtd", "r"); + if(!f1) + return ErrorReset(RESET_UNLOAD, "cannot read /proc/mtd"); + fgets(buf1, sizeof(buf1), f1); + while(!feof(f1)) { + if(fgets(buf1, sizeof(buf1), f1)!=NULL) { + char dummy[50] = ""; + sscanf(buf1, "mtd%1d: %8x %8x \"%48s\"\n", &mtdRamNr, &mtdRamSize, &mtdRamEraseSize, dummy); + if (strstr(buf1, "mtdram test device") != NULL) { + sprintf(buf1, "/dev/mtd%d", mtdRamNr); + mtdRamFilename = buf1; + sprintf(buf1, "/dev/mtdblock%d", mtdRamNr); + mtdBlockFileName = buf1; + break; + } + } + } + fclose(f1); + + if (mtdRamFilename == "") + return ErrorReset(RESET_UNLOAD, "no mtdram test device found"); + else { + // check mtdRamSize / mtdRamEraseSize + if ((mtdRamSize != mtdSize) || (mtdRamEraseSize != mtdEraseSize)) { + snprintf(buf2, sizeof(buf2), "error MTDSize(%08x/%08x) or MTDEraseSize(%08x/%08x)\n", mtdSize, mtdRamSize, mtdEraseSize, mtdRamEraseSize); + return ErrorReset(RESET_UNLOAD, buf2); + } + } + + // copy image to mtdblock + if (MTDBuf == NULL) + return ErrorReset(RESET_UNLOAD, "malloc error"); + fd1 = open(imgFilename.c_str(), O_RDONLY); + if (fd1 < 0) + return ErrorReset(RESET_UNLOAD, "cannot read image file: " + imgFilename); + long filesize = lseek(fd1, 0, SEEK_END); + lseek(fd1, 0, SEEK_SET); + if(filesize == 0) + return ErrorReset(RESET_UNLOAD | RESET_FD1, "image filesize is 0"); + if(filesize > mtdSize) + return ErrorReset(RESET_UNLOAD | RESET_FD1, "image filesize too large"); + fd2 = -1; + int tmpCount = 0; + while (fd2 < 0) { + fd2 = open(mtdBlockFileName.c_str(), O_WRONLY); + tmpCount++; + if (tmpCount > 3) + break; + sleep(1); + } + if (fd2 < 0) + return ErrorReset(RESET_UNLOAD | RESET_FD1, "cannot open mtdBlock"); + long fsize = filesize; + long block; + while(fsize > 0) { + block = fsize; + if(block > (long)MTDBufSize) + block = MTDBufSize; + read(fd1, MTDBuf, block); + write(fd2, MTDBuf, block); + fsize -= block; + } + close(fd1); + close(fd2); + + CFileHelpers::getInstance()->createDir(mountPkt.c_str(), 0755); + int res = mount(mtdBlockFileName.c_str(), mountPkt.c_str(), "jffs2", 0, NULL); + if (res) + return ErrorReset(RESET_UNLOAD, "mount error"); + + readBackupList(mountPkt); + + res = umount(mountPkt.c_str()); + if (res) + return ErrorReset(RESET_UNLOAD, "unmount error"); + + unlink(imgFilename.c_str()); + + // copy mtdblock to image + if (MTDBuf == NULL) + return ErrorReset(RESET_UNLOAD, "malloc error"); + fd1 = open(mtdBlockFileName.c_str(), O_RDONLY); + if (fd1 < 0) + return ErrorReset(RESET_UNLOAD, "cannot read mtdBlock"); + fsize = mtdRamSize; + fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT); + if (fd2 < 0) + return ErrorReset(RESET_UNLOAD | RESET_FD1, "cannot open image file: ", imgFilename); + while(fsize > 0) { + block = fsize; + if(block > (long)MTDBufSize) + block = MTDBufSize; + read(fd1, MTDBuf, block); + write(fd2, MTDBuf, block); + fsize -= block; + } + lseek(fd2, 0, SEEK_SET); + long fsizeDst = lseek(fd2, 0, SEEK_END); + close(fd1); + close(fd2); + // check image file size + if (mtdRamSize != fsizeDst) { + unlink(imgFilename.c_str()); + return ErrorReset(0, "error file size: ", imgFilename); + } + + // unload mtdramDriver only + ErrorReset(RESET_UNLOAD); + + if(hintBox) + hintBox->hide(); + + return true; +} + +std::string Wildcard = ""; + +int fileSelect(const struct dirent *entry) +{ + if ((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0)) + return 0; + else + if ((Wildcard != "") && (fnmatch(Wildcard.c_str(), entry->d_name, FNM_FILE_NAME))) + return 0; + else + return 1; + +} + +bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & dstPath) +{ + Wildcard = ""; + struct dirent **namelist; + std::string fList = fileList, dst; + static struct stat FileInfo; + char buf[PATH_MAX]; + + size_t pos = fileList.find_last_of("/"); + fList = fileList.substr(0, pos); + Wildcard = fileList.substr(pos+1); + + int n = scandir(fList.c_str(), &namelist, fileSelect, 0); + if (n > 0) { + dst = dstPath + fList; + CFileHelpers::getInstance()->createDir(dst.c_str(), 0755); + while (n--) { + std::string dName = namelist[n]->d_name; + if (lstat((fList+"/"+dName).c_str(), &FileInfo) != -1) { + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink((fList+"/"+dName).c_str(), buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + WRITE_UPDATE_LOG("symlink: %s => %s\n", (dst+"/"+dName).c_str(), buf); + symlink(buf, (dst+"/"+dName).c_str()); + } + } + else + if (S_ISREG(FileInfo.st_mode)) { + WRITE_UPDATE_LOG("copy %s => %s\n", (fList+"/"+dName).c_str(), (dst+"/"+dName).c_str()); + if (!CFileHelpers::getInstance()->copyFile((fList+"/"+dName).c_str(), (dst+"/"+dName).c_str(), FileInfo.st_mode & 0x0FFF)) + return ErrorReset(0, "copyFile error"); + } + } + free(namelist[n]); + } + free(namelist); + } + + return true; +} + +bool CExtUpdate::findConfigEntry(std::string & line, std::string find) +{ + if (line.find(find + "=") == 0) { + size_t pos = line.find_first_of('='); + line = line.substr(pos+1); + line = trim(line); + return true; + } + return false; +} + +bool CExtUpdate::readConfig(const std::string & line) +{ + std::string tmp1 = line; + if (findConfigEntry(tmp1, "Log")) { + if (tmp1 != "") + fLogEnabled = atoi(tmp1.c_str()); + return true; + } + tmp1 = line; + if (findConfigEntry(tmp1, "LogFile")) { + if (tmp1 != "") + fLogfile = tmp1; + return true; + } + + return true; +} + +bool CExtUpdate::readBackupList(const std::string & dstPath) +{ + char buf[PATH_MAX]; + static struct stat FileInfo; + + f1 = fopen(backupList.c_str(), "r"); + if (f1 == NULL) { + f1 = fopen(backupList.c_str(), "w"); + if (f1 != NULL) { + char tmp1[1024]; + snprintf(tmp1, sizeof(tmp1), "Log=%d\nLogFile=%s\n\n%s\n\n", fLogEnabled, fLogfile.c_str(), defaultBackup.c_str()); + fwrite(tmp1, 1, strlen(tmp1), f1); + fclose(f1); + } + else + return ErrorReset(0, "cannot create missing backuplist file: " + backupList); + } + + f1 = fopen(backupList.c_str(), "r"); + if (f1 == NULL) + return ErrorReset(0, "cannot read backuplist file: " + backupList); + fpos_t fz; + fseek(f1, 0, SEEK_END); + fgetpos(f1, &fz); + fseek(f1, 0, SEEK_SET); + if (fz.__pos == 0) + return ErrorReset(RESET_F1, "backuplist filesize is 0"); + size_t pos; + while(fgets(buf, sizeof(buf), f1) != NULL) { + std::string line = buf; + line = trim(line); + if (line.find_first_of("#") == 0) + continue; + pos = line.find_first_of("#"); + if (pos != std::string::npos) { + line = line.substr(0, pos); + line = trim(line); + } + // config vars + if (line.find_first_of("/+-~") != 0) { + if (line.length() > 1) + readConfig(line); + continue; + } + // special folders + else if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) || + (line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) { + snprintf(buf, sizeof(buf), "Ordner [%s] kann nicht übertragen werden. Eintrag wird übersprungen.\n", line.c_str()); + WRITE_UPDATE_LOG("%s", buf); + DisplayInfoMessage(buf); + continue; + } + // remove '/' from line end + size_t len = line.length(); + pos = line.find_last_of("/"); + if (len == pos+1) + line = line.substr(0, pos); + std::string dst = dstPath + line; + if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { + // Wildcards + WRITE_UPDATE_LOG("\n"); + DBG_MSG("Wildcards: %s\n", dst.c_str()); + WRITE_UPDATE_LOG("--------------------\n"); + WRITE_UPDATE_LOG("Wildcards: %s\n", dst.c_str()); + copyFileList(line, dstPath); + } + else { + if (lstat(line.c_str(), &FileInfo) != -1) { + if (S_ISREG(FileInfo.st_mode)) { + // one file only + pos = dst.find_last_of("/"); + std::string dir = dst.substr(0, pos); + CFileHelpers::getInstance()->createDir(dir.c_str(), 0755); + DBG_MSG("file: %s => %s\n", line.c_str(), dst.c_str()); + WRITE_UPDATE_LOG("\n"); + WRITE_UPDATE_LOG("file: %s => %s\n", line.c_str(), dst.c_str()); + WRITE_UPDATE_LOG("--------------------\n"); + if (!CFileHelpers::getInstance()->copyFile(line.c_str(), dst.c_str(), FileInfo.st_mode & 0x0FFF)) + return ErrorReset(0, "copyFile error"); + } + else if (S_ISDIR(FileInfo.st_mode)) { + // directory + DBG_MSG("directory: %s => %s\n", line.c_str(), dst.c_str()); + WRITE_UPDATE_LOG("\n"); + WRITE_UPDATE_LOG("directory: %s => %s\n", line.c_str(), dst.c_str()); + WRITE_UPDATE_LOG("--------------------\n"); + CFileHelpers::getInstance()->copyDir(line.c_str(), dst.c_str()); + } + } + + } + } + fclose(f1); + + return true; +} + +void CExtUpdate::updateLog(const char *buf) +{ + if ((!fUpdate) && (fLogEnabled)) + fUpdate = fopen(fLogfile.c_str(), "a"); + if (fUpdate) { + fwrite(buf, 1, strlen(buf), fUpdate); + fclose(fUpdate); + fUpdate = NULL; + } +} diff --git a/src/gui/ext_update.h b/src/gui/ext_update.h new file mode 100644 index 000000000..a40a0c364 --- /dev/null +++ b/src/gui/ext_update.h @@ -0,0 +1,103 @@ +/* + update with settings - Neutrino-GUI + + Copyright (C) 2001 Steffen Hehn 'McClean' + and some other guys + Homepage: http://dbox.cyberphoria.org/ + + Copyright (C) 2012 M. Liebmann (micha-bbg) + + License: GPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __CEXTUPDATE__ +#define __CEXTUPDATE__ + +#include + +#include + +#include + +class CExtUpdate +{ + private: + enum + { + RESET_UNLOAD = 1, + RESET_FD1 = 2, + RESET_FD2 = 4, + RESET_F1 = 8 + }; + std::string imgFilename; + std::string mtdRamError; + int mtdNumber; + int MTDBufSize; + char *MTDBuf; + int fd1, fd2; + FILE *f1; + std::string mtdramDriver; + std::string backupList, defaultBackup; + std::string mountPkt; + + bool writemtdExt(void); + bool readBackupList(const std::string & dstPath); + bool copyFileList(const std::string & fileList, const std::string & dstPath); + bool readConfig(const std::string & Config); + bool findConfigEntry(std::string & line, std::string find); + + FILE * fUpdate; + char updateLogBuf[1024]; + std::string fLogfile; + int fLogEnabled; + void updateLog(const char *buf); + + public: + CExtUpdate(); + ~CExtUpdate(); + static CExtUpdate* getInstance(); + + bool writemtdExt(const std::string & filename); + bool ErrorReset(bool modus, const std::string & msg1="", const std::string & msg2=""); + +}; + +#ifdef UPDATE_DEBUG_TIMER +static struct timeval timer_tv, timer_tv2; +static unsigned int timer_msec; +#define DBG_TIMER_START() gettimeofday(&timer_tv, NULL); +#define DBG_TIMER_STOP(label) \ + gettimeofday(&timer_tv2, NULL); \ + timer_msec = ((timer_tv2.tv_sec - timer_tv.tv_sec) * 1000) + ((timer_tv2.tv_usec - timer_tv.tv_usec) / 1000); \ + printf("##### [ext_update.cpp] %s: %u msec\n", label, timer_msec); +#else +#define DBG_TIMER_START() +#define DBG_TIMER_STOP(label) +#endif // UPDATE_DEBUG_TIMER + +#ifdef UPDATE_DEBUG +#define DBG_MSG(fmt, args...) printf("#### [ext_update.cpp:%s:%d] " fmt "\n", __FUNCTION__, __LINE__ , ## args); +#else +#define DBG_MSG(fmt, args...) +#endif // UPDATE_DEBUG + +#define WRITE_UPDATE_LOG(fmt, args...) \ + snprintf(updateLogBuf, sizeof(updateLogBuf), "[update:%d] " fmt, __LINE__ , ## args); \ + updateLog(updateLogBuf); + +#endif // __CEXTUPDATE__ diff --git a/src/gui/update.cpp b/src/gui/update.cpp index d61b0f542..aa236ffda 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -35,6 +35,7 @@ #endif #include +#include #include #include @@ -518,6 +519,14 @@ CFlashExpert::CFlashExpert() width = w_max (40, 10); } +CFlashExpert* CFlashExpert::getInstance() +{ + static CFlashExpert* FlashExpert = NULL; + if(!FlashExpert) + FlashExpert = new CFlashExpert(); + return FlashExpert; +} + void CFlashExpert::readmtd(int preadmtd) { char tmpStr[256]; @@ -558,7 +567,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) { char message[500]; - sprintf(message, + snprintf(message, sizeof(message), g_Locale->getText(LOCALE_FLASHUPDATE_REALLYFLASHMTD), FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(), CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str()); @@ -613,6 +622,8 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey) sprintf(sActionKey, "%s%d", actionkey.c_str(), lx); mtdselector->addItem(new CMenuForwarderNonLocalized(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey, CRCInput::convertDigitToKey(shortcut++))); } + if (actionkey == "writemtd") + mtdselector->addItem(new CMenuForwarderNonLocalized("systemFS with settings", true, NULL, this, "writemtd10", CRCInput::convertDigitToKey(shortcut++))); mtdselector->exec(NULL,""); delete mtdselector; } @@ -678,7 +689,10 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey) selectedMTD = iWritemtd; showFileSelector(""); } else { - if(selectedMTD==-1) { + if(selectedMTD == 10) { + CExtUpdate::getInstance()->writemtdExt(actionKey); + } + else if(selectedMTD==-1) { writemtd(actionKey, MTD_OF_WHOLE_IMAGE); } else { writemtd(actionKey, selectedMTD); diff --git a/src/gui/update.h b/src/gui/update.h index 6f85b9342..98122db86 100644 --- a/src/gui/update.h +++ b/src/gui/update.h @@ -74,11 +74,12 @@ class CFlashExpert : public CProgressWindow void showFileSelector(const std::string & actionkey); void readmtd(int readmtd); - void writemtd(const std::string & filename, int mtdNumber); public: CFlashExpert(); + static CFlashExpert* getInstance(); int exec(CMenuTarget* parent, const std::string & actionKey); + void writemtd(const std::string & filename, int mtdNumber); }; From 2111213cf308bc408de378cfa26bb4b8b27b6a18 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 18 Apr 2012 20:55:20 +0200 Subject: [PATCH 066/116] Software Update with apply the settings (Part2) - Use g_settings.update_dir for directory Expert functions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f0463c3044755c68978df6543aef6bdc52a56167 Author: Michael Liebmann Date: 2012-04-18 (Wed, 18 Apr 2012) Origin message was: ------------------ * Software Update with apply the settings (Part2) - Use g_settings.update_dir for directory Expert functions ------------------ This commit was generated by Migit --- src/gui/ext_update.cpp | 5 +++-- src/gui/update.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index cd207c287..77bad1dad 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -121,7 +121,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str bool CExtUpdate::writemtdExt(const std::string & filename) { - imgFilename = "/tmp/" + FILESYSTEM_ENCODING_TO_UTF8_STRING(filename); + imgFilename = (std::string)g_settings.update_dir + "/" + FILESYSTEM_ENCODING_TO_UTF8_STRING(filename); DBG_TIMER_START() bool ret = writemtdExt(); DBG_TIMER_STOP("Image bearbeiten") @@ -446,6 +446,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) size_t pos; while(fgets(buf, sizeof(buf), f1) != NULL) { std::string line = buf; + // remove comments line = trim(line); if (line.find_first_of("#") == 0) continue; @@ -476,8 +477,8 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) std::string dst = dstPath + line; if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { // Wildcards - WRITE_UPDATE_LOG("\n"); DBG_MSG("Wildcards: %s\n", dst.c_str()); + WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("--------------------\n"); WRITE_UPDATE_LOG("Wildcards: %s\n", dst.c_str()); copyFileList(line, dstPath); diff --git a/src/gui/update.cpp b/src/gui/update.cpp index aa236ffda..61c971baa 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -534,11 +534,11 @@ void CFlashExpert::readmtd(int preadmtd) gettimeofday(&tv, NULL); strftime(tmpStr, sizeof(tmpStr), "_%Y%m%d_%H%M.img", localtime(&tv.tv_sec)); CMTDInfo* mtdInfo = CMTDInfo::getInstance(); - std::string filename = "/tmp/" + mtdInfo->getMTDName(preadmtd); + std::string filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd); filename += tmpStr; if (preadmtd == -1) { - filename = "/tmp/flashimage.img"; // US-ASCII (subset of UTF-8 and ISO8859-1) + filename = (std::string)g_settings.update_dir + "/flashimage.img"; // US-ASCII (subset of UTF-8 and ISO8859-1) preadmtd = MTD_OF_WHOLE_IMAGE; } setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH); @@ -585,7 +585,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) CFlashTool ft; ft.setStatusViewer( this ); ft.setMTDDevice( CMTDInfo::getInstance()->getMTDFileName(mtdNumber) ); - if(!ft.program( "/tmp/" + filename, 50, 100)) { + if(!ft.program( (std::string)g_settings.update_dir + "/" + filename, 50, 100)) { showStatusMessageUTF(ft.getErrorMessage()); // UTF-8 sleep(10); } else { @@ -634,7 +634,7 @@ void CFlashExpert::showFileSelector(const std::string & actionkey) fileselector->addIntroItems(LOCALE_FLASHUPDATE_FILESELECTOR, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); struct dirent **namelist; - int n = scandir("/tmp", &namelist, 0, alphasort); + int n = scandir(g_settings.update_dir, &namelist, 0, alphasort); if (n < 0) { perror("no flashimages available"); From 43e82e3288e0c9402d49aa4297b98c43a267f5e2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 24 Oct 2012 23:10:51 +0200 Subject: [PATCH 067/116] Software Update with apply the settings (Part3) - Update debug msg - Use 'new CFileHelpers()' instead of 'CFileHelpers::getInstance()' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f015273703bb4ebdd6b1153bc5c87913401691c1 Author: Michael Liebmann Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ * Software Update with apply the settings (Part3) - Update debug msg - Use 'new CFileHelpers()' instead of 'CFileHelpers::getInstance()' ------------------ This commit was generated by Migit --- src/gui/ext_update.cpp | 30 +++++++++++++++++------------- src/gui/ext_update.h | 4 ++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index 77bad1dad..49260824e 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include @@ -72,12 +71,15 @@ CExtUpdate::CExtUpdate() fLogEnabled = 1; fLogfile = "/tmp/update.log"; mountPkt = "/tmp/image_mount"; + FileHelpers = NULL; } CExtUpdate::~CExtUpdate() { if (MTDBuf != NULL) free(MTDBuf); + if(FileHelpers) + delete[] FileHelpers; } CExtUpdate* CExtUpdate::getInstance() @@ -121,10 +123,12 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str bool CExtUpdate::writemtdExt(const std::string & filename) { + if(!FileHelpers) + FileHelpers = new CFileHelpers(); imgFilename = (std::string)g_settings.update_dir + "/" + FILESYSTEM_ENCODING_TO_UTF8_STRING(filename); DBG_TIMER_START() bool ret = writemtdExt(); - DBG_TIMER_STOP("Image bearbeiten") + DBG_TIMER_STOP("Image editing") if (!ret) { if (mtdRamError != "") DisplayErrorMessage(mtdRamError.c_str()); @@ -137,9 +141,9 @@ bool CExtUpdate::writemtdExt(const std::string & filename) WRITE_UPDATE_LOG("ERROR: %s", err); return false; } - DisplayInfoMessage("Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden."); + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden.", CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); WRITE_UPDATE_LOG("\n"); - WRITE_UPDATE_LOG("##### Settingsübernahme erfolgreich. #####\n"); + WRITE_UPDATE_LOG("##### Settings taken. #####\n"); CFlashExpert::getInstance()->writemtd(filename, mtdNumber); } return ret; @@ -281,7 +285,7 @@ bool CExtUpdate::writemtdExt() close(fd1); close(fd2); - CFileHelpers::getInstance()->createDir(mountPkt.c_str(), 0755); + FileHelpers->createDir(mountPkt.c_str(), 0755); int res = mount(mtdBlockFileName.c_str(), mountPkt.c_str(), "jffs2", 0, NULL); if (res) return ErrorReset(RESET_UNLOAD, "mount error"); @@ -360,7 +364,7 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & int n = scandir(fList.c_str(), &namelist, fileSelect, 0); if (n > 0) { dst = dstPath + fList; - CFileHelpers::getInstance()->createDir(dst.c_str(), 0755); + FileHelpers->createDir(dst.c_str(), 0755); while (n--) { std::string dName = namelist[n]->d_name; if (lstat((fList+"/"+dName).c_str(), &FileInfo) != -1) { @@ -375,7 +379,7 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & else if (S_ISREG(FileInfo.st_mode)) { WRITE_UPDATE_LOG("copy %s => %s\n", (fList+"/"+dName).c_str(), (dst+"/"+dName).c_str()); - if (!CFileHelpers::getInstance()->copyFile((fList+"/"+dName).c_str(), (dst+"/"+dName).c_str(), FileInfo.st_mode & 0x0FFF)) + if (!FileHelpers->copyFile((fList+"/"+dName).c_str(), (dst+"/"+dName).c_str(), FileInfo.st_mode & 0x0FFF)) return ErrorReset(0, "copyFile error"); } } @@ -464,9 +468,9 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) // special folders else if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) || (line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) { - snprintf(buf, sizeof(buf), "Ordner [%s] kann nicht übertragen werden. Eintrag wird übersprungen.\n", line.c_str()); - WRITE_UPDATE_LOG("%s", buf); - DisplayInfoMessage(buf); + snprintf(buf, sizeof(buf), "Ordner [%s] kann nicht übertragen werden. Eintrag wird übersprungen.", line.c_str()); + WRITE_UPDATE_LOG("%s%s", buf, "\n"); + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); continue; } // remove '/' from line end @@ -489,12 +493,12 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) // one file only pos = dst.find_last_of("/"); std::string dir = dst.substr(0, pos); - CFileHelpers::getInstance()->createDir(dir.c_str(), 0755); + FileHelpers->createDir(dir.c_str(), 0755); DBG_MSG("file: %s => %s\n", line.c_str(), dst.c_str()); WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("file: %s => %s\n", line.c_str(), dst.c_str()); WRITE_UPDATE_LOG("--------------------\n"); - if (!CFileHelpers::getInstance()->copyFile(line.c_str(), dst.c_str(), FileInfo.st_mode & 0x0FFF)) + if (!FileHelpers->copyFile(line.c_str(), dst.c_str(), FileInfo.st_mode & 0x0FFF)) return ErrorReset(0, "copyFile error"); } else if (S_ISDIR(FileInfo.st_mode)) { @@ -503,7 +507,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("directory: %s => %s\n", line.c_str(), dst.c_str()); WRITE_UPDATE_LOG("--------------------\n"); - CFileHelpers::getInstance()->copyDir(line.c_str(), dst.c_str()); + FileHelpers->copyDir(line.c_str(), dst.c_str()); } } diff --git a/src/gui/ext_update.h b/src/gui/ext_update.h index a40a0c364..f63e0510b 100644 --- a/src/gui/ext_update.h +++ b/src/gui/ext_update.h @@ -29,8 +29,7 @@ #define __CEXTUPDATE__ #include - -#include +#include #include @@ -54,6 +53,7 @@ class CExtUpdate std::string mtdramDriver; std::string backupList, defaultBackup; std::string mountPkt; + CFileHelpers* FileHelpers; bool writemtdExt(void); bool readBackupList(const std::string & dstPath); From 33c7b51731117bfd1e3258778e3a7fcf37927ea1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 24 Oct 2012 23:20:41 +0200 Subject: [PATCH 068/116] Software Update with apply the settings (Part4) - Use locale for message boxes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc8ddc53251da182dbcbfac6fbd352d57756b816 Author: Michael Liebmann Date: 2012-10-24 (Wed, 24 Oct 2012) Origin message was: ------------------ * Software Update with apply the settings (Part4) - Use locale for message boxes ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/gui/ext_update.cpp | 6 +++--- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index b3af1d8b4..9b0dba6b9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -484,6 +484,9 @@ flashupdate.settings Update-Einstellungen flashupdate.squashfs.noversion Bei Updates werden Versionsüberprüfungen derzeit nur über Web-Updates unterstützt.\nWollen Sie das ausgewählte Image wirklich installieren? flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben +flashupdate.update_with_settings_processed Image wird bearbeitet... +flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen. +flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden. flashupdate.updatemode Updatemodus flashupdate.updatemode_internet Internet flashupdate.updatemode_manual von lokalem Update-Verzeichnis diff --git a/data/locale/english.locale b/data/locale/english.locale index 61f7f7371..5642348c2 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -484,6 +484,9 @@ flashupdate.settings Update settings flashupdate.squashfs.noversion SquashFS version checks are currently only supported when updating over the web.\nAre you sure that you wish to install this image? flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash +flashupdate.update_with_settings_processed Image is being processed... +flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped. +flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed. flashupdate.updatemode Updatemode flashupdate.updatemode_internet internet flashupdate.updatemode_manual from local update directory diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index 49260824e..8971fe642 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -141,7 +141,7 @@ bool CExtUpdate::writemtdExt(const std::string & filename) WRITE_UPDATE_LOG("ERROR: %s", err); return false; } - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden.", CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("##### Settings taken. #####\n"); CFlashExpert::getInstance()->writemtd(filename, mtdNumber); @@ -152,7 +152,7 @@ bool CExtUpdate::writemtdExt(const std::string & filename) bool CExtUpdate::writemtdExt() { if(!hintBox) - hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Image wird bearbeitet..."); + hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED)); hintBox->paint(); mtdRamError = ""; std::string osrelease = ""; @@ -468,7 +468,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) // special folders else if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) || (line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) { - snprintf(buf, sizeof(buf), "Ordner [%s] kann nicht übertragen werden. Eintrag wird übersprungen.", line.c_str()); + snprintf(buf, sizeof(buf), g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED), line.c_str()); WRITE_UPDATE_LOG("%s%s", buf, "\n"); ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); continue; diff --git a/src/system/locals.h b/src/system/locals.h index 29b828e6e..0a6b67178 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -511,6 +511,9 @@ typedef enum LOCALE_FLASHUPDATE_SQUASHFS_NOVERSION, LOCALE_FLASHUPDATE_TITLEREADFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY, LOCALE_FLASHUPDATE_UPDATEMODE, LOCALE_FLASHUPDATE_UPDATEMODE_INTERNET, LOCALE_FLASHUPDATE_UPDATEMODE_MANUAL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8cf65aa5a..fc38e3589 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -511,6 +511,9 @@ const char * locale_real_names[] = "flashupdate.squashfs.noversion", "flashupdate.titlereadflash", "flashupdate.titlewriteflash", + "flashupdate.update_with_settings_processed", + "flashupdate.update_with_settings_skipped", + "flashupdate.update_with_settings_successfully", "flashupdate.updatemode", "flashupdate.updatemode_internet", "flashupdate.updatemode_manual", From 45a31d20d2df55b1ecc8181d0ed412b92da9c753 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 25 Oct 2012 10:43:56 +0200 Subject: [PATCH 069/116] locale: improve maintainer-targets Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/22bafbcfc763d499629e10bb019335b531e8d703 Author: vanhofen Date: 2012-10-25 (Thu, 25 Oct 2012) Origin message was: ------------------ - locale: improve maintainer-targets ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/Makefile.am | 16 +++++++++++----- data/locale/_readme.txt | 12 ++++++------ data/locale/helpers/create-locals-work | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 654d8eea9..feed9a7bc 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -28,16 +28,22 @@ if MAINTAINER_MODE master.locale=english.locale -locals: sort-locals locals.h locals_intern.h install-locals +locals: sort-locals work-locals locals.h locals_intern.h +$(master.locale) \ sort-locals: $(top_srcdir)/data/locale/$(master.locale) for locale in $(locale); do \ cat $(top_srcdir)/data/locale/$${locale} | LC_ALL=C sort | uniq > $${locale}; \ done -ordercheck: $(top_srcdir)/data/locale/$(master.locale) - cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq > /tmp/log - cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | uniq | diff - /tmp/log || \ +work-locals: $(master.locale) + for locale in $(locale); do \ + $(top_srcdir)/data/locale/helpers/create-locals-work $${locale}; \ + done + +ordercheck: $(master.locale) + cut -d' ' -f1 $(master.locale) | LC_ALL=C sort | uniq > /tmp/log + cut -d' ' -f1 $(master.locale) | uniq | diff - /tmp/log || \ (echo "ERROR: $(master.locale) not ordered or contains empty lines" && false) locals.h: ordercheck @@ -52,7 +58,7 @@ check: locals.h locals_intern.h diff locals.h $(top_srcdir)/src/system diff locals_intern.h $(top_srcdir)/src/system -install-locals: sort-locals locals.h locals_intern.h +install-locals: $(locale) locals.h locals_intern.h cp locals.h locals_intern.h $(top_srcdir)/src/system @echo "Consider committing src/system/[locals.h locals_intern.h]" cp -f $(locale) $(top_srcdir)/data/locale diff --git a/data/locale/_readme.txt b/data/locale/_readme.txt index 364b955ea..8c47c902f 100644 --- a/data/locale/_readme.txt +++ b/data/locale/_readme.txt @@ -37,21 +37,21 @@ Enter the directory build_tmp/neutrino-hd/data/locale. Use for sorting 'make sort-locals', use 'make ordercheck' to for verification. 4.) +To the extent possible, update other locale file. For this, 'make work-locals' +may be useful. if you find a file called *.locale-work, merge this into *.locale + +5.) Create new versions of the files src/system/locals.h and src/system/locals_intern.h using the command 'make locals.h locals_intern.h'. -5.) -Check the modifications with 'make check' - 6.) -Copy the replacement file to their destination with 'make install-locals' +Check the modifications with 'make check' 7.) Or use for item 3-6 'make locals' 8.) -To the extent possible, update other locale file. For this, the -Perl-script ./helpers/create-locals-work may be useful. +Copy the replacement file to their destination with 'make install-locals' 9.) If committing the changes to Git, commit both the involved diff --git a/data/locale/helpers/create-locals-work b/data/locale/helpers/create-locals-work index 9dfe879b0..4c9fba0f1 100755 --- a/data/locale/helpers/create-locals-work +++ b/data/locale/helpers/create-locals-work @@ -43,7 +43,7 @@ while () { close(outfile); -print "There were ", $no_errors, " error(s).\n"; +print "There were ", $no_errors, " error(s) in ", $localefilename, ".\n"; if ($no_errors == 0) { unlink($outfilename); From 94e8db107056a858bc843e5c77d5f17ef2ad81b0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 25 Oct 2012 16:51:07 +0400 Subject: [PATCH 070/116] gui/cam_menu.cpp: workaround, dont recalc timeout on EVT_TIMER Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2b0f2ffc565595760a95a53f0453411651aac901 Author: [CST] Focus Date: 2012-10-25 (Thu, 25 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/cam_menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index be4d5668c..34071faec 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -474,7 +474,9 @@ int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType) res = menu_return::RETURN_EXIT_ALL; } } else if (ret == 1) { - timeoutEnd = CRCInput::calcTimeoutEnd(10); + /* workaround: dont cycle here on timers */ + if (msg != NeutrinoMessages::EVT_TIMER) + timeoutEnd = CRCInput::calcTimeoutEnd(10); continue; } else if (ret == 2) { doexit = true; From a436ce1ae129bf6d4b8b3b24fc59ab2ada75ef42 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 25 Oct 2012 18:02:57 +0400 Subject: [PATCH 071/116] gui/infoviewer.cpp: init and reset radiotext position and size Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/67579409ba3c22478a8f0650bf4ac8d182a90aed Author: [CST] Focus Date: 2012-10-25 (Thu, 25 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 5c5407530..c19f612dc 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -129,6 +129,7 @@ void CInfoViewer::Init() channel_id = CZapit::getInstance()->GetCurrentChannelID();; lcdUpdateTimer = 0; + rt_x = rt_y = rt_h = rt_w = 0; } /* @@ -997,7 +998,9 @@ void CInfoViewer::showMotorMoving (int duration) void CInfoViewer::killRadiotext() { - frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h); + if (g_Radiotext->S_RtOsd) + frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h); + rt_x = rt_y = rt_h = rt_w = 0; } void CInfoViewer::showRadiotext() @@ -1133,7 +1136,6 @@ void CInfoViewer::showRadiotext() } - int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) { if ((msg == NeutrinoMessages::EVT_CURRENTNEXT_EPG) || (msg == NeutrinoMessages::EVT_NEXTPROGRAM)) { From c17e6ad4e3f4eedf6fd482c8401d0a02b61cc7e8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 25 Oct 2012 18:09:43 +0400 Subject: [PATCH 072/116] neutrino.cpp: bugfix: every soft-standby leave, new CRadioText was created; move CRadioText create before zap Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9154c96783be9ddfb0e22e4509d871cb993ae889 Author: [CST] Focus Date: 2012-10-25 (Thu, 25 Oct 2012) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 69aa17599..c5fe6c736 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3352,6 +3352,10 @@ void CNeutrinoApp::radioMode( bool rezap) g_RemoteControl->radioMode(); SetChannelMode(g_settings.channel_mode_radio); + + if (g_settings.radiotext_enable && !g_Radiotext) + g_Radiotext = new CRadioText; + if( rezap ) { t_channel_id last_chid = CZapit::getInstance()->GetLastRADIOChannel(); channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ @@ -3361,10 +3365,6 @@ void CNeutrinoApp::radioMode( bool rezap) channelList->zapTo(0); } videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); - - if (g_settings.radiotext_enable) { - g_Radiotext = new CRadioText; - } } //switching from current mode to tv or radio mode or to optional parameter prev_mode From 7d8997c9bca4800a6a4022efbfcd570e0e749a1f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 25 Oct 2012 18:48:36 +0400 Subject: [PATCH 073/116] driver/radiotext.cpp: rework CRadioText, thread now persistent, minimal delay for stop at zap, for testing Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b086415d8ffe3c4ef1288067f50439effa559f2 Author: [CST] Focus Date: 2012-10-25 (Thu, 25 Oct 2012) ------------------ This commit was generated by Migit --- src/driver/radiotext.cpp | 401 ++++++++------------------------------- src/driver/radiotext.h | 32 ++-- 2 files changed, 95 insertions(+), 338 deletions(-) diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index a32cc059e..1c0a8461a 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -2288,97 +2288,31 @@ eOSState cRTplusList::ProcessKey(eKeys Key) //--------------- End ----------------------------------------------------------------- #endif - -//static int pes_SyncBufferRead (cDemux *audioDemux, ringbuffer_t *buf, u_long *skipped_bytes); - -static bool rtThreadRunning; - -void *RadioTextThread(void *data) -{ - CRadioText *rt = ((CRadioText::s_rt_thread*)data)->rt_object; - int fd = ((CRadioText::s_rt_thread*)data)->fd; - // struct dmx_pes_filter_params flt; - cDemux *audioDemux = rt->audioDemux; - printf("in RadioTextThread fd = %d\n", fd); - - bool ret = false; - - printf("\nRadioTextThread: ###################### Setting PID 0x%x ######################\n", rt->getPid()); - - audioDemux->Stop(); - if (audioDemux->pesFilter(rt->getPid())) - { - /* start demux filter */ - if (audioDemux->Start()) - ret = true; - } - if (!ret) { - perror("RadiotextThread Audiodemuxer"); - perror("DMX_SET_PES_FILTER"); - audioDemux->Stop(); - pthread_exit(NULL); - } - /* - -- read PES packet for pid - */ -#if 0 - ringbuffer_t *buf_in = ringbuffer_create(0x1FFFF); - char *b; /* ptr to packet start */ - long count = 0; -#endif - rtThreadRunning = true; - while(rtThreadRunning) - { - int n; - unsigned char buf[0x1FFFF]; -#if 0 - int offset; - size_t rd; - u_long skipped_bytes = 0; -#endif - //printf("."); fflush(stdout); - // -- Read PES packet (sync Read) - //n = pes_SyncBufferRead (audioDemux, buf_in, &skipped_bytes); - n = audioDemux->Read(buf, sizeof(buf), 500 /*5000*/); - - // -- error or eof? - if (n <= 0) { - usleep(10000); /* save CPU if nothing read */ - continue; - } - rt->PES_Receive(buf, n); -#if 0 - rd = ringbuffer_get_readpointer(buf_in, &b, n); - /* this can not happen, because pes_SyncBufferRead() returns -1 if ringbuffer is empty - if (rd <= 0) { - continue; - } - */ - count ++; - // -- skipped Data to get sync byte? - offset = rt->PES_Receive(b, n); - - ringbuffer_read_advance(buf_in, offset); -#endif - } - - audioDemux->Stop(); - -#if 0 - ringbuffer_free(buf_in); - fprintf(stderr, "RT %s: exit\n", __FUNCTION__); -#endif - printf("\nRadioTextThread: ###################### exit ######################\n"); - pthread_exit(NULL); -} - CRadioText::CRadioText(void) { - pid = 0; - dmxfd = -1; + pid = 0; + audioDemux = NULL; + init(); + + running = true; + start(); +} + +CRadioText::~CRadioText(void) +{ + printf("CRadioText::~CRadioText\n"); + running = false; + radiotext_stop(); + cond.broadcast(); + OpenThreads::Thread::join(); + printf("CRadioText::~CRadioText done\n"); +} + +void CRadioText::init() +{ S_Verbose = 0; S_RtFunc = 1; - S_RtOsd = 1; + S_RtOsd = 0; S_RtOsdTitle = 1; S_RtOsdTags = 2; S_RtOsdPos = 2; @@ -2391,7 +2325,6 @@ CRadioText::CRadioText(void) S_RtFgCol = 1; S_RtDispl = 1; S_RtMsgItems = 0; -//int S_RtpMemNo = 25; RT_Index = 0; RT_PTY = 0; @@ -2401,265 +2334,87 @@ CRadioText::CRadioText(void) RT_PlusShow = false; RT_Replay = false; RT_ReOpen = false; - for (int i=0; i<5; i++) strcpy(RT_Text[i], ""); - strcpy(RDS_PTYN, ""); + for (int i = 0; i < 5; i++) + RT_Text[i][0] = 0; + RDS_PTYN[0] = 0; + +#if ENABLE_RASS + // Rass ... + Rass_Show = -1; // -1=No, 0=Yes, 1=display + Rass_Archiv = -1; // -1=Off, 0=Index, 1000-9990=Slidenr. +#endif + RT_MsgShow = false; // clear entries from old channel have_radiotext = false; - audioDemux = NULL; } void CRadioText::radiotext_stop(void) { - printf("\nCRadioText::radiotext_stop: ###################### pid 0x%x ######################\n", getPid()); + printf("CRadioText::radiotext_stop: ###################### pid 0x%x ######################\n", getPid()); if (getPid() != 0) { - // this stuff takes a while sometimes - look for a better syncronisation - printf("Stopping RT Thread\n"); - rtThreadRunning = false; - pthread_join(getThread(), NULL); + mutex.lock(); pid = 0; have_radiotext = false; - audioDemux->Stop(); S_RtOsd = 0; + mutex.unlock(); } - } -CRadioText::~CRadioText(void) -{ - radiotext_stop(); - pid = 0; -// printf("Deleting RT object\n"); - -// close(dmxfd); - delete audioDemux; - audioDemux = NULL; - dmxfd = -1; -} - - void CRadioText::setPid(uint inPid) { - uint oldPid = pid; - - printf("\nCRadioText::setPid: ###################### old pid 0x%x new pid 0x%x ######################\n", oldPid, inPid); - if (pid != inPid) - { - int rc; - - printf("CRadioText::setPid: setting pid 0x%x\n", inPid); + printf("CRadioText::setPid: ###################### old pid 0x%x new pid 0x%x ######################\n", pid, inPid); + if (pid != inPid) { + mutex.lock(); pid = inPid; - - // open the device if first pid - if (0 == oldPid) - { - if (audioDemux == NULL) { - audioDemux = new cDemux(1); - //audioDemux->Open(DMX_TP_CHANNEL /*DMX_AUDIO_CHANNEL*/,0,128*1024); - audioDemux->Open(DMX_PES_CHANNEL,0,128*1024); -#if 0 - bool ret = false; - if (audioDemux->pesFilter(pid)) - { - /* start demux filter */ - if (audioDemux->Start()) - ret = true; - } - if (!ret) { - perror("Radiotext Audiodemuxer"); - return; - } -#endif - // audioDemux->Stop() -#if 0 - dmxfd = open(DMXDEV, O_RDWR|O_NONBLOCK); - if (dmxfd < 0) { - perror(DMXDEV); - pthread_exit(NULL); - } -#endif - } - rt.rt_object = this; - rt.fd = dmxfd; - } - - // Setup-Params - // S_Activate = false; - // S_HMEntry = false; - S_RtFunc = 1; - S_RtOsd = 0; - S_RtOsdTitle = 1; - S_RtOsdTags = 2; - S_RtOsdPos = 2; - S_RtOsdRows = 3; - S_RtOsdLoop = 1; - S_RtOsdTO = 60; - S_RtSkinColor = false; - S_RtBgCol = 0; - S_RtBgTra = 0xA0; - S_RtFgCol = 1; - S_RtDispl = 1; - S_RtMsgItems = 0; - //int S_RtpMemNo = 25; - RT_Index = RT_PTY = 0; - - // Radiotext - RTP_ItemToggle = 1; - RTP_TToggle = 0; - RT_PlusShow = false; - RT_Replay = false; - RT_ReOpen = false; - for (int i=0; i<5; i++) strcpy(RT_Text[i], ""); - strcpy(RDS_PTYN, ""); - -#if ENABLE_RASS - // Rass ... - Rass_Show = -1; // -1=No, 0=Yes, 1=display - Rass_Archiv = -1; // -1=Off, 0=Index, 1000-9990=Slidenr. -#endif - RT_MsgShow = false; // clear entries from old channel - - rc = pthread_create(&threadRT, 0, RadioTextThread, (void *) &rt); - - if (rc) { - printf("failed to create RadioText Thread (rc=%d)\n", rc); - return; - } + init(); + mutex.unlock(); + cond.broadcast(); } } - -// ----------------------------------------------------------- -// following functions are ripped from dvbsnoop: http://dvbsnoop.sourceforge.net - -/* - -- read PES packet (Synced) - -- buffer pre-read bytes for next execution - -- return: len // read()-return code -*/ - -#if 0 -static int pes_SyncBufferRead(cDemux *audioDemux, ringbuffer_t *buf, /*u_long max_len,*/ u_long *skipped_bytes) +void CRadioText::run() { - ringbuffer_data_t vec; - int rd; - char *ppes; + uint current_pid = 0; - // -- simple PES sync... seek for 0x000001 (PES_SYNC_BYTE) - // ISO/IEC 13818-1: - // -- packet_start_code_prefix -- The packet_start_code_prefix is - // -- a 24-bit code. Together with the stream_id that follows it constitutes - // -- a packet start code that identifies the beginning of a packet. - // -- The packet_start_code_prefix is the bit stream - // -- '0000 0000 0000 0000 0000 0001' (0x000001). + printf("CRadioText::run: ###################### Starting thread ######################\n"); + audioDemux = new cDemux(1); + audioDemux->Open(DMX_PES_CHANNEL,0,128*1024); - *skipped_bytes = 0; - ringbuffer_get_write_vector(buf, &vec); - if (vec.len == 0) - { - fprintf(stderr, "RT %s: ringbuffer full\n", __FUNCTION__); - /* do not read anything from demux, but continue with sync */ - } - else - { - rd = audioDemux->Read((unsigned char*)vec.buf, vec.len, 5000); - if (rd < 0) - { - if (errno != EAGAIN) - { - fprintf(stderr, "RT %s: read %d errno %d (%m)\n", __FUNCTION__, rd, errno); - return rd; - } - /* if EAGAIN, still process contents of ringbuffer */ - rd = 0; + while(running) { + mutex.lock(); + if (pid == 0) { + mutex.unlock(); + audioDemux->Stop(); + pidmutex.lock(); + printf("CRadioText::run: ###################### waiting for pid.. ######################\n"); + cond.wait(&pidmutex); + pidmutex.unlock(); + mutex.lock(); } - - ringbuffer_write_advance(buf, rd); - } - - rd = ringbuffer_get_readpointer(buf, &ppes, 6); - if (rd < 6) - { -// fprintf(stderr, "RT %s: ringbuffer empty (%d < 6)\n", __FUNCTION__, rd); - return -1; - } - - if ((ppes[0] != 0x00) || (ppes[1] != 0x00) || (ppes[2] != 0x01)) - { - //INFO("async, not 000001: %02x%02x%02x ", ppes[0], ppes[1], ppes[2]); - int deleted = 0; - do { - ringbuffer_read_advance(buf, 1); // remove 1 Byte - rd = ringbuffer_get_readpointer(buf, &ppes, 6); - deleted++; - (*skipped_bytes)++; - //fprintf(stderr, "%d", rd); - if ((ppes[0] == 0x00) || (ppes[1] == 0x00) || (ppes[2] == 0x01)) - { - deleted = 0; - break; + if (pid && (current_pid != pid)) { + current_pid = pid; + printf("CRadioText::run: ###################### Setting PID 0x%x ######################\n", getPid()); + audioDemux->Stop(); + if (!audioDemux->pesFilter(getPid()) || !audioDemux->Start()) { + pid = 0; + printf("CRadioText::run: ###################### failed to start PES filter ######################\n"); } } - while (rd == 6); - //fprintf(stderr, "\n"); - if (deleted > 0) - { -// fprintf(stderr, "RT %s: No valid PES signature found. %d Bytes deleted.\n", __FUNCTION__, deleted); - return -1; + mutex.unlock(); + if (pid) { + int n; + unsigned char buf[0x1FFFF]; + + n = audioDemux->Read(buf, sizeof(buf), 500 /*5000*/); + + if (n > 0) { + //printf("."); fflush(stdout); + mutex.lock(); + PES_Receive(buf, n); + mutex.unlock(); + } } } - - // -- Sync found! - // -- evaluate packet_id and seek packet end (next sync) - if (ppes[3] >= 0xBC) { // PES system packet with length - unsigned int l; - l = (ppes[4] << 8) + ppes[5]; // PES packet size... - - if (l > 0) { - if (ringbuffer_read_space(buf) >= l + 6) - return (l + 6); - else - return 0; - } else - ringbuffer_read_advance(buf, 6); - } else { - // will resync automatically on next invocation. Enough? - ringbuffer_read_advance(buf, 4); - } - -#if 0 - // -- seek packet end (sync to next packet) - // -- ISO 13818-1 length=0 packets (unbound video streams) - // -- ISO 13818-2 packets - - sync = 0xFFFFFFFF; - while (max_len > 0) { - u_char c; - int n; - - // $$$ TODO: may be optimized - n = pes_rawBufferedRead (fd, buf,1); - if (n < 0) return n; - - c = *buf++; - max_len -= n; - - // -- EOF - if (n == 0) { - return (long) (buf - org_buf); - } - - - // -- next packet found? (sync detected) - sync = (sync << 8) | c; - if ( (sync & 0x00FFFFFF) == 0x000001 ) { - pes_rawBufferedPushByte (*(--buf)); // push back sync bytes - pes_rawBufferedPushByte (*(--buf)); - pes_rawBufferedPushByte (*(--buf)); - return (long) (buf - org_buf); - } - } -#endif - -// fprintf(stderr, "RT %s: unsynced, ret = -1! (this never happens) ppes[3] = 0x%02x\n", __FUNCTION__, ppes[3]); - return -1; // buffer overflow + delete audioDemux; + audioDemux = NULL; + printf("CRadioText::run: ###################### exit ######################\n"); } -#endif diff --git a/src/driver/radiotext.h b/src/driver/radiotext.h index 5b6af9726..0a2b64ae9 100644 --- a/src/driver/radiotext.h +++ b/src/driver/radiotext.h @@ -59,6 +59,8 @@ #endif #include +#include +#include //#define ENABLE_RASS @@ -88,13 +90,8 @@ public: #define RT_MEL 65 #define tr(a) a -class CRadioText { - -public: - typedef struct { - CRadioText *rt_object; - int fd; - } s_rt_thread; +class CRadioText : public OpenThreads::Thread +{ private: bool enabled; @@ -107,17 +104,26 @@ private: int first_packets; //Radiotext +#if 0 // cDevice *rdsdevice; void RadiotextCheckPES(const uchar *Data, int Length); - void RadioStatusMsg(void); void AudioRecorderService(void); +#endif + void RadioStatusMsg(void); void RassDecode(uchar *Data, int Length); bool DividePes(unsigned char *data, int length, int *substart, int *subend); uint pid; - pthread_t threadRT; - int dmxfd; + //pthread_t threadRT; + //int dmxfd; + OpenThreads::Mutex mutex; + OpenThreads::Mutex pidmutex; + OpenThreads::Condition cond; + bool running; + + void run(); + void init(); public: CRadioText(void); ~CRadioText(void); @@ -133,15 +139,11 @@ public: void setPid(uint inPid); uint getPid(){ return pid; } - int run(void); - int getDMXfd(void) { return dmxfd; } -// s_rt_thread& getThreadParams(void) { return rt; } - pthread_t getThread(void) { return threadRT; } + void radiotext_stop(void); bool haveRadiotext(void) {return have_radiotext; } cDemux *audioDemux; - s_rt_thread rt; //Setup-Params int S_RtFunc; From 8a974dac3a87f3f5d8d4c46e8ca433faefcccc07 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 26 Oct 2012 01:46:23 +0200 Subject: [PATCH 074/116] Software Update with apply the settings (Part5) - Fix 'load mtdram driver' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/baf803c0dbc47ca5882b81301e673f9d4a399c59 Author: Michael Liebmann Date: 2012-10-26 (Fri, 26 Oct 2012) Origin message was: ------------------ * Software Update with apply the settings (Part5) - Fix 'load mtdram driver' ------------------ This commit was generated by Migit --- src/gui/ext_update.cpp | 72 +++++++++++++++++++----------------------- src/gui/ext_update.h | 1 + 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index 8971fe642..392819871 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -53,6 +53,7 @@ #include #include #include +#include CHintBox * hintBox = 0; @@ -96,8 +97,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str if (modus & RESET_UNLOAD) { umount(mountPkt.c_str()); - snprintf(buf, sizeof(buf), "rmmod %s", mtdramDriver.c_str()); - my_system(buf); + my_system("rmmod", mtdramDriver.c_str()); } if (modus & RESET_FD1) close(fd1); @@ -148,7 +148,24 @@ bool CExtUpdate::writemtdExt(const std::string & filename) } return ret; } - + +bool CExtUpdate::isMtdramLoad() +{ + char buf[256] = ""; + bool ret = false; + FILE* f = fopen("/proc/modules", "r"); + if (f) { + while(fgets(buf, sizeof(buf), f) != NULL) { + if (strstr(buf, "mtdram") != NULL) { + ret = true; + break; + } + } + fclose(f); + } + return ret; +} + bool CExtUpdate::writemtdExt() { if(!hintBox) @@ -167,51 +184,26 @@ bool CExtUpdate::writemtdExt() mtdNumber = mtdInfo->findMTDNumber(mtdFilename); // get osrelease - f1 = fopen("/proc/sys/kernel/osrelease", "r"); - if (f1) { - fgets(buf1, sizeof(buf1), f1); - buf1[strlen(buf1)-1] = '\0'; - osrelease = buf1; - fclose(f1); - } + struct utsname uts_info; + if( uname(&uts_info) == 0 ) + osrelease = uts_info.release; else - return ErrorReset(0, "error with open /proc/sys/kernel/osrelease"); + return ErrorReset(0, "error no kernel info"); // check if mtdram driver is already loaded - f1 = fopen("/proc/modules", "r"); - bool mtdramLoad = false; - if (f1) { - while(fgets(buf1, sizeof(buf1), f1) != NULL) { - if (strstr(buf1, "mtdram") != NULL) { - mtdramLoad = true; - break; - } - } - } - else - return ErrorReset(0, "error with open /proc/modules"); - - if (!mtdramLoad) { + if (!isMtdramLoad()) { // check if exist mtdram driver snprintf(buf1, sizeof(buf1), "/lib/modules/%s/mtdram.ko", osrelease.c_str()); mtdramDriver = buf1; - f1 = fopen(mtdramDriver.c_str(), "r"); - if (f1) - fclose(f1); - else + if ( !file_exists(mtdramDriver.c_str()) ) return ErrorReset(0, "no mtdram driver available"); // load mtdram driver - snprintf(buf1, sizeof(buf1), "insmod %s total_size=%d erase_size=%d 2>&1", mtdramDriver.c_str(), mtdSize/1024, mtdEraseSize/1024); - f1 = popen(buf1, "r"); - if (f1) { - buf1[0] = '\0'; - while (fgets(buf1, sizeof(buf1), f1) != NULL) {} - if (strstr(buf1, "insmod:") != NULL) - return ErrorReset(RESET_F1, buf1); - } - else - return ErrorReset(0, "error open mtdram driver"); - pclose(f1); + snprintf(buf1, sizeof(buf1), "total_size=%d", mtdSize/1024); + snprintf(buf2, sizeof(buf2), "erase_size=%d", mtdEraseSize/1024); + my_system("insmod", mtdramDriver.c_str(), buf1, buf2); + // check if mtdram driver is now loaded + if (!isMtdramLoad()) + return ErrorReset(0, "error load mtdram driver"); } else { DBG_MSG("mtdram driver is already loaded"); diff --git a/src/gui/ext_update.h b/src/gui/ext_update.h index f63e0510b..a588cb890 100644 --- a/src/gui/ext_update.h +++ b/src/gui/ext_update.h @@ -60,6 +60,7 @@ class CExtUpdate bool copyFileList(const std::string & fileList, const std::string & dstPath); bool readConfig(const std::string & Config); bool findConfigEntry(std::string & line, std::string find); + bool isMtdramLoad(); FILE * fUpdate; char updateLogBuf[1024]; From cf8f67936a909b86e4d9d6d041276023aeae5b37 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 26 Oct 2012 18:46:59 +0400 Subject: [PATCH 075/116] zapit/src/frontend.cpp: no diseqc power-on/reset, if diseqc type is NO_DISEQC Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5db4b97d9d9e4749288b265a9da5f3fe5bfd6c00 Author: [CST] Focus Date: 2012-10-26 (Fri, 26 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/frontend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 6bbb58eb0..4ffd3be48 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -870,7 +870,7 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if (force || ((config.diseqcType <= MINI_DISEQC) + if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) && (newDiseqcType > MINI_DISEQC))) { secSetTone(SEC_TONE_OFF, 15); sendDiseqcPowerOn(); From 75937cc89b64f88f216d7d2229e096e6bcd7e382 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 26 Oct 2012 23:16:30 +0200 Subject: [PATCH 076/116] src/system/helpers.cpp: fix resource leak ,use new instead of malloc Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a03445fe401606f34e7db5d5aab21f5cc9e5cfac Author: Jacek Jendrzej Date: 2012-10-26 (Fri, 26 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index d68dcf67a..c993bbf41 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -246,14 +246,14 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) CFileHelpers::CFileHelpers() { FileBufSize = 0xFFFF; - FileBuf = (char*)malloc(FileBufSize); + FileBuf = new char[FileBufSize]; doCopyFlag = true; } CFileHelpers::~CFileHelpers() { if (FileBuf != NULL) - free(FileBuf); + delete [] FileBuf; } CFileHelpers* CFileHelpers::getInstance() @@ -271,7 +271,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) if ((fd1 = open(Src, O_RDONLY)) < 0) return false; if ((fd2 = open(Dst, O_WRONLY | O_CREAT)) < 0) { - close(fd2); + close(fd1); return false; } @@ -294,8 +294,11 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) if (doCopyFlag) { lseek64(fd2, 0, SEEK_SET); off64_t fsizeDst64 = lseek64(fd2, 0, SEEK_END); - if (fsizeSrc64 != fsizeDst64) + if (fsizeSrc64 != fsizeDst64){ + close(fd1); + close(fd2); return false; + } } } else { // < 2GB @@ -316,8 +319,11 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) if (doCopyFlag) { lseek(fd2, 0, SEEK_SET); long fsizeDst = lseek(fd2, 0, SEEK_END); - if (fsizeSrc != fsizeDst) + if (fsizeSrc != fsizeDst){ + close(fd1); + close(fd2); return false; + } } } close(fd1); From 71ae8525211fbdff70f66bec06f36b3b4e7e9578 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 27 Oct 2012 20:00:35 +0200 Subject: [PATCH 077/116] src/gui/bouquetlist.cpp: fix width Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc73e4de8644a463d12781b8e62077f4126e8833 Author: Jacek Jendrzej Date: 2012-10-27 (Sat, 27 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index f1e11d97b..8395499ab 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -337,7 +337,7 @@ int CBouquetList::show(bool bShowChannelList) CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - width = w_max (need_width, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth()*52);//500 + width = w_max (need_width, 20);//500 height = h_max (16 * fheight, 40); /* assuming all color icons must have same size */ From 87ed83c2cbc38e90b1af88da674e91fcbf647fba Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sun, 28 Oct 2012 11:08:23 +0400 Subject: [PATCH 078/116] fast scan: fix params (pointer to local variable passed) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/30e4f55a2aa7d120aef784f273c63e76141f3538 Author: [CST] Focus Date: 2012-10-28 (Sun, 28 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/include/zapit/zapit.h | 3 +++ src/zapit/src/fastscan.cpp | 4 ++-- src/zapit/src/zapit.cpp | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index a87701afc..aa32ae0b9 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -17,6 +17,7 @@ #include #include #include +#include #define PAL 0 #define NTSC 1 @@ -130,7 +131,9 @@ class CZapit : public OpenThreads::Thread CZapitChannel * current_channel; t_channel_id live_channel_id; + /* scan params */ TP_params TP; + fast_scan_type_t scant; CFrontend * live_fe; diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 0e9e8c7b4..e744fb4a5 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -63,13 +63,13 @@ void CServiceScan::InitFastscanLnb(int id) switch(id) { default: case CD_OPERATOR_ID: - case OPERATOR_TVV: + case TVV_OPERATOR_ID: satmap[192].diseqc = 0; satmap[235].diseqc = 1; satmap[282].diseqc = 2; satmap[130].diseqc = 3; break; - case OPERATOR_TELESAT: + case TELESAT_OPERATOR_ID: satmap[130].diseqc = 0; satmap[192].diseqc = 1; satmap[235].diseqc = 2; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 907232ea0..fe7fc63f6 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -807,8 +807,6 @@ bool CZapit::StartScanTP(TP_params * TPparams) bool CZapit::StartFastScan(int scan_mode, int opid) { - fast_scan_type_t scant; - scant.type = scan_mode; scant.op = (fs_operator_t) opid; From 0aca7bac9223d769f1cf141ad62e4ee050431b32 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 28 Oct 2012 13:08:55 +0100 Subject: [PATCH 079/116] src/gui/imageinfo.cpp: change SVN Version to GIT Version Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2ee2bb63f053e493c55edafef010e6eb4e8d4bd1 Author: Jacek Jendrzej Date: 2012-10-28 (Sun, 28 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 21 +++++++++++++-------- src/gui/imageinfo.cpp | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 888d93806..be5bcbad4 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,16 +1,21 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions #AM_CPPFLAGS = -fno-rtti - -BUILT_SOURCES = svn_version.h - -svn_version.h: - @if test -d .svn ; then \ - sleep 180 && rm svn_version.h & echo "#define SVNVERSION \"$$(svnversion -n || echo svn_oops!)\" " > svn_version.h ; \ +.PHONY:git_version.h +BUILT_SOURCES = git_version.h +git_version.h: + @if test -d ../../.git; then \ + echo "#define GITVERSION \"$$(git describe --dirty || echo '#define BUILT_DATE "'`date`'"' )\" " > git_version.h.tmp ; \ + if diff -q git_version.h git_version.h.tmp >/dev/null 2>&1 ; then \ + rm -f git_version.h.tmp ; \ + else \ + rm -f git_version.h ; \ + mv git_version.h.tmp git_version.h ; \ + fi; \ else \ - rm svn_version.h; echo '#define BUILT_DATE "'`date`'"' > svn_version.h ; \ + rm git_version.h; echo '#define BUILT_DATE "'`date`'"' > git_version.h ; \ fi -noinst_HEADERS = svn_version.h +noinst_HEADERS = git_version.h SUBDIRS = widget bedit diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index ac5ecfa27..9748d3f57 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -39,8 +39,8 @@ #include #include -#include "svn_version.h" -#define SVN_REV "SVN Rev.:" +#include "git_version.h" +#define GIT_DESC "GIT Desc.:" #define GIT_REV "GIT Build:" extern cVideo * videoDecoder; @@ -92,8 +92,8 @@ void CImageInfo::Init(void) offset = tmpoffset; } } -#ifdef SVNVERSION - int off_tmp = g_Font[font_info]->getRenderWidth(SVN_REV); +#ifdef GITVERSION + int off_tmp = g_Font[font_info]->getRenderWidth(GIT_DESC); #else int off_tmp = g_Font[font_info]->getRenderWidth(GIT_REV); #endif @@ -206,8 +206,8 @@ void CImageInfo::paint() const char * version = config.getString("version", "no version").c_str(); const char * docs = config.getString("docs", "http://wiki.neutrino-hd.de").c_str(); const char * forum = config.getString("forum", "http://forum.tuxbox.org").c_str(); -#ifdef SVNVERSION - const char * builddate = config.getString("builddate", SVNVERSION).c_str(); +#ifdef GITVERSION + const char * builddate = GITVERSION; #else const char * builddate = config.getString("builddate", BUILT_DATE).c_str(); #endif @@ -244,8 +244,8 @@ void CImageInfo::paint() paintLine(xpos+offset, font_info, Version_Kernel.c_str()); ypos += iheight; -#ifdef SVNVERSION - paintLine(xpos , font_info, SVN_REV); +#ifdef GITVERSION + paintLine(xpos , font_info, GIT_DESC); #else paintLine(xpos , font_info, GIT_REV); #endif From cecb35c8dba6912675b89ac9e7e61a146bc9d44d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 28 Oct 2012 13:40:27 +0100 Subject: [PATCH 080/116] fix c/p , supplement to 0aca7bac9223d769f1cf141ad62e4ee050431b32 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5a807d63fd65881f9d32f33e2fc4ad510ef9bd5 Author: Jacek Jendrzej Date: 2012-10-28 (Sun, 28 Oct 2012) Origin message was: ------------------ -fix c/p , supplement to 0aca7bac9223d769f1cf141ad62e4ee050431b32 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index be5bcbad4..33d43d6e1 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions BUILT_SOURCES = git_version.h git_version.h: @if test -d ../../.git; then \ - echo "#define GITVERSION \"$$(git describe --dirty || echo '#define BUILT_DATE "'`date`'"' )\" " > git_version.h.tmp ; \ + echo "#define GITVERSION \"$$(git describe --dirty || echo `date` )\" " > git_version.h.tmp ; \ if diff -q git_version.h git_version.h.tmp >/dev/null 2>&1 ; then \ rm -f git_version.h.tmp ; \ else \ From ce1c696dc02e72a600b4aa3cd2aa5f6065f13072 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 28 Oct 2012 14:17:36 +0100 Subject: [PATCH 081/116] dont phony git_version.h only makeversion, supplement to 0aca7bac9223d769f1cf141ad62e4ee050431b32 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df3b9e4f73554f8ed01a1633874c94e0089588d9 Author: Jacek Jendrzej Date: 2012-10-28 (Sun, 28 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 33d43d6e1..39c5967a5 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,8 +1,7 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions #AM_CPPFLAGS = -fno-rtti -.PHONY:git_version.h BUILT_SOURCES = git_version.h -git_version.h: +git_version.h: makeversion @if test -d ../../.git; then \ echo "#define GITVERSION \"$$(git describe --dirty || echo `date` )\" " > git_version.h.tmp ; \ if diff -q git_version.h git_version.h.tmp >/dev/null 2>&1 ; then \ @@ -14,9 +13,11 @@ git_version.h: else \ rm git_version.h; echo '#define BUILT_DATE "'`date`'"' > git_version.h ; \ fi - noinst_HEADERS = git_version.h +.PHONY: makeversion + + SUBDIRS = widget bedit INCLUDES = \ From c044df3aab11c4edfcde7e068ecfe04c6ea26b43 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 28 Oct 2012 20:05:42 +0100 Subject: [PATCH 082/116] neutrino: show epg infos on announce recording, ported from tuxcvs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/654ca3656d330f4c0736b008e8182d50ada5666a Author: Jacek Jendrzej Date: 2012-10-28 (Sun, 28 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 3 +- src/neutrino.cpp | 82 ++++++++++++++++++++---------------------- src/neutrino.h | 1 + 3 files changed, 42 insertions(+), 44 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 30f970f71..3ecf6e7ef 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1085,7 +1085,8 @@ printf("[neutrino] CSectionsdClient::EVT_GOT_CN_EPG\n"); break; case CTimerdClient::EVT_ANNOUNCE_ZAPTO : *msg = NeutrinoMessages::ANNOUNCE_ZAPTO; - *data = 0; + *data = (neutrino_msg_data_t)p; + dont_delete_p = true; break; case CTimerdClient::EVT_ANNOUNCE_SHUTDOWN : *msg = NeutrinoMessages::ANNOUNCE_SHUTDOWN; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c5fe6c736..406d2fa8a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2630,8 +2630,7 @@ _repeat: return res; } else if( msg == NeutrinoMessages::ZAPTO) { - CTimerd::EventInfo * eventinfo; - eventinfo = (CTimerd::EventInfo *) data; + CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; if(recordingstatus==0) { bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); @@ -2653,52 +2652,19 @@ _repeat: standbyMode( false ); } if( mode != mode_scart ) { + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; std::string name = g_Locale->getText(LOCALE_ZAPTOTIMER_ANNOUNCE); - - CTimerd::TimerList tmpTimerList; - CTimerdClient tmpTimerdClient; - - tmpTimerList.clear(); - tmpTimerdClient.getTimerList( tmpTimerList ); - - if( !tmpTimerList.empty() ) { - sort( tmpTimerList.begin(), tmpTimerList.end() ); - - CTimerd::responseGetTimer &timer = tmpTimerList[0]; - - name += "\n"; - - std::string zAddData = CServiceManager::getInstance()->GetServiceName(timer.channel_id); - if( zAddData.empty()) { - zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN); - } - - if(timer.epgID!=0) { - CEPGData epgdata; - zAddData += " :\n"; - if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { - zAddData += epgdata.title; - } - else if(strlen(timer.epgTitle)!=0) { - zAddData += timer.epgTitle; - } - } - else if(strlen(timer.epgTitle)!=0) { - zAddData += timer.epgTitle; - } - - name += zAddData; - } + getAnnounceEpgName( eventinfo, name); ShowHintUTF( LOCALE_MESSAGEBOX_INFO, name.c_str() ); } - + delete [] (unsigned char*) data; return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { my_system(NEUTRINO_RECORDING_TIMER_SCRIPT); - + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; if (g_settings.recording_type == RECORDING_FILE) { - char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; + char * recordingDir = eventinfo->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { if (strcmp(g_settings.network_nfs_local_dir[i],recordingDir) == 0) { printf("[neutrino] waking up %s (%s)\n",g_settings.network_nfs_ip[i].c_str(),recordingDir); @@ -2717,13 +2683,16 @@ _repeat: CRecordManager::getInstance()->StopAutoRecord(); if(!CRecordManager::getInstance()->RecordingStatus()) { dvbsub_stop(); //FIXME if same channel ? - t_channel_id channel_id=((CTimerd::RecordingInfo*)data)->channel_id; + t_channel_id channel_id=eventinfo->channel_id; g_Zapit->zapTo_serviceID_NOWAIT(channel_id); } } + if(( mode != mode_scart ) && ( mode != mode_standby )){ + std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); + getAnnounceEpgName(eventinfo, name); + ShowHintUTF(LOCALE_MESSAGEBOX_INFO, name.c_str()); + } delete[] (unsigned char*) data; - if( mode != mode_scart ) - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE)); return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { @@ -3870,6 +3839,33 @@ void CNeutrinoApp::SDT_ReloadChannels() } } +void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name) +{ + + name += "\n"; + + std::string zAddData = CServiceManager::getInstance()->GetServiceName(eventinfo->channel_id); + if( zAddData.empty()) { + zAddData = g_Locale->getText(LOCALE_TIMERLIST_PROGRAM_UNKNOWN); + } + + if(eventinfo->epgID!=0) { + CEPGData epgdata; + zAddData += " :\n"; + if (CEitManager::getInstance()->getEPGid(eventinfo->epgID, eventinfo->epg_starttime, &epgdata)) { + zAddData += epgdata.title; + } + else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += eventinfo->epgTitle; + } + } + else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += eventinfo->epgTitle; + } + + name += zAddData; +} + void CNeutrinoApp::Cleanup() { #ifdef EXIT_CLEANUP diff --git a/src/neutrino.h b/src/neutrino.h index 4353bd076..d3e242436 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -136,6 +136,7 @@ private: void scartMode( bool bOnOff ); void standbyMode( bool bOnOff, bool fromDeepStandby = false ); void saveEpg(bool cvfd_mode); + void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name); void ExitRun(const bool write_si = true, int retcode = 0); void RealRun(CMenuWidget &mainSettings); From 3dc2604128a5be94944a171c0af5a4bfd86ecbf9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 29 Oct 2012 11:01:29 +0100 Subject: [PATCH 083/116] neutrino: show epg infos on announce recording, supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c44683151e9dc3075e4be5f12a9ae75f3a181572 Author: Jacek Jendrzej Date: 2012-10-29 (Mon, 29 Oct 2012) Origin message was: ------------------ neutrino: show epg infos on announce recording, supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/timerd/timermanager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index ef84e1526..9f1386050 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1250,8 +1250,15 @@ void CTimerEvent_Record::Refresh() //============================================================= void CTimerEvent_Zapto::announceEvent() { + Refresh(); + CTimerd::RecordingInfo ri=eventInfo; + ri.eventID=eventID; + ri.recordingDir[0] = 0; + strcpy(ri.epgTitle, epgTitle.substr(0,sizeof(ri.epgTitle)-1).c_str()); + CTimerManager::getInstance()->getEventServer()->sendEvent(CTimerdClient::EVT_ANNOUNCE_ZAPTO, - CEventServer::INITID_TIMERD); + CEventServer::INITID_TIMERD, + &ri,sizeof(CTimerd::RecordingInfo)); } //------------------------------------------------------------ void CTimerEvent_Zapto::fireEvent() From b4011e9c3f43b7cff1562c0e15487fd757ab1961 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 29 Oct 2012 12:42:34 +0100 Subject: [PATCH 084/116] src/neutrino.cpp: dont zap on record announce if same channel Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/38479e11bf49d914064a4a34f15e7a3077ab4aa1 Author: Jacek Jendrzej Date: 2012-10-29 (Mon, 29 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 406d2fa8a..48016d67b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2678,11 +2678,11 @@ _repeat: } } - if( g_settings.recording_zap_on_announce && (mode != mode_standby) ) { + if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { //TODO check transponder ? CRecordManager::getInstance()->StopAutoRecord(); if(!CRecordManager::getInstance()->RecordingStatus()) { - dvbsub_stop(); //FIXME if same channel ? + dvbsub_stop(); t_channel_id channel_id=eventinfo->channel_id; g_Zapit->zapTo_serviceID_NOWAIT(channel_id); } From 080f34ee3aae849f87013a489c9f332093d2ab16 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 29 Oct 2012 13:24:11 +0100 Subject: [PATCH 085/116] src/driver/vfd.cpp: -fix ioctl error on shutdown Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2052784ec013abc8ddb5c48f81dafa93bb2a0cc Author: Jacek Jendrzej Date: 2012-10-29 (Mon, 29 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/vfd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index 670f0a66f..b08ee78de 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -73,8 +73,10 @@ CVFD::CVFD() CVFD::~CVFD() { - if(fd > 0) + if(fd > 0){ close(fd); + fd = -1; + } } CVFD* CVFD::getInstance() @@ -678,7 +680,7 @@ void CVFD::Clear() void CVFD::ShowIcon(vfd_icon icon, bool show) { - if(!has_lcd) return; + if(!has_lcd || fd < 0) return; //printf("CVFD::ShowIcon %s %x\n", show ? "show" : "hide", (int) icon); int ret = ioctl(fd, show ? IOC_VFD_SET_ICON : IOC_VFD_CLEAR_ICON, icon); if(ret < 0) From ebdca865963e177cf103d04ce3b949f0b9bee42a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Oct 2012 14:29:03 +0100 Subject: [PATCH 086/116] neutrino.cpp: handle deepstandy-scripts in same way as the other scripts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5284ffa3d64993a1158064f9b970aca470f01a77 Author: vanhofen Date: 2012-10-29 (Mon, 29 Oct 2012) Origin message was: ------------------ - neutrino.cpp: handle deepstandy-scripts in same way as the other scripts ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/global.h | 2 ++ src/neutrino.cpp | 14 ++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/global.h b/src/global.h index e0fe58160..6dc24d549 100644 --- a/src/global.h +++ b/src/global.h @@ -66,6 +66,8 @@ #define NEUTRINO_RECORDING_ENDED_SCRIPT CONFIGDIR "/recording.end" #define NEUTRINO_ENTER_STANDBY_SCRIPT CONFIGDIR "/standby.on" #define NEUTRINO_LEAVE_STANDBY_SCRIPT CONFIGDIR "/standby.off" +#define NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT CONFIGDIR "/deepstandby.on" +#define NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT CONFIGDIR "/deepstandby.off" #define MOVIEPLAYER_START_SCRIPT CONFIGDIR "/movieplayer.start" #define MOVIEPLAYER_END_SCRIPT CONFIGDIR "/movieplayer.end" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 48016d67b..6c6719328 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1751,10 +1751,9 @@ void wake_up( bool &wakeup) } printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no"); if(!wakeup){ - const char *neutrino_leave_deepstandby_script = CONFIGDIR "/deepstandby.off"; - printf("[%s] executing %s\n",__FILE__ ,neutrino_leave_deepstandby_script); - if (my_system(neutrino_leave_deepstandby_script) != 0) - perror( neutrino_leave_deepstandby_script ); + puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT "."); + if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0) + perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed"); } #endif @@ -2913,10 +2912,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) saveSetup(NEUTRINO_SETTINGS_FILE); if(retcode) { - const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on"; - printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script); - if (my_system(neutrino_enter_deepstandby_script) != 0) - perror(neutrino_enter_deepstandby_script ); + puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT "."); + if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0) + perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed"); printf("entering off state\n"); mode = mode_off; From 7d8fbd52f42a7921748166eb9a74fec0fb1ca268 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 29 Oct 2012 14:45:00 +0100 Subject: [PATCH 087/116] neutrino.cpp: fix funny typo :) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4f3e3a90c4d8d92359aa6e33a60f76063d6e1105 Author: vanhofen Date: 2012-10-29 (Mon, 29 Oct 2012) Origin message was: ------------------ - neutrino.cpp: fix funny typo :) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6c6719328..495ba7b5a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1857,9 +1857,9 @@ TIMER_START(); dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); //fan speed if (g_info.has_fan) { - CFanControlNotifier * funNotifier= new CFanControlNotifier(); - funNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); - delete funNotifier; + CFanControlNotifier * fanNotifier= new CFanControlNotifier(); + fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); + delete fanNotifier; } dvbsub_init(); @@ -2987,9 +2987,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) powerManager->SetStandby(true, true); if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { int fspeed = 0; - CFanControlNotifier * funNotifier= new CFanControlNotifier(); - funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); - delete funNotifier; + CFanControlNotifier * fanNotifier= new CFanControlNotifier(); + fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); + delete fanNotifier; } if (powerManager) { powerManager->Close(); @@ -3022,8 +3022,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) //fan speed if (g_info.has_fan) { int fspeed = 0; - CFanControlNotifier funNotifier; - funNotifier.changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); + CFanControlNotifier fanNotifier; + fanNotifier.changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); } //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); stop_video(); @@ -3212,9 +3212,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) //fan speed if (g_info.has_fan) { int fspeed = 1; - CFanControlNotifier * funNotifier= new CFanControlNotifier(); - funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); - delete funNotifier; + CFanControlNotifier * fanNotifier= new CFanControlNotifier(); + fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); + delete fanNotifier; } frameBuffer->setActive(false); // Active standby on @@ -3239,9 +3239,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) frameBuffer->setActive(true); //fan speed if (g_info.has_fan) { - CFanControlNotifier * funNotifier= new CFanControlNotifier(); - funNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); - delete funNotifier; + CFanControlNotifier * fanNotifier= new CFanControlNotifier(); + fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); + delete fanNotifier; } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); From ab313218860cc6b4f2af3620ec72c05ffc18083c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 29 Oct 2012 18:56:38 +0400 Subject: [PATCH 088/116] .gitignore: add src/gui/git_version.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a50f04a6b00e072529eafe173f29701be0cfa3e Author: [CST] Focus Date: 2012-10-29 (Mon, 29 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b2acf5b02..f72cf9363 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ src/zapit/src/pzapit src/zapit/src/udpstreampes src/drivertool src/gui/svn_version.h +src/gui/git_version.h From 0593aefbf43fdc9b174fd94bae99309e184df085 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 29 Oct 2012 18:58:39 +0400 Subject: [PATCH 089/116] zapit/src/fastscan.cpp: dont delete existing bouquets/channels Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee80a7be8d7a5bcb25728a390bea1e6321475c20 Author: [CST] Focus Date: 2012-10-29 (Mon, 29 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/fastscan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index e744fb4a5..8fb2b8324 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -216,10 +216,10 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) delete dmx; return false; } - +#if 0 g_bouquetManager->clearAll(); CServiceManager::getInstance()->RemoveAllChannels(); - +#endif do { if (dmx->Read(buffer, SEC_SIZE) < 0) { delete dmx; From 4b847e34d96a06dabce883d4304f49e53067cf99 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 29 Oct 2012 19:00:49 +0400 Subject: [PATCH 090/116] zapit/src/capmt.cpp: dont send private descriptors; change ca list mode to ONLY/single channel and ADD, if there are more Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a0750c5d77756dd1ff13abf0e05668a757c3616 Author: [CST] Focus Date: 2012-10-29 (Mon, 29 Oct 2012) ------------------ This commit was generated by Migit --- src/zapit/include/zapit/capmt.h | 2 +- src/zapit/src/capmt.cpp | 67 ++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/zapit/include/zapit/capmt.h b/src/zapit/include/zapit/capmt.h index c24267c58..674429940 100644 --- a/src/zapit/include/zapit/capmt.h +++ b/src/zapit/include/zapit/capmt.h @@ -65,7 +65,7 @@ class CCam : public CBasicClient CCam(); virtual ~CCam() {}; bool sendMessage(const char * const data, const size_t length, bool update = false); - bool makeCaPmt(CZapitChannel * channel, uint8_t list = CAPMT_ONLY, const CaIdVector &caids = CaIdVector()); + bool makeCaPmt(CZapitChannel * channel, bool add_private, uint8_t list = CAPMT_ONLY, const CaIdVector &caids = CaIdVector()); bool setCaPmt(bool update = false); bool sendCaPmt(uint64_t tpid, uint8_t *rawpmt, int rawlen); int makeMask(int demux, bool add); diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp index 47a680e65..b600a2f99 100644 --- a/src/zapit/src/capmt.cpp +++ b/src/zapit/src/capmt.cpp @@ -32,7 +32,7 @@ #include #include -//#define DEBUG_CAPMT +#define DEBUG_CAPMT CCam::CCam() { @@ -76,12 +76,12 @@ bool CCam::sendMessage(const char * const data, const size_t length, bool update return send_data(data, length); } -bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &caids) +bool CCam::makeCaPmt(CZapitChannel * channel, bool add_private, uint8_t list, const CaIdVector &caids) { int len; unsigned char * buffer = channel->getRawPmt(len); - DBG("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list); + INFO("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list); if(!buffer) return false; @@ -89,32 +89,34 @@ bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &ca ProgramMapSection pmt(buffer); CaProgramMapSection capmt(&pmt, list, 0x01, caids); - uint8_t tmp[10]; - tmp[0] = 0x84; - tmp[1] = 0x02; - tmp[2] = channel->getPmtPid() >> 8; - tmp[3] = channel->getPmtPid() & 0xFF; - capmt.injectDescriptor(tmp, false); + if (add_private) { + uint8_t tmp[10]; + tmp[0] = 0x84; + tmp[1] = 0x02; + tmp[2] = channel->getPmtPid() >> 8; + tmp[3] = channel->getPmtPid() & 0xFF; + capmt.injectDescriptor(tmp, false); - tmp[0] = 0x82; - tmp[1] = 0x02; - tmp[2] = camask; - tmp[3] = source_demux; - capmt.injectDescriptor(tmp, false); + tmp[0] = 0x82; + tmp[1] = 0x02; + tmp[2] = camask; + tmp[3] = source_demux; + capmt.injectDescriptor(tmp, false); - memset(tmp, 0, sizeof(tmp)); - tmp[0] = 0x81; - tmp[1] = 0x08; - tmp[2] = channel->getSatellitePosition() >> 8; - tmp[3] = channel->getSatellitePosition() & 0xFF; - tmp[4] = channel->getFreqId() >> 8; - tmp[5] = channel->getFreqId() & 0xFF; - tmp[6] = channel->getTransportStreamId() >> 8; - tmp[7] = channel->getTransportStreamId() & 0xFF; - tmp[8] = channel->getOriginalNetworkId() >> 8; - tmp[9] = channel->getOriginalNetworkId() & 0xFF; + memset(tmp, 0, sizeof(tmp)); + tmp[0] = 0x81; + tmp[1] = 0x08; + tmp[2] = channel->getSatellitePosition() >> 8; + tmp[3] = channel->getSatellitePosition() & 0xFF; + tmp[4] = channel->getFreqId() >> 8; + tmp[5] = channel->getFreqId() & 0xFF; + tmp[6] = channel->getTransportStreamId() >> 8; + tmp[7] = channel->getTransportStreamId() & 0xFF; + tmp[8] = channel->getOriginalNetworkId() >> 8; + tmp[9] = channel->getOriginalNetworkId() & 0xFF; - capmt.injectDescriptor(tmp, false); + capmt.injectDescriptor(tmp, false); + } calen = capmt.writeToBuffer(cabuf); #ifdef DEBUG_CAPMT @@ -235,7 +237,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start if(newmask == 0) { cam->sendMessage(NULL, 0, false); } else { - cam->makeCaPmt(channel); + cam->makeCaPmt(channel, true); cam->setCaPmt(true); } } @@ -249,7 +251,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start } CaIdVector caids; cCA::GetInstance()->GetCAIDS(caids); - uint8_t list = CCam::CAPMT_FIRST; + //uint8_t list = CCam::CAPMT_FIRST; + uint8_t list = CCam::CAPMT_ONLY; + if (channel_map.size() > 1) + list = CCam::CAPMT_ADD; for (it = channel_map.begin(); it != channel_map.end(); /*++it*/) { cam = it->second; @@ -258,14 +263,16 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start if(!channel) continue; +#if 0 if (it == channel_map.end()) list |= CCam::CAPMT_LAST; // FIRST->ONLY or MORE->LAST +#endif - cam->makeCaPmt(channel, list, caids); + cam->makeCaPmt(channel, false, list, caids); int len; unsigned char * buffer = channel->getRawPmt(len); cam->sendCaPmt(channel->getTransponderId(), buffer, len); - list = CCam::CAPMT_MORE; + //list = CCam::CAPMT_MORE; } mutex.unlock(); From 0db121df45847a72574c26982927e02b228b5f57 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 Oct 2012 14:07:31 +0100 Subject: [PATCH 091/116] src/neutrino.cpp: saveepg in standby mode, if last saveepg time < 15 Min., revert multicall blocking for sttandbby, fix typo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/10116c6ad78c03cdd65ba35d1a068e5cddc3bac6 Author: Jacek Jendrzej Date: 2012-10-30 (Tue, 30 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 40 ++++++++++++++++++++++++---------------- src/neutrino.h | 3 +-- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 495ba7b5a..b162fbc74 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -227,8 +227,7 @@ CNeutrinoApp::CNeutrinoApp() TVchannelList = NULL; RADIOchannelList = NULL; skipShutdownTimer = false; - skipSleepnTimer = false; - lockStandbyCall = false; + skipSleepTimer = false; current_muted = 0; recordingstatus = 0; g_channel_list_changed = 0; @@ -2696,13 +2695,13 @@ _repeat: } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { if( mode != mode_scart && mode != mode_standby) - skipSleepnTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); return messages_return::handled; } else if( msg == NeutrinoMessages::SLEEPTIMER) { - if(skipSleepnTimer) { + if(skipSleepTimer) { printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); - skipSleepnTimer = false; + skipSleepTimer = false; return messages_return::handled; } if(g_settings.shutdown_real) @@ -3038,6 +3037,16 @@ void CNeutrinoApp::saveEpg(bool cvfd_mode) { struct stat my_stat; if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){ + if(!cvfd_mode){//skip saveepg in standby mode, if last saveepg time < 15 Min. + std::string index_xml = g_settings.epg_dir.c_str(); + index_xml += "/index.xml"; + time_t t=0; + if(stat(index_xml.c_str(), &my_stat) == 0){ + if(difftime(time(&t), my_stat.st_ctime) < 900){ + return; + } + } + } printf("[neutrino] Saving EPG to %s...\n", g_settings.epg_dir.c_str()); CVFD::getInstance()->Clear(); @@ -3055,8 +3064,10 @@ void CNeutrinoApp::saveEpg(bool cvfd_mode) CVFD::getInstance()->Clear(); CVFD::getInstance()->setMode(cvfd_mode ? CVFD::MODE_SHUTDOWN : CVFD::MODE_STANDBY);// true CVFD::MODE_SHUTDOWN , false CVFD::MODE_STANDBY break; - } else if (!cvfd_mode) + } else if (!cvfd_mode){ + printf("wait for epg saving, Msg %x \n", (int) msg); handleMsg(msg, data); + } } } } @@ -3149,10 +3160,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) //static bool wasshift = false; INFO("%s", bOnOff ? "ON" : "OFF" ); - if(lockStandbyCall) - return; - - lockStandbyCall = true; if( bOnOff ) { if( mode == mode_scart ) { //g_Controld->setScartMode( 0 ); @@ -3182,6 +3189,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) g_Sectionsd->setPauseScanning(!fromDeepStandby); g_Sectionsd->setServiceChanged(0, false); + lastMode = mode; + mode = mode_standby; + if(!CRecordManager::getInstance()->RecordingStatus() ) { //only save epg when not recording if(g_settings.epg_save && !fromDeepStandby) { @@ -3189,8 +3199,10 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } } - CVFD::getInstance()->Clear(); - CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); + if(CVFD::getInstance()->getMode() != CVFD::MODE_STANDBY){ + CVFD::getInstance()->Clear(); + CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); + } if(g_settings.mode_clock) { InfoClock->StopClock(); @@ -3206,9 +3218,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(!CRecordManager::getInstance()->RecordingStatus()) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); - lastMode = mode; - mode = mode_standby; - //fan speed if (g_info.has_fan) { int fspeed = 1; @@ -3293,7 +3302,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) #endif StartSubtitles(); } - lockStandbyCall = false; } void CNeutrinoApp::radioMode( bool rezap) diff --git a/src/neutrino.h b/src/neutrino.h index d3e242436..088a9a14a 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -118,9 +118,8 @@ private: int current_muted; bool skipShutdownTimer; - bool skipSleepnTimer; + bool skipSleepTimer; bool pbBlinkChange; - bool lockStandbyCall; int tvsort[LIST_MODE_LAST]; int radiosort[LIST_MODE_LAST]; From 2c6a39984b2e5dd83330a786a28f462827fe34b9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 Oct 2012 16:12:26 +0100 Subject: [PATCH 092/116] src/neutrino.cpp: supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43, THX Gaucho316 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3cf1741a3c7ffa8229652fe0c97c199b33323a0 Author: Jacek Jendrzej Date: 2012-10-30 (Tue, 30 Oct 2012) Origin message was: ------------------ src/neutrino.cpp: supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43, THX Gaucho316 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b162fbc74..34c0a3a21 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3862,6 +3862,7 @@ void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::s zAddData += epgdata.title; } else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += " :\n"; zAddData += eventinfo->epgTitle; } } From 3df02e3741af60ade0ce5dd52c7f1099a20b9611 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 Oct 2012 16:55:57 +0100 Subject: [PATCH 093/116] src/neutrino.cpp: supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43, THX Gaucho316 (fix) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/69715cbc5ee1a81832870ed102923e2d83d22f73 Author: Jacek Jendrzej Date: 2012-10-30 (Tue, 30 Oct 2012) Origin message was: ------------------ src/neutrino.cpp: supplement to c044df3aab11c4edfcde7e068ecfe04c6ea26b43, THX Gaucho316 (fix) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 34c0a3a21..2acea1353 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3862,11 +3862,11 @@ void CNeutrinoApp::getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::s zAddData += epgdata.title; } else if(strlen(eventinfo->epgTitle)!=0) { - zAddData += " :\n"; zAddData += eventinfo->epgTitle; } } else if(strlen(eventinfo->epgTitle)!=0) { + zAddData += " :\n"; zAddData += eventinfo->epgTitle; } From 4a6289ebac5cce6cd54da754e92440a21b9653b6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 30 Oct 2012 20:43:52 +0100 Subject: [PATCH 094/116] src/neutrino.cpp:-fix zapto timer in TimeshiftOnly mode or if haveFreeFrontend Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/294f0876c0068039896c4e9f6dfc4366ea46fc40 Author: Jacek Jendrzej Date: 2012-10-30 (Tue, 30 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 2acea1353..98d55690a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2627,20 +2627,24 @@ _repeat: #endif return res; } + else if( msg == NeutrinoMessages::ZAPTO) { CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; - if(recordingstatus==0) { - bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); + if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ + /* FIXME zapto if recordingstatus == 1 && haveFreeFrontend == 0 on same transponder and check for twin box in loop and independet mode */ + if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) ) { + bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); - dvbsub_stop(); + dvbsub_stop(); - if ((!isTVMode) && (mode != mode_radio)) { - radioMode(false); + if ((!isTVMode) && (mode != mode_radio)) { + radioMode(false); + } + else if (isTVMode && (mode != mode_tv)) { + tvMode(false); + } + channelList->zapTo_ChannelID(eventinfo->channel_id); } - else if (isTVMode && (mode != mode_tv)) { - tvMode(false); - } - channelList->zapTo_ChannelID(eventinfo->channel_id); } delete[] (unsigned char*) data; return messages_return::handled; From 2c05d780e1201d5e71744b0939b79ca74d92cba3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 31 Oct 2012 12:37:20 +0100 Subject: [PATCH 095/116] src/neutrino.cpp:zapto timer add transponder test Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8ab45c8baa87cb96c89bdacd871ff948a6313aab Author: Jacek Jendrzej Date: 2012-10-31 (Wed, 31 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 98d55690a..e3bb1e3ad 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2631,8 +2631,8 @@ _repeat: else if( msg == NeutrinoMessages::ZAPTO) { CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data; if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){ - /* FIXME zapto if recordingstatus == 1 && haveFreeFrontend == 0 on same transponder and check for twin box in loop and independet mode */ - if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) ) { + if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) || + (recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) { bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id); dvbsub_stop(); From c2300f8526f342f2bb3f6760cc00cffe7ff281ad Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 31 Oct 2012 13:13:02 +0100 Subject: [PATCH 096/116] src/neutrino.cpp:-fix multirecording if announce_record on zap on is Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ea1caedb51eb02dedf64281f60417a896fe83b73 Author: Jacek Jendrzej Date: 2012-10-31 (Wed, 31 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e3bb1e3ad..3c1b0efff 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2681,9 +2681,10 @@ _repeat: } if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { - //TODO check transponder ? CRecordManager::getInstance()->StopAutoRecord(); - if(!CRecordManager::getInstance()->RecordingStatus()) { + bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(); + if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) || + (recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){ dvbsub_stop(); t_channel_id channel_id=eventinfo->channel_id; g_Zapit->zapTo_serviceID_NOWAIT(channel_id); From 1054045693695ae2a298a563040bf3c5328b5e90 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 1 Nov 2012 18:55:03 +0100 Subject: [PATCH 097/116] eventlist: -add notifier to search menu, ported from tuxcvs, THX Gaucho316 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/87fe3bd4061b0763c3fdd104a2c2d9bb92cf5282 Author: Jacek Jendrzej Date: 2012-11-01 (Thu, 01 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 46 ++++++++++++++++++++++++++++++++++--------- src/gui/eventlist.h | 4 +++- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index f0f2f5d21..12571f2b2 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1241,6 +1241,7 @@ int CEventFinderMenu::showMenu(void) /************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; + m_search_channelname_mf = NULL; *m_event = false; if(*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL) @@ -1264,24 +1265,51 @@ int CEventFinderMenu::showMenu(void) CStringInputSMS stringInput(LOCALE_EVENTFINDER_KEYWORD,m_search_keyword, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); - CMenuForwarder* mf2 = new CMenuForwarder(LOCALE_EVENTFINDER_KEYWORD ,true, *m_search_keyword, &stringInput, NULL, CRCInput::RC_1 ); - CMenuOptionChooser* mo0 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST , m_search_list, SEARCH_LIST_OPTIONS, SEARCH_LIST_OPTION_COUNT, true, NULL, CRCInput::RC_2); - CMenuForwarderNonLocalized* mf1 = new CMenuForwarderNonLocalized("", *m_search_list != CNeutrinoEventList::SEARCH_LIST_ALL, m_search_channelname, this, "3", CRCInput::RC_3 ); + CMenuForwarder* mf0 = new CMenuForwarder(LOCALE_EVENTFINDER_KEYWORD, true, *m_search_keyword, &stringInput, NULL, CRCInput::RC_1, NEUTRINO_ICON_BUTTON_1); + CMenuOptionChooser* mo0 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST, m_search_list, SEARCH_LIST_OPTIONS, SEARCH_LIST_OPTION_COUNT, true, this, CRCInput::RC_2, NEUTRINO_ICON_BUTTON_2); + m_search_channelname_mf = new CMenuForwarderNonLocalized("", *m_search_list != CNeutrinoEventList::SEARCH_LIST_ALL, m_search_channelname, this, "3", CRCInput::RC_3, NEUTRINO_ICON_BUTTON_3); CMenuOptionChooser* mo1 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG, m_search_epg_item, SEARCH_EPG_OPTIONS, SEARCH_EPG_OPTION_COUNT, true, NULL, CRCInput::RC_4); - CMenuForwarder* mf0 = new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, this, "1", CRCInput::RC_5 ); + CMenuForwarder* mf1 = new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, this, "5", CRCInput::RC_5, NEUTRINO_ICON_BUTTON_5); CMenuWidget searchMenu(LOCALE_EVENTFINDER_HEAD, NEUTRINO_ICON_FEATURES); searchMenu.addItem(GenericMenuSeparator); - searchMenu.addItem(mf2, false); + searchMenu.addItem(mf0); searchMenu.addItem(GenericMenuSeparatorLine); - searchMenu.addItem(mo0, false); - searchMenu.addItem(mf1, false); - searchMenu.addItem(mo1, false); + searchMenu.addItem(mo0); + searchMenu.addItem(m_search_channelname_mf); + searchMenu.addItem(mo1); searchMenu.addItem(GenericMenuSeparatorLine); - searchMenu.addItem(mf0, false); + searchMenu.addItem(mf1); res = searchMenu.exec(NULL,""); return(res); } + + +/************************************************************************************************/ +bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) +/************************************************************************************************/ +{ + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) + { + if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL) + { + m_search_channelname = g_Zapit->getChannelName(*m_search_channel_id); + m_search_channelname_mf->setActive(true); + } + else if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_BOUQUET) + { + m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName(); + m_search_channelname_mf->setActive(true); + } + else if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_ALL) + { + m_search_channelname = ""; + m_search_channelname_mf->setActive(false); + } + } + return false; +} + diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index c1ef8b81b..41a128cfa 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -134,9 +134,10 @@ class CEventListHandler : public CMenuTarget }; -class CEventFinderMenu : public CMenuTarget +class CEventFinderMenu : public CMenuTarget, CChangeObserver { private: + CMenuForwarderNonLocalized* m_search_channelname_mf; int* m_event; int* m_search_epg_item; std::string* m_search_keyword; @@ -153,6 +154,7 @@ class CEventFinderMenu : public CMenuTarget t_channel_id* search_channel_id, t_bouquet_id* search_bouquet_id); int exec( CMenuTarget* parent, const std::string &actionkey); + bool changeNotify(const neutrino_locale_t OptionName, void *); }; #endif From c5f0781ca07929a5fd4de0ba7bf42dd779f4a6b0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Nov 2012 20:30:18 +0100 Subject: [PATCH 098/116] shutdown_count.cpp: add NEUTRINO_ENTER_INACTIVITY_SCRIPT script will be executed if g_settings.shutdown_min expires Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3b9193982bf643fc3ed94659fdb32dcad32615ce Author: vanhofen Date: 2012-11-01 (Thu, 01 Nov 2012) Origin message was: ------------------ - shutdown_count.cpp: add NEUTRINO_ENTER_INACTIVITY_SCRIPT script will be executed if g_settings.shutdown_min expires ------------------ This commit was generated by Migit --- src/driver/shutdown_count.cpp | 6 ++++++ src/global.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index 9bf77c2f1..a7b092022 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -106,6 +107,11 @@ void SHTDCNT::shutdown_counter() sleep_cnt--; } else if(sleeptimer_active && !CNeutrinoApp::getInstance ()->recordingstatus) { sleeptimer_active = false; + + puts("[SHTDCNT] executing " NEUTRINO_ENTER_INACTIVITY_SCRIPT "."); + if (my_system(NEUTRINO_ENTER_INACTIVITY_SCRIPT) != 0) + perror(NEUTRINO_ENTER_INACTIVITY_SCRIPT " failed"); + printf("[SHTDCNT] sleep-timer send NeutrinoMessages::SLEEPTIMER\n"); g_RCInput->postMsg(NeutrinoMessages::SLEEPTIMER, 1); } diff --git a/src/global.h b/src/global.h index 6dc24d549..cd6a8499c 100644 --- a/src/global.h +++ b/src/global.h @@ -66,6 +66,7 @@ #define NEUTRINO_RECORDING_ENDED_SCRIPT CONFIGDIR "/recording.end" #define NEUTRINO_ENTER_STANDBY_SCRIPT CONFIGDIR "/standby.on" #define NEUTRINO_LEAVE_STANDBY_SCRIPT CONFIGDIR "/standby.off" +#define NEUTRINO_ENTER_INACTIVITY_SCRIPT CONFIGDIR "/inactivity.on" #define NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT CONFIGDIR "/deepstandby.on" #define NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT CONFIGDIR "/deepstandby.off" #define MOVIEPLAYER_START_SCRIPT CONFIGDIR "/movieplayer.start" From 38c6ae2856121f3eb0d085be44c92234d8800ec7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Nov 2012 20:32:10 +0100 Subject: [PATCH 099/116] deutsch.locale: fix menu.hint_inact_timer Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8336d4797d45b20545883bd6ba537fa13c92d4db Author: vanhofen Date: 2012-11-01 (Thu, 01 Nov 2012) Origin message was: ------------------ - deutsch.locale: fix menu.hint_inact_timer ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 9b0dba6b9..5c1083695 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -774,7 +774,7 @@ menu.hint_hdd_tools Hier können Sie die gefundenen Festplatten formatieren bzw. menu.hint_head_back Ändern Sie die Titel-Hintergrundfarbe menu.hint_head_textcolor Ändern Sie die Titel-Textfarbe menu.hint_imageinfo Informationen über die installierte Software -menu.hint_inact_timer Ausschalten der Box nach Inaktivität in Minuten,\ndie Box geht automatisch in den Deep-Standby +menu.hint_inact_timer Ausschalten der Box nach Inaktivität in Minuten,\ndie Box geht automatisch in den Standby-Modus menu.hint_inactive_back Ändern Sie die Hintergrundfarbe für deaktivierte Fensterinhalte menu.hint_inactive_textcolor Ändern Sie die Textfarbe für deaktivierte Fensterinhalte menu.hint_inet_radio Internetradio From d4cadb5e1958de668a54cbb3d22c0652a591a0b8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 12:56:08 +0400 Subject: [PATCH 100/116] gui/miscsettings_menu.cpp: remove unneeded fanNotifier->changeNotify Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc5841659760f9b67e69ff65839e7c20b4ab46dd Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/miscsettings_menu.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index f19fc3994..af9c630ed 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -252,7 +252,6 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, 0, 0, LOCALE_OPTIONS_OFF); mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED); ms_general->addItem(mn); - fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); } //rotor From 50547a36fb69a7e7287a3bc3c0c6cb9e88b70b57 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 12:56:44 +0400 Subject: [PATCH 101/116] gui/osd_setup.cpp: remove unneeded colorSetupNotifier->changeNotify Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bc6a239002f4ce21f84e2686863df5d8eab2a889 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 66abb6891..5df9e9a6b 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -65,8 +65,6 @@ extern std::string ttx_font_file; COsdSetup::COsdSetup(bool wizard_mode) { colorSetupNotifier = new CColorSetupNotifier(); - colorSetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); - fontsizenotifier = new CFontSizeNotifier; osd_menu = NULL; From 795eab20f35bc77b9986aff5d71f29e45a24f761 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 13:10:15 +0400 Subject: [PATCH 102/116] system/setting_helpers.cpp: comment CVolume/CInfoClock Init in CColorSetupNotifier::changeNotify: is it really needed to re-init them on palette change ? Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f78be0f96d2041524931011ae5b569d5b5639f21 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ This commit was generated by Migit --- src/system/setting_helpers.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b93cbb0d1..92d2a8a95 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -189,10 +189,12 @@ bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) 8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) ); frameBuffer->paletteSet(); +#if 0 /* recalculate volumebar */ CVolume::getInstance()->Init(); /* recalculate infoclock */ CInfoClock::getInstance()->Init(); +#endif return false; } From 36bf89ea8e58f14bdb977c0733f250b313a6aade Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 13:46:32 +0400 Subject: [PATCH 103/116] system/setting_helpers.cpp: add static CColorSetupNotifier::setPalette(), to call it direct Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a1bd6d404bbd001f0013b622d998a1f63d61c800 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ This commit was generated by Migit --- src/system/setting_helpers.cpp | 18 +++++++----------- src/system/setting_helpers.h | 1 + 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 92d2a8a95..b9c3b0990 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -129,10 +129,9 @@ bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void * data) return true; } -bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) +void CColorSetupNotifier::setPalette() { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); -// unsigned char r,g,b; //setting colors-.. frameBuffer->paletteGenFade(COL_MENUHEAD, convertSetupColor2RGB(g_settings.menu_Head_red, g_settings.menu_Head_green, g_settings.menu_Head_blue), @@ -165,13 +164,6 @@ bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) convertSetupColor2RGB(g_settings.infobar_Text_red, g_settings.infobar_Text_green, g_settings.infobar_Text_blue), 8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) ); -/* frameBuffer->paletteSetColor( COL_INFOBAR_SHADOW, - convertSetupColor2RGB( - int(g_settings.infobar_red*0.4), - int(g_settings.infobar_green*0.4), - int(g_settings.infobar_blue*0.4)), - g_settings.infobar_alpha); -*/ frameBuffer->paletteGenFade(COL_INFOBAR_SHADOW, convertSetupColor2RGB(int(g_settings.infobar_red*0.4), int(g_settings.infobar_green*0.4), int(g_settings.infobar_blue*0.4)), convertSetupColor2RGB(g_settings.infobar_Text_red, g_settings.infobar_Text_green, g_settings.infobar_Text_blue), @@ -189,6 +181,11 @@ bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) 8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) ); frameBuffer->paletteSet(); +} + +bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *) +{ + setPalette(); #if 0 /* recalculate volumebar */ CVolume::getInstance()->Init(); @@ -486,8 +483,7 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK //CNeutrinoApp::getInstance()->loadColors(NEUTRINO_SETTINGS_FILE); CNeutrinoApp::getInstance()->SetupFonts(); CNeutrinoApp::getInstance()->SetupTiming(); - CColorSetupNotifier colorSetupNotifier; - colorSetupNotifier.changeNotify(NONEXISTANT_LOCALE, NULL); + CColorSetupNotifier::setPalette(); CVFD::getInstance()->setlcdparameter(); CFrameBuffer::getInstance()->Clear(); } diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index 22d0b27c9..ab3b9b1bd 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -88,6 +88,7 @@ class CColorSetupNotifier : public CChangeObserver { public: bool changeNotify(const neutrino_locale_t, void *); + static void setPalette(); }; class CAudioSetupNotifier : public CChangeObserver From 01f7dd84c5da65b98c0fdccdec950163c604ac96 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 14:18:56 +0400 Subject: [PATCH 104/116] system/setting_helpers.cpp: add static CFanControlNotifier::setSpeed, to call it direct Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c7dd7ccc78d657c754519d4a214d53392fc77ba9 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ This commit was generated by Migit --- src/system/setting_helpers.cpp | 22 ++++++++++++---------- src/system/setting_helpers.h | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b9c3b0990..eeb013c9f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -494,24 +494,26 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK return ret; } -bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void * data) +void CFanControlNotifier::setSpeed(unsigned int speed) { - int cfd, ret; - //unsigned char speed = (unsigned char) g_settings.fan_speed; - unsigned int speed = * (int *) data; + int cfd; printf("FAN Speed %d\n", speed); cfd = open("/dev/cs_control", O_RDONLY); if(cfd < 0) { perror("Cannot open /dev/cs_control"); - return false; + return; } - ret = ioctl(cfd, IOC_CONTROL_PWM_SPEED, speed); - close(cfd); - if(ret < 0) { + if (ioctl(cfd, IOC_CONTROL_PWM_SPEED, speed) < 0) perror("IOC_CONTROL_PWM_SPEED"); - return false; - } + + close(cfd); +} + +bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void * data) +{ + unsigned int speed = * (int *) data; + setSpeed(speed); return false; } diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index ab3b9b1bd..88207dc36 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -155,6 +155,7 @@ class CFanControlNotifier : public CChangeObserver { public: bool changeNotify(const neutrino_locale_t, void * data); + static void setSpeed(unsigned int speed); }; class CCpuFreqNotifier : public CChangeObserver From 656924b13874c07beaa182205483a6591a531ae5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 2 Nov 2012 11:21:52 +0100 Subject: [PATCH 105/116] src/gui/eventlist.cpp:typo fix for 1054045693695ae2a298a563040bf3c5328b5e90 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/377772e242805d8bca8972731d9e55fdfc8aca70 Author: Jacek Jendrzej Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 12571f2b2..2175f3323 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1269,7 +1269,7 @@ int CEventFinderMenu::showMenu(void) CMenuOptionChooser* mo0 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST, m_search_list, SEARCH_LIST_OPTIONS, SEARCH_LIST_OPTION_COUNT, true, this, CRCInput::RC_2, NEUTRINO_ICON_BUTTON_2); m_search_channelname_mf = new CMenuForwarderNonLocalized("", *m_search_list != CNeutrinoEventList::SEARCH_LIST_ALL, m_search_channelname, this, "3", CRCInput::RC_3, NEUTRINO_ICON_BUTTON_3); CMenuOptionChooser* mo1 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG, m_search_epg_item, SEARCH_EPG_OPTIONS, SEARCH_EPG_OPTION_COUNT, true, NULL, CRCInput::RC_4); - CMenuForwarder* mf1 = new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, this, "5", CRCInput::RC_5, NEUTRINO_ICON_BUTTON_5); + CMenuForwarder* mf1 = new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, this, "1", CRCInput::RC_5, NEUTRINO_ICON_BUTTON_5); CMenuWidget searchMenu(LOCALE_EVENTFINDER_HEAD, NEUTRINO_ICON_FEATURES); @@ -1280,7 +1280,7 @@ int CEventFinderMenu::showMenu(void) searchMenu.addItem(m_search_channelname_mf); searchMenu.addItem(mo1); searchMenu.addItem(GenericMenuSeparatorLine); - searchMenu.addItem(mf1); + searchMenu.addItem(mf1); res = searchMenu.exec(NULL,""); return(res); From 2f0fdc60df5ef7df853f52e067285b5e924bcd9a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 14:42:49 +0400 Subject: [PATCH 106/116] neutrino.cpp: remove CFanControlNotifier new/delete Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cb5d6187df24eeea5a0bab29447a67aa57ec6597 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3c1b0efff..305ee2643 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1782,8 +1782,7 @@ TIMER_START(); SetupFonts(); SetupTiming(); g_PicViewer = new CPictureViewer(); - colorSetupNotifier = new CColorSetupNotifier; - colorSetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); + CColorSetupNotifier::setPalette(); CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NEUTRINO_STARTING)); hintBox->paint(); @@ -1855,11 +1854,8 @@ TIMER_START(); #endif dprintf(DEBUG_NORMAL, "g_info.has_fan: %d\n", g_info.has_fan); //fan speed - if (g_info.has_fan) { - CFanControlNotifier * fanNotifier= new CFanControlNotifier(); - fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); - delete fanNotifier; - } + if (g_info.has_fan) + CFanControlNotifier::setSpeed(g_settings.fan_speed); dvbsub_init(); @@ -2990,10 +2986,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); powerManager->SetStandby(true, true); if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { - int fspeed = 0; - CFanControlNotifier * fanNotifier= new CFanControlNotifier(); - fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); - delete fanNotifier; + CFanControlNotifier::setSpeed(0); } if (powerManager) { powerManager->Close(); @@ -3025,9 +3018,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) delete g_RCInput; //fan speed if (g_info.has_fan) { - int fspeed = 0; - CFanControlNotifier fanNotifier; - fanNotifier.changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); + CFanControlNotifier::setSpeed(0); } //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); stop_video(); @@ -3224,12 +3215,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); //fan speed - if (g_info.has_fan) { - int fspeed = 1; - CFanControlNotifier * fanNotifier= new CFanControlNotifier(); - fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed); - delete fanNotifier; - } + if (g_info.has_fan) + CFanControlNotifier::setSpeed(1); + frameBuffer->setActive(false); // Active standby on powerManager->SetStandby(true, false); @@ -3252,11 +3240,8 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } frameBuffer->setActive(true); //fan speed - if (g_info.has_fan) { - CFanControlNotifier * fanNotifier= new CFanControlNotifier(); - fanNotifier->changeNotify(NONEXISTANT_LOCALE, (void*) &g_settings.fan_speed); - delete fanNotifier; - } + if (g_info.has_fan) + CFanControlNotifier::setSpeed(g_settings.fan_speed); puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) From 4815723b4c77f158f1424503d22a2a56b666a9f4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 14:43:16 +0400 Subject: [PATCH 107/116] neutrino.h: remove unused colorSetupNotifier Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de30356655e677f48763a7b061684bd4fee80e05 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/neutrino.h b/src/neutrino.h index 088a9a14a..b129adfe6 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -123,7 +123,6 @@ private: int tvsort[LIST_MODE_LAST]; int radiosort[LIST_MODE_LAST]; - CColorSetupNotifier *colorSetupNotifier; CMoviePluginChangeExec *MoviePluginChanger; void SDT_ReloadChannels(); From e079db2ae3cfc4155b6f91ac9ef32e37c5691d2f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 16:09:25 +0400 Subject: [PATCH 108/116] gui/infoviewer.cpp: add set/getUpdateTimer, dont set timer in start() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c6c284c2f714c7da2a2c2f8aadac444cc660a8a Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 11 +++++++---- src/gui/infoviewer.h | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c19f612dc..17d7197df 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -193,10 +193,6 @@ void CInfoViewer::start () 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; - - const int lcd_update_time_tv_mode = (60 * 1000 * 1000); - if (lcdUpdateTimer == 0) - lcdUpdateTimer = g_RCInput->addTimer (lcd_update_time_tv_mode, false, true); } void CInfoViewer::changePB() @@ -1893,6 +1889,13 @@ void CInfoViewer::showEpgInfo() //message on event change } } +void CInfoViewer::setUpdateTimer(uint64_t interval) +{ + g_RCInput->killTimer(lcdUpdateTimer); + if (interval) + lcdUpdateTimer = g_RCInput->addTimer(interval, false); +} + #if 0 int CInfoViewerHandler::exec (CMenuTarget * parent, const std::string & /*actionkey*/) { diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index acecd909a..e2d5a9b95 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -107,6 +107,8 @@ class CInfoViewer CProgressBar *snrscale, *sigscale, *timescale; bool casysChange; bool channellogoChange; + uint32_t lcdUpdateTimer; + void paintBackground(int col_Numbox); void show_Data( bool calledFromEvent = false ); void display_Info(const char *current, const char *next, bool UTF8 = true, @@ -136,7 +138,6 @@ class CInfoViewer bool chanready; bool is_visible; bool virtual_zap_mode; - uint32_t lcdUpdateTimer; char aspectRatio; uint32_t sec_timer_id; @@ -170,6 +171,8 @@ class CInfoViewer void showSNR(); void Init(void); bool SDT_freq_update; + void setUpdateTimer(uint64_t interval); + uint32_t getUpdateTimer(void) { return lcdUpdateTimer; } }; #if 0 class CInfoViewerHandler : public CMenuTarget From b845ef991b78b038515638bce5434363e37aadd0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 16:09:30 +0400 Subject: [PATCH 109/116] gui/epgview.cpp: use g_InfoViewer->getUpdateTimer() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/af753fc4f1a6f3c054766ebdaca1b4cfaf37a41d Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 18b285dc1..074804dc5 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -694,7 +694,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start switch ( msg ) { case NeutrinoMessages::EVT_TIMER: - if (data == g_InfoViewer->lcdUpdateTimer) { + if (data == g_InfoViewer->getUpdateTimer()) { GetEPGData(channel_id, id, &startzeit, false); if ( epg_done!= -1 ) { CProgressBar pb(true, -1, -1, 30, 100, 70, true); From a9e9cc4873bd153e516eb8fe68a16009b1bcb69e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 16:10:32 +0400 Subject: [PATCH 110/116] neutrino.cpp: use g_InfoViewer->setUpdateTimer(), disable timer in standby Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e6afe590816d88f8c6e54b17ab6d602e81ea210d Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 305ee2643..51722627d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1621,13 +1621,10 @@ void CNeutrinoApp::InitZapper() channelsInit(); if(tvmode) - { tvMode(true); - } else { - g_RCInput->killTimer(g_InfoViewer->lcdUpdateTimer); - g_InfoViewer->lcdUpdateTimer = g_RCInput->addTimer( LCD_UPDATE_TIME_RADIO_MODE, false ); + else radioMode(true); - } + if(g_settings.cacheTXT) tuxtxt_init(); @@ -3071,18 +3068,17 @@ void CNeutrinoApp::saveEpg(bool cvfd_mode) void CNeutrinoApp::tvMode( bool rezap ) { INFO("rezap %d current mode %d", rezap, mode); - if(mode==mode_radio ) { + if (mode == mode_radio) { if (g_settings.radiotext_enable && g_Radiotext) { delete g_Radiotext; g_Radiotext = NULL; } videoDecoder->StopPicture(); - g_RCInput->killTimer(g_InfoViewer->lcdUpdateTimer); - g_InfoViewer->lcdUpdateTimer = g_RCInput->addTimer( LCD_UPDATE_TIME_TV_MODE, false ); CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, false); StartSubtitles(!rezap); } + g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_TV_MODE); g_volume->Init(); @@ -3160,6 +3156,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if( mode == mode_scart ) { //g_Controld->setScartMode( 0 ); } + g_InfoViewer->setUpdateTimer(0); // delete timer StopSubtitles(); if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){ SDT_ReloadChannels(); @@ -3298,12 +3295,11 @@ void CNeutrinoApp::radioMode( bool rezap) { //printf("radioMode: rezap %s\n", rezap ? "yes" : "no"); INFO("rezap %d current mode %d", rezap, mode); - if(mode==mode_tv ) { - g_RCInput->killTimer(g_InfoViewer->lcdUpdateTimer); - g_InfoViewer->lcdUpdateTimer = g_RCInput->addTimer( LCD_UPDATE_TIME_RADIO_MODE, false ); + if (mode == mode_tv) { CVFD::getInstance()->ShowIcon(VFD_ICON_TV, false); StopSubtitles(); } + g_InfoViewer->setUpdateTimer(LCD_UPDATE_TIME_RADIO_MODE); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, true); From 885767094f18934cdc2f1d8ce086cd524c2cc8db Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 2 Nov 2012 14:01:43 +0100 Subject: [PATCH 111/116] src/gui/widget/stringinput.cpp: fix hide Background Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/83a4b871d6367224b569adfd38e64a830c9f9344 Author: Jacek Jendrzej Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/stringinput.cpp | 4 ++-- src/gui/widget/stringinput.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 064461be3..40ab760db 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -169,7 +169,7 @@ void CStringInput::init() } mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //initial height value for buttonbar + //footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //initial height value for buttonbar height = hheight+ mheight + 50; if (hint_1 != NONEXISTANT_LOCALE) { @@ -525,7 +525,7 @@ int CStringInput::handleOthers(const neutrino_msg_t /*msg*/, const neutrino_msg_ void CStringInput::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height + footerHeight); + frameBuffer->paintBackgroundBoxRel(x, y, width, height + hheight); } const char * CStringInput::getHint1(void) diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index 0a5a5aea9..8834f3914 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -51,7 +51,6 @@ class CStringInput : public CMenuTarget int hheight; // head font height int mheight; // menu font height int iheight; - int footerHeight; int lower_bound; int upper_bound; From 1e034da02f6a825f5ef48962deb2ffbd9759c31d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 17:28:01 +0400 Subject: [PATCH 112/116] neutrino.cpp: remove initGlobals(), global variables initialized to 0 anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de99c8a741606b5495a8019d3dc7fde3597c3850 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 51722627d..a887e19cc 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -188,27 +188,6 @@ extern const char * locale_real_names[]; /* #include */ // USERMENU const char* usermenu_button_def[SNeutrinoSettings::BUTTON_MAX]={"red","green","yellow","blue"}; -static void initGlobals(void) -{ - g_fontRenderer = NULL; - - g_RCInput = NULL; - g_Timerd = NULL; - g_RemoteControl = NULL; - - g_EpgData = NULL; - g_InfoViewer = NULL; - g_EventList = NULL; - g_videoSettings = NULL; - - g_Locale = new CLocaleManager; - g_PluginList = NULL; - InfoClock = NULL; - g_CamHandler = NULL; - g_Radiotext = NULL; - g_volume = NULL; -} - /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + CNeutrinoApp - Constructor, initialize g_fontRenderer + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ @@ -1763,6 +1742,8 @@ TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); + g_Locale = new CLocaleManager; + int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); initialize_iso639_map(); @@ -3611,7 +3592,6 @@ int main(int argc, char **argv) close(i); #endif tzset(); - initGlobals(); return CNeutrinoApp::getInstance()->run(argc, argv); } From 097adb8b5d96a943b4c7017e9d577ba356456b22 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 18:07:39 +0400 Subject: [PATCH 113/116] neutrino.cpp: cleanup unused code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c8cd117a9e9ad8e9ac61f7162657956fcf31956 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 111 ++--------------------------------------------- 1 file changed, 3 insertions(+), 108 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a887e19cc..784b67610 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1243,16 +1243,6 @@ void CNeutrinoApp::channelsInit(bool bOnly) } } printf("[neutrino] created %s bouquet with %d TV and %d RADIO channels\n", sit->second.name.c_str(), tvi, ri); -#if 0 - if(tvi) - tmp1->channelList->SortAlpha(); - else - TVsatList->deleteBouquet(tmp1); - if(ri) - tmp2->channelList->SortAlpha(); - else - RADIOsatList->deleteBouquet(tmp2); -#endif if(!tvi) TVsatList->deleteBouquet(tmp1); if(!ri) @@ -1656,11 +1646,6 @@ void CNeutrinoApp::InitZapitClient() CZapitClient::EVT_ZAP_SUB_COMPLETE, CZapitClient::EVT_ZAP_SUB_FAILED, CZapitClient::EVT_ZAP_MOTOR, -#if 0 - CZapitClient::EVT_ZAP_CA_CLEAR, - CZapitClient::EVT_ZAP_CA_LOCK, - CZapitClient::EVT_ZAP_CA_FTA, -#endif CZapitClient::EVT_ZAP_CA_ID, CZapitClient::EVT_RECORDMODE_ACTIVATED, CZapitClient::EVT_RECORDMODE_DEACTIVATED, @@ -1676,9 +1661,6 @@ void CNeutrinoApp::InitZapitClient() CZapitClient::EVT_BOUQUETS_CHANGED, CZapitClient::EVT_SERVICES_CHANGED, CZapitClient::EVT_SCAN_SERVICENAME, -#if 0 - CZapitClient::EVT_SCAN_FOUND_A_CHAN, -#endif CZapitClient::EVT_SCAN_FOUND_TV_CHAN, CZapitClient::EVT_SCAN_FOUND_RADIO_CHAN, CZapitClient::EVT_SCAN_FOUND_DATA_CHAN, @@ -1860,9 +1842,6 @@ TIMER_START(); g_InfoViewer = new CInfoViewer; g_EventList = new CNeutrinoEventList; - int dx, dy; - frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &dx, &dy); - g_CamHandler = new CCAMMenuHandler(); g_CamHandler->init(); @@ -1941,14 +1920,8 @@ void CNeutrinoApp::quickZap(int msg) int res; StopSubtitles(); -#if 0 - CRecordManager::getInstance()->StopAutoRecord(); - if(CRecordManager::getInstance()->RecordingStatus()) -#else - //if(recordingstatus && !autoshift) printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend()); if(!CFEManager::getInstance()->haveFreeFrontend()) -#endif { res = channelList->numericZap(g_settings.key_zaphistory); StartSubtitles(res < 0); @@ -2231,13 +2204,6 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) g_settings.audio_AnalogMode = 0; -#if 0 // per-channel auto volume save/restore - unsigned int volume; - g_Zapit->getVolume(&volume, &volume); - current_volume = 100 - volume*100/63; - printf("zapit volume %d new current %d mode %d\n", volume, current_volume, g_settings.audio_AnalogMode); - g_volume->setvol(current_volume); -#endif g_RCInput->killTimer(scrambled_timer); scrambled_timer = g_RCInput->addTimer(10*1000*1000, true); @@ -2513,12 +2479,7 @@ _repeat: } #endif else if( msg == NeutrinoMessages::EVT_MUTECHANGED ) { -#if 0 - CControldMsg::commandMute* cmd = (CControldMsg::commandMute*) data; - if(cmd->type == (CControld::volume_type)g_settings.audio_avs_Control) - g_volume->AudioMute(cmd->mute, true ); - delete[] (unsigned char*) data; -#endif + //FIXME unused ? return messages_return::handled; } else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) { @@ -2581,11 +2542,8 @@ _repeat: CTimerd::RecordingStopInfo* recinfo = (CTimerd::RecordingStopInfo*)data; printf("NeutrinoMessages::RECORD_STOP: eventID %d channel_id %llx\n", recinfo->eventID, recinfo->channel_id); CRecordManager::getInstance()->Stop(recinfo); -#if 0 // done when EVT_RECORDMODE received ? - if((mode == mode_standby) && !CRecordManager::getInstance()->RecordingStatus()) - cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); -#endif autoshift = CRecordManager::getInstance()->TimeshiftOnly(); + delete[] (unsigned char*) data; return messages_return::handled; } @@ -2593,12 +2551,6 @@ _repeat: res = messages_return::handled; t_channel_id channel_id = *(t_channel_id*) data; CRecordManager::getInstance()->Update(channel_id); -#if 0 //TODO ? - /* if new vpid */ - if(CMoviePlayerGui::getInstance().timeshift) - res |= messages_return::cancel_all; - } -#endif return res; } @@ -2957,41 +2909,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) } } } -#if 0 - neutrino_msg_t msg; - neutrino_msg_data_t data; - - cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); - powerManager->SetStandby(true, true); - if (g_info.delivery_system == DVB_S && (cs_get_revision() < 8)) { - CFanControlNotifier::setSpeed(0); - } - if (powerManager) { - powerManager->Close(); - delete powerManager; - } - - delete &CMoviePlayerGui::getInstance(); - shutdown_cs_api(); - - my_system("/etc/init.d/rcK"); - CVFD::getInstance()->ShowIcon(VFD_ICON_CAM1, true); - InfoClock->StopClock(); - - g_RCInput->clearRCMsg(); - while( true ) { - g_RCInput->getMsg(&msg, &data, 10000); - if( msg == CRCInput::RC_standby ) { - printf("Power key, going to reboot...\n"); - sleep(2); - reboot(LINUX_REBOOT_CMD_RESTART); - } else if( ( msg == NeutrinoMessages::ANNOUNCE_RECORD) || ( msg == NeutrinoMessages::ANNOUNCE_ZAPTO) ) { - printf("Zap/record timer, going to reboot...\n"); - sleep(2); - reboot(LINUX_REBOOT_CMD_RESTART); - } - } -#endif } else { delete g_RCInput; //fan speed @@ -3259,15 +3176,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) InfoClock->StartClock(); g_volume->AudioMute(current_muted, true); -#if 0 - /* auto-record will be started when zap is complete - * FIXME is it needed to restart manual timeshift here ? */ - if((mode == mode_tv) && wasshift) { - //startAutoRecord(); - CRecordManager::getInstance()->StartAutoRecord(); - } - wasshift = false; -#endif StartSubtitles(); } } @@ -3471,12 +3379,6 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) MoviePluginSelector.exec(NULL, ""); return menu_return::RETURN_REPAINT; } -#if 0 // commented in menu, needed ? - else if(actionKey == "autolink") { - CRecordManager::getInstance()->LinkTimeshift(); - returnval = menu_return::RETURN_EXIT_ALL; - } -#endif else if(actionKey == "clearSectionsd") { g_Sectionsd->freeMemory(); @@ -3587,10 +3489,7 @@ int main(int argc, char **argv) signal(SIGHUP, SIG_IGN); // process are unspecified (signal(2)) /* don't die in streamts.cpp from a SIGPIPE if client disconnects */ signal(SIGPIPE, SIG_IGN); -#if 0 - for(int i = 3; i < 256; i++) - close(i); -#endif + tzset(); return CNeutrinoApp::getInstance()->run(argc, argv); @@ -3747,10 +3646,6 @@ void CNeutrinoApp::StartSubtitles(bool show) void CNeutrinoApp::SelectSubtitles() { -#if 0 - int curnum = channelList->getActiveChannelNumber(); - CZapitChannel * cc = channelList->getChannel(curnum); -#endif /* called on NeutrinoMessages::EVT_ZAP_COMPLETE, should be safe to use zapit current channel */ CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); From 3ac4295286c16e83547eb27bd236ff7cebb92653 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 18:08:23 +0400 Subject: [PATCH 114/116] gui/network_service.cpp: use sh -c to start network service Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c6b35795e786ce05fef5cb3922ccaec65626e18 Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/network_service.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index 23ca4bc48..b2971471e 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -56,7 +56,7 @@ static struct network_service services[SERVICE_COUNT] = { "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, "", 0 }, { "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, "", 0 }, { "DjMount", "djmount", "-o iocharset=utf8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 }, - { "uShare", "ushare", "-D", LOCALE_MENU_HINT_NET_USHARE, "", 0 } + { "uShare", "ushare", "-D -n `cat /etc/hostname`", LOCALE_MENU_HINT_NET_USHARE, "", 0 } }; CNetworkService::CNetworkService(std::string cmd, std::string opts) @@ -72,8 +72,9 @@ CNetworkService::CNetworkService(std::string cmd, std::string opts) void CNetworkService::Start() { + std::string cmd = command + " " + options; printf("CNetworkService::Start: %s %s\n", command.c_str(), options.c_str()); - my_system( command.c_str(), options.c_str()); + my_system("/bin/sh", "-c", cmd.c_str()); enabled = true; TouchFile(); } From c02486123acdf8dbc5853a0814cc073ae704463c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 2 Nov 2012 18:49:47 +0400 Subject: [PATCH 115/116] neutrino.cpp: delete missed colorSetupNotifier reference Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b48e74557b3c18d4f466b7888ef900f023d5542b Author: [CST] Focus Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/neutrino.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 784b67610..45feb2504 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3766,7 +3766,6 @@ void CNeutrinoApp::Cleanup() delete g_Radiotext; g_Radiotext = NULL; printf("cleanup 13\n");fflush(stdout); - delete colorSetupNotifier; colorSetupNotifier = NULL; delete audioSetupNotifier; audioSetupNotifier = NULL; delete MoviePluginChanger; MoviePluginChanger = NULL; printf("cleanup 14\n");fflush(stdout); From 9d1444a8df5dd065c709acd67a9af7a42247c560 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 2 Nov 2012 18:17:47 +0100 Subject: [PATCH 116/116] src/driver/volume.cpp:-fix segfault on new fb_pixel_t with not initialized digit_h+digit_offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ea3a20a808c5ef21c76a07499047807d4155f13 Author: Jacek Jendrzej Date: 2012-11-02 (Fri, 02 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/volume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 35f75ea4e..c3ccf34c3 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -63,6 +63,8 @@ CVolume::CVolume() m_mode = CNeutrinoApp::getInstance()->getMode(); channel_id = 0; apid = 0; + digit_h = 0; + digit_offset = 0; Init(); } @@ -92,16 +94,18 @@ void CVolume::Init() y = sy = frameBuffer->getScreenY() + spacer / 2; sw = g_settings.screen_EndX - spacer; sh = frameBuffer->getScreenHeight(); - + icon_w = icon_h = 0; frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &icon_h); - vbar_h = std::max((icon_h * faktor_h) / 10, digit_h+digit_offset); + if (paintDigits) { + digit_offset = g_Font[VolumeFont]->getDigitOffset(); + digit_h = g_Font[VolumeFont]->getDigitHeight(); + } + vbar_h = std::max((icon_h * faktor_h) / 10, digit_h + digit_offset); progress_h = icon_h - 2*pB; progress_w = 200; vbar_w = spacer + icon_w + spacer + progress_w + spacer; if (paintDigits) { digit_w = g_Font[VolumeFont]->getRenderWidth("100"); - digit_offset = g_Font[VolumeFont]->getDigitOffset(); - digit_h = g_Font[VolumeFont]->getDigitHeight(); progress_h = std::max(icon_h, digit_h) - 2*pB; vbar_w += digit_w; }