From 9fb64f13cee2c3877a04aa2d8fe1d3d46af1f7aa Mon Sep 17 00:00:00 2001 From: swing99 Date: Mon, 13 Jan 2014 16:38:28 +0100 Subject: [PATCH 01/26] - cables.xml: update Kabel Deutschland - Offensive 2012 --- data/cables.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/data/cables.xml b/data/cables.xml index ea6f28f32..6ea231499 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -1417,6 +1417,7 @@ + From ae2a01a37a1bdc3eb9d8c6197ad3c609ba069657 Mon Sep 17 00:00:00 2001 From: "[priv] M. Liebmann" Date: Mon, 13 Jan 2014 19:39:41 +0100 Subject: [PATCH 02/26] CRecordInstance: Turns message when recording start/end on or off --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/driver/record.cpp | 4 ++-- src/gui/record_setup.cpp | 4 ++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 8 files changed, 17 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 14501d999..73e47824d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1041,6 +1041,7 @@ menu.hint_record_data_vtxt Teletext-Spur zu Aufnahme hinzufügen menu.hint_record_dir Wählen Sie das Aufnahmeverzeichnis menu.hint_record_end Wählen Sie zwischen maximaler Aufnahmezeit oder einem Aufnahmeende anhand der EPG-Daten menu.hint_record_slow_warn Zeige Warnung, wenn der Aufnahmepuffer zu überlaufen droht +menu.hint_record_startstop_msg Schaltet die Meldung bei Aufnahmestart/ende ein oder aus. menu.hint_record_tdir Wählen Sie ein Verzeichnis für Ihre Timeshift-Aufnahmen im temporären Timeshift-Modus menu.hint_record_time Geben Sie eine maximale Aufnahmezeit in Stunden ein, wenn Sie die Aufnahme nicht vorzeitig stoppen menu.hint_record_timeafter Stellen Sie die Nachlaufzeit für Timer-Aufnahmen ein\nEin Wert von 2 beendet die Aufnahme 2 Minuten nach dem Sendungsende @@ -1657,6 +1658,7 @@ rclock.title Fernbedienung sperren rclock.unlockmsg Fernbedienung reaktiviert... recording.is_running Folgende Aufnahme läuft bereits! Neue Aufnahme starten? recording.start Starte Aufnahme, bitte warten...! +recording.startstop_msg Meldung bei Aufnahme Start/Ende recording.stop Beende Aufnahme, bitte warten...! recording.time_hour Stunde recording.time_hours Stunden diff --git a/data/locale/english.locale b/data/locale/english.locale index b4a44d5f8..0bb1c71df 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1041,6 +1041,7 @@ menu.hint_record_data_vtxt VideoText stream menu.hint_record_dir Select directory to store recordings menu.hint_record_end Stop direct record after maximal time or after current event end time menu.hint_record_slow_warn Show warning, when record buffer is close to overflow +menu.hint_record_startstop_msg Turns the message when recording start/end on or off. 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 @@ -1657,6 +1658,7 @@ rclock.title Lock Remote Control rclock.unlockmsg Remote control reactivated. recording.is_running This channel already recording. Start new record? recording.start Start recording, please wait...! +recording.startstop_msg Message when recording is start/stop recording.stop Stop recording, please wait...! recording.time_hour hour recording.time_hours hours diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 97bd2e251..8ba915f9d 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -146,7 +146,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) time_t msg_start_time = time(0); CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START)); - if (!(autoshift && g_settings.auto_timeshift)) + if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg) hintBox.paint(); tsfile = std::string(filename) + ".ts"; @@ -253,7 +253,7 @@ bool CRecordInstance::Stop(bool remove_event) recMovieInfo->length = (int) round((double) (end_time - start_time) / (double) 60); CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, rec_stop_msg.c_str()); - if (!(autoshift && g_settings.auto_timeshift)) + if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg) hintBox.paint(); printf("%s: channel %" PRIx64 " recording_id %d\n", __func__, channel_id, recording_id); diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 7349c9ac2..4651df1a9 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -231,6 +231,10 @@ int CRecordSetup::showRecordSetup() 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); + + CMenuOptionChooser* startstop_msg = new CMenuOptionChooser(LOCALE_RECORDING_STARTSTOP_MSG, &g_settings.recording_startstop_msg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + startstop_msg->setHint("", LOCALE_MENU_HINT_RECORD_STARTSTOP_MSG); + recordingSettings->addItem(startstop_msg); } //template diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3ef60554f..b51d9e658 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -603,6 +603,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , true); g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); + g_settings.recording_startstop_msg = configfile.getBool("recording_startstop_msg" , true); // default plugin for movieplayer g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); @@ -1079,6 +1080,7 @@ void CNeutrinoApp::saveSetup(const char * fname) 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 ); + configfile.setBool ("recording_startstop_msg" , g_settings.recording_startstop_msg ); // default plugin for movieplayer configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); diff --git a/src/system/locals.h b/src/system/locals.h index 1f9308dc3..f39eae2a9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1068,6 +1068,7 @@ typedef enum LOCALE_MENU_HINT_RECORD_DIR, LOCALE_MENU_HINT_RECORD_END, LOCALE_MENU_HINT_RECORD_SLOW_WARN, + LOCALE_MENU_HINT_RECORD_STARTSTOP_MSG, LOCALE_MENU_HINT_RECORD_TDIR, LOCALE_MENU_HINT_RECORD_TIME, LOCALE_MENU_HINT_RECORD_TIMEAFTER, @@ -1684,6 +1685,7 @@ typedef enum LOCALE_RCLOCK_UNLOCKMSG, LOCALE_RECORDING_IS_RUNNING, LOCALE_RECORDING_START, + LOCALE_RECORDING_STARTSTOP_MSG, LOCALE_RECORDING_STOP, LOCALE_RECORDING_TIME_HOUR, LOCALE_RECORDING_TIME_HOURS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d662757fa..e967782e2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1068,6 +1068,7 @@ const char * locale_real_names[] = "menu.hint_record_dir", "menu.hint_record_end", "menu.hint_record_slow_warn", + "menu.hint_record_startstop_msg", "menu.hint_record_tdir", "menu.hint_record_time", "menu.hint_record_timeafter", @@ -1684,6 +1685,7 @@ const char * locale_real_names[] = "rclock.unlockmsg", "recording.is_running", "recording.start", + "recording.startstop_msg", "recording.stop", "recording.time_hour", "recording.time_hours", diff --git a/src/system/settings.h b/src/system/settings.h index 7250f64a8..6eb960b76 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -362,6 +362,7 @@ struct SNeutrinoSettings int recording_save_in_channeldir; int recording_zap_on_announce; int recording_slow_warning; + int recording_startstop_msg; int shutdown_timer_record_type; int filesystem_is_utf8; From c61d0621244c05f6f605ba9b512180dda415a377 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 13 Jan 2014 19:59:34 +0100 Subject: [PATCH 03/26] Supplement to commit ae2a01a37a1bdc3eb9d8c6197ad3c609ba069657 --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b51d9e658..fc7a6573f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2838,7 +2838,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) g_Zapit->zapTo_serviceID_NOWAIT(channel_id); } } - if(( mode != mode_scart ) && ( mode != mode_standby )){ + if(( mode != mode_scart ) && ( mode != mode_standby ) && g_settings.recording_startstop_msg) { std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE); getAnnounceEpgName(eventinfo, name); ShowHintUTF(LOCALE_MESSAGEBOX_INFO, name.c_str()); From 0cd6cfa68cf0584c7cc1118030a9907065c1b925 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 9 Jan 2014 14:55:55 +0100 Subject: [PATCH 04/26] XML_Parser: initialize variable --- lib/xmltree/xmlparse.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/xmltree/xmlparse.cpp b/lib/xmltree/xmlparse.cpp index f2c2c5fd2..e87d0bb1e 100644 --- a/lib/xmltree/xmlparse.cpp +++ b/lib/xmltree/xmlparse.cpp @@ -107,6 +107,7 @@ XML_Parser::XML_Parser(const XML_Char *encodingName) bufferLim=0; declElementType=0; declAttributeId=0; + declAttributeIsCdata=0; declEntity=0; declNotationName=0; declNotationPublicId=0; From 6944d53cef9a994c02b298707fa0b30fad56c08b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 9 Jan 2014 14:56:45 +0100 Subject: [PATCH 05/26] XML_Parser::storeAtts: don't leak in case of realloc failure --- lib/xmltree/xmlparse.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/xmltree/xmlparse.cpp b/lib/xmltree/xmlparse.cpp index e87d0bb1e..9f4ef239f 100644 --- a/lib/xmltree/xmlparse.cpp +++ b/lib/xmltree/xmlparse.cpp @@ -132,7 +132,8 @@ XML_Parser::XML_Parser(const XML_Char *encodingName) tagStack=0; freeTagList=0; attsSize=INIT_ATTS_SIZE; - atts=new ATTRIBUTE[attsSize]; + /* must not realloc stuff allocated with new[] */ + atts=(ATTRIBUTE *)malloc(attsSize * sizeof(ATTRIBUTE)); dataBuf=new XML_Char[INIT_DATA_BUF_SIZE]; groupSize=0; groupConnector=0; @@ -152,7 +153,7 @@ XML_Parser::XML_Parser(const XML_Char *encodingName) poolDestroy(&tempPool); poolDestroy(&temp2Pool); - if (atts) delete[] atts; + if (atts) free(atts); if (dataBuf) delete[] dataBuf; return; @@ -204,7 +205,7 @@ XML_Parser::~XML_Parser() poolDestroy(&temp2Pool); dtdDestroy(&dtd); - delete[] atts; + free(atts); free(groupConnector); free(buffer); delete[] dataBuf; @@ -1099,9 +1100,11 @@ enum XML_Error XML_Parser::storeAtts(const ENCODING *enc, const XML_Char *tagNam attsSize=n+nDefaultAtts+INIT_ATTS_SIZE; - atts=(ATTRIBUTE *) realloc((void *) atts, attsSize*sizeof(ATTRIBUTE)); + ATTRIBUTE *newatts = (ATTRIBUTE *) realloc((void *) atts, attsSize*sizeof(ATTRIBUTE)); - if (!atts) return XML_ERROR_NO_MEMORY; + if (!newatts) return XML_ERROR_NO_MEMORY; + + atts = newatts; if (n>oldAttsSize) XmlGetAttributes(enc, s, n, atts); }; From 42bc6f3081ffd2e73ec69b1432d1cfd54f354bf6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 9 Jan 2014 14:57:18 +0100 Subject: [PATCH 06/26] XMLTreeNode::AddNode: fix logic error (in unused branch) --- lib/xmltree/xmltree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmltree/xmltree.cpp b/lib/xmltree/xmltree.cpp index e487df5a8..acb1502eb 100644 --- a/lib/xmltree/xmltree.cpp +++ b/lib/xmltree/xmltree.cpp @@ -246,7 +246,7 @@ void XMLTreeNode::AddNode(XMLTreeNode *node, addmode mode) { case ADD_NEIGHBOUR: n=this; - + break; case ADD_CHILD: n=child; } From 8c0cb5b96ea791a9bf07e3070ba46a0dff01f152 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Jan 2014 18:07:17 +0100 Subject: [PATCH 07/26] streamts: put zapit back into standby after streaming additionally, update copyright info --- src/driver/streamts.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 8df0b0580..122a65bf2 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -3,6 +3,8 @@ Copyright (C) 2011-2012 CoolStream International Ltd + Copyright (C) 2010-2012, 2014 Stefan Seyfried + based on code which is Copyright (C) 2002 Andreas Oberritter Copyright (C) 2001 TripleDES @@ -505,6 +507,15 @@ void CStreamManager::run() mutex.unlock(); } } + /* this is a cheap check */ + if (streams.empty() && + CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby) { + /* this check is more expensive (goes through the socket) */ + if (g_Zapit->getMode() != 0) { + printf("CStreamManager::run: put zapit into standby...\n"); + g_Zapit->setStandby(true); + } + } } } } From c9a3b348108a24f906e679b7a03f838e83f1bbd0 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Jan 2014 18:09:05 +0100 Subject: [PATCH 08/26] streamts: set CPU freq to 'high' for streaming --- src/driver/streamts.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 122a65bf2..15d004dcd 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -58,6 +58,10 @@ #include #include #include +#include + +/* defined in neutrino.cpp */ +extern cCpuFreqManager * cpuFreq; /* experimental mode: * stream not possible, if record running @@ -334,6 +338,7 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid) int mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_standby && streams.empty()) { printf("CStreamManager::Parse: wakeup zapit..\n"); + cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); g_Zapit->setStandby(false); g_Zapit->getMode(); } @@ -514,6 +519,7 @@ void CStreamManager::run() if (g_Zapit->getMode() != 0) { printf("CStreamManager::run: put zapit into standby...\n"); g_Zapit->setStandby(true); + cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); } } } From ecf430ba9752ffd99709e5a17c2df5f9c5ab1b99 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Jan 2014 14:45:48 +0100 Subject: [PATCH 09/26] dboxinfo: fix format strings for uint64_t --- src/gui/dboxinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 3b203415f..1850a88fc 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -181,10 +181,10 @@ static std::string bytes2string(uint64_t bytes, bool binary) char result[80]; if (b < base) - snprintf(result, sizeof(result), "%llu%s%02llu ", b, g_Locale->getText(LOCALE_UNIT_DECIMAL), + snprintf(result, sizeof(result), "%" PRIu64 "%s%02" PRIu64 " ", b, g_Locale->getText(LOCALE_UNIT_DECIMAL), (bytes - b * factor) * 100 / factor); else // no need for fractions for larger numbers - snprintf(result, sizeof(result), "%llu ", b); + snprintf(result, sizeof(result), "%" PRIu64 " ", b); std::string res(result); if (*unit) { From 49035cedec72c12a9f9ee2b1240e06d1a3ffaf6d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Jan 2014 15:07:31 +0100 Subject: [PATCH 10/26] timerd: get rid of unused CTimerd::TIMER_NEXTPROGRAM This event should be completely obsolete (it was used before EIT-update was working correctly), so get rid of it in the code. For now it is just commented out, until further testing is done. --- lib/timerdclient/timerdclient.cpp | 3 ++- lib/timerdclient/timerdclient.h | 2 ++ src/gui/timerlist.cpp | 18 +++++++++--------- src/neutrino.cpp | 2 ++ src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 7 +++++-- .../tuxboxapi/coolstream/neutrinoapi.cpp | 2 ++ .../tuxboxapi/coolstream/neutrinoyparser.cpp | 2 +- src/timerd/timerd.cpp | 8 +++++++- src/timerd/timermanager.cpp | 8 +++++++- src/timerd/timermanager.h | 2 ++ 10 files changed, 39 insertions(+), 15 deletions(-) diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index 0926748a9..8f5827d74 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -268,7 +268,8 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, { length = 0; } - else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || + /* else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || */ + else if (evType == CTimerd::TIMER_ZAPTO || evType == CTimerd::TIMER_IMMEDIATE_RECORD ) { CTimerd::EventInfo *ei=static_cast(data); diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 07e51f863..538ac3351 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -154,12 +154,14 @@ class CTimerdClient:private CBasicClient return addTimerEvent(CTimerd::TIMER_ZAPTO, &eventInfo, announcetime, alarmtime, stoptime); }; +#if 0 int addNextProgramTimerEvent(CTimerd::EventInfo eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0) { // mal auf verdacht eingebaut // keine ahnung ob / was hier noch fehlt return addTimerEvent(CTimerd::TIMER_NEXTPROGRAM, &eventInfo, alarmtime, announcetime, stoptime); }; +#endif // Exit timerd and programm wakeup bool shutdown(); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 484f3954d..d21a87425 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -123,8 +123,8 @@ public: m6->setActive(false); } if (type == CTimerd::TIMER_RECORD || - type == CTimerd::TIMER_ZAPTO || - type == CTimerd::TIMER_NEXTPROGRAM) + type == CTimerd::TIMER_ZAPTO) + /*|| type == CTimerd::TIMER_NEXTPROGRAM)*/ { m2->setActive(true); } @@ -310,9 +310,9 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) data=&(timerNew.standby_on); - else if (timerNew.eventType==CTimerd::TIMER_NEXTPROGRAM || - timerNew.eventType==CTimerd::TIMER_ZAPTO || - timerNew.eventType==CTimerd::TIMER_RECORD) + /* else if (timerNew.eventType==CTimerd::TIMER_NEXTPROGRAM || */ + else if (timerNew.eventType == CTimerd::TIMER_ZAPTO || + timerNew.eventType == CTimerd::TIMER_RECORD) { if (strcmp(timerNew_channel_name, "---")==0) return menu_return::RETURN_REPAINT; @@ -761,7 +761,7 @@ void CTimerList::paintItem(int pos) std::string zAddData(""); switch (timer.eventType) { - case CTimerd::TIMER_NEXTPROGRAM : + //case CTimerd::TIMER_NEXTPROGRAM : case CTimerd::TIMER_ZAPTO : case CTimerd::TIMER_RECORD : { @@ -839,7 +839,7 @@ void CTimerList::paintItem(int pos) case CTimerd::TIMER_RECORD : // line2+= " -"; // line2+= zStopTime+6; - case CTimerd::TIMER_NEXTPROGRAM : + //case CTimerd::TIMER_NEXTPROGRAM : case CTimerd::TIMER_ZAPTO : { line1 += ' '; @@ -927,8 +927,8 @@ const char * CTimerList::convertTimerType2String(const CTimerd::CTimerEventTypes { case CTimerd::TIMER_SHUTDOWN : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SHUTDOWN ); - case CTimerd::TIMER_NEXTPROGRAM : - return g_Locale->getText(LOCALE_TIMERLIST_TYPE_NEXTPROGRAM); +// case CTimerd::TIMER_NEXTPROGRAM : +// return g_Locale->getText(LOCALE_TIMERLIST_TYPE_NEXTPROGRAM); case CTimerd::TIMER_ZAPTO : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_ZAPTO ); case CTimerd::TIMER_STANDBY : diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fc7a6573f..09d88c2b7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1685,8 +1685,10 @@ void CNeutrinoApp::InitTimerdClient() g_Timerd = new CTimerdClient; g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_SHUTDOWN, 222, NEUTRINO_UDS_NAME); g_Timerd->registerEvent(CTimerdClient::EVT_SHUTDOWN, 222, NEUTRINO_UDS_NAME); +#if 0 g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); g_Timerd->registerEvent(CTimerdClient::EVT_NEXTPROGRAM, 222, NEUTRINO_UDS_NAME); +#endif g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_ON, 222, NEUTRINO_UDS_NAME); g_Timerd->registerEvent(CTimerdClient::EVT_STANDBY_OFF, 222, NEUTRINO_UDS_NAME); g_Timerd->registerEvent(CTimerdClient::EVT_ANNOUNCE_RECORD, 222, NEUTRINO_UDS_NAME); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index e5bc30f43..381d72a87 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1711,7 +1711,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) } switch(timer->eventType) { - case CTimerd::TIMER_NEXTPROGRAM: + //case CTimerd::TIMER_NEXTPROGRAM: case CTimerd::TIMER_ZAPTO: case CTimerd::TIMER_RECORD: if (!send_id) @@ -1890,12 +1890,14 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) // timer specific data switch(timer->eventType) { +#if 0 case CTimerd::TIMER_NEXTPROGRAM : { hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); hh->printf("\t\t\t%s\n",channel_name.c_str()); hh->printf("\t\t\t%s\n",title.c_str()); } break; +#endif case CTimerd::TIMER_ZAPTO : { hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); @@ -2268,7 +2270,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) bool standby_on = (hh->ParamList["sbon"]=="1"); data=&standby_on; } - else if(type==CTimerd::TIMER_NEXTPROGRAM || type==CTimerd::TIMER_ZAPTO) + /* else if(type==CTimerd::TIMER_NEXTPROGRAM || type==CTimerd::TIMER_ZAPTO) */ + else if (type == CTimerd::TIMER_ZAPTO) data= &eventinfo; else if (type==CTimerd::TIMER_RECORD) { diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 9fd3bf171..beb863407 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -320,9 +320,11 @@ std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) case CTimerd::TIMER_SHUTDOWN: result = "Shutdown"; break; +#if 0 case CTimerd::TIMER_NEXTPROGRAM: result = "Next program"; break; +#endif case CTimerd::TIMER_ZAPTO: result = "Zap to"; break; diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 0673b132b..28f6b49f4 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -813,7 +813,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string std::string sAddData=""; switch(timer->eventType) { - case CTimerd::TIMER_NEXTPROGRAM : + //case CTimerd::TIMER_NEXTPROGRAM : case CTimerd::TIMER_ZAPTO : case CTimerd::TIMER_RECORD : { diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 3b6206097..4d4538cfe 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -94,6 +94,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) if(event->eventType == CTimerd::TIMER_STANDBY) resp.standby_on = static_cast(event)->standby_on; +#if 0 else if(event->eventType == CTimerd::TIMER_NEXTPROGRAM) { resp.epgID = static_cast(event)->eventInfo.epgID; @@ -101,6 +102,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) resp.channel_id = static_cast(event)->eventInfo.channel_id; resp.apids = static_cast(event)->eventInfo.apids; } +#endif else if(event->eventType == CTimerd::TIMER_RECORD) { CTimerEvent_Record* ev= static_cast(event); @@ -159,6 +161,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) if(event->eventType == CTimerd::TIMER_STANDBY) lresp.standby_on = static_cast(event)->standby_on; +#if 0 else if(event->eventType == CTimerd::TIMER_NEXTPROGRAM) { lresp.epgID = static_cast(event)->eventInfo.epgID; @@ -166,6 +169,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) lresp.channel_id = static_cast(event)->eventInfo.channel_id; lresp.apids = static_cast(event)->eventInfo.apids; } +#endif else if(event->eventType == CTimerd::TIMER_RECORD) { CTimerEvent_Record* ev= static_cast(event); @@ -219,7 +223,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) switch (*type) { case CTimerd::TIMER_SHUTDOWN: - case CTimerd::TIMER_NEXTPROGRAM: + //case CTimerd::TIMER_NEXTPROGRAM: case CTimerd::TIMER_ZAPTO: case CTimerd::TIMER_STANDBY: case CTimerd::TIMER_REMIND: @@ -348,6 +352,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) } break; +#if 0 case CTimerd::TIMER_NEXTPROGRAM : // CTimerd::EventInfo evInfo; CBasicServer::receive_data(connfd, &evInfo, sizeof(CTimerd::TransferEventInfo)); @@ -376,6 +381,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) } */ break; +#endif case CTimerd::TIMER_REMIND : CTimerdMsg::commandRemind remind; CBasicServer::receive_data(connfd, &remind, sizeof(CTimerdMsg::commandRemind)); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index eec444d50..0c2f7135d 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -330,7 +330,7 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi switch (event->eventType) { case CTimerd::TIMER_SHUTDOWN: - case CTimerd::TIMER_NEXTPROGRAM: + //case CTimerd::TIMER_NEXTPROGRAM: case CTimerd::TIMER_STANDBY: case CTimerd::TIMER_REMIND: case CTimerd::TIMER_SLEEPTIMER: @@ -456,6 +456,7 @@ void CTimerManager::loadEventsFromConfig() } break; } +#if 0 case CTimerd::TIMER_NEXTPROGRAM : { CTimerEvent_NextProgram *event= @@ -478,6 +479,7 @@ void CTimerManager::loadEventsFromConfig() } break; } +#endif case CTimerd::TIMER_ZAPTO : { CTimerEvent_Zapto *event= @@ -1315,6 +1317,8 @@ void CTimerEvent_Zapto::getEpgId() epgTitle=epgdata.title; } } + +#if 0 //============================================================= // NextProgram Event //============================================================= @@ -1394,6 +1398,8 @@ void CTimerEvent_NextProgram::Reschedule() eventInfo.epg_starttime = 0; CTimerEvent::Reschedule(); } +#endif + //============================================================= // Remind Event //============================================================= diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h index 042b46655..26930d7a7 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -157,6 +157,7 @@ class CTimerEvent_Zapto : public CTimerEvent_Record virtual void getEpgId(); }; +#if 0 class CTimerEvent_NextProgram : public CTimerEvent { public: @@ -175,6 +176,7 @@ class CTimerEvent_NextProgram : public CTimerEvent virtual void saveToConfig(CConfigFile *config); virtual void Reschedule(); }; +#endif class CTimerEvent_Remind : public CTimerEvent { From 1d0a23dbf3b59f4cc285a72e82683710ce6f0877 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 13 Jan 2014 21:01:26 +0100 Subject: [PATCH 11/26] reduce direct dependencies on timerdclient.h Include timerdtypes.h instead of timerdclient.h where feasible, add direct instead of indirect includes of timerdclient.h where necessary. This reduces the number of files which depend on timerdclient.h from 134 to 16. Add/update copyright notices in the affected files. --- src/driver/record.cpp | 2 ++ src/driver/record.h | 2 +- src/gui/epgplus.cpp | 2 ++ src/gui/epgview.cpp | 3 ++- src/gui/eventlist.cpp | 2 ++ src/gui/eventlist.h | 2 +- src/gui/moviebrowser.cpp | 4 +++- src/gui/record_setup.cpp | 2 ++ src/gui/timerlist.cpp | 3 +++ src/gui/timerlist.h | 3 ++- src/neutrino.cpp | 4 +++- 11 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 8ba915f9d..da5343fb1 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2011 CoolStream International Ltd + Copyright (C) 2011-2014 Stefan Seyfried License: GPLv2 @@ -58,6 +59,7 @@ #include #include #include +#include /* TODO: * nextRecording / pending recordings - needs testing diff --git a/src/driver/record.h b/src/driver/record.h index a018c66a2..a75c67830 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 326c67981..670917254 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2004 Martin Griep 'vivamiga' + Copyright (C) 2009-2014 Stefan Seyfried License: GPL @@ -32,6 +33,7 @@ #include #include +#include #include #include diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index e9b117146..1116d8bde 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -2,7 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Copyright (C) 2007-2012 Stefan Seyfried + Copyright (C) 2007-2014 Stefan Seyfried License: GPL @@ -48,6 +48,7 @@ #include #include #include +#include extern CPictureViewer * g_PicViewer; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index e73b74165..863533b1b 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -4,6 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2009-2014 Stefan Seyfried License: GPL @@ -51,6 +52,7 @@ #include #include #include +#include #include diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 7fba30b57..7e83d8391 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -27,7 +27,7 @@ #ifndef __EVENTLIST_HPP__ #define __EVENTLIST_HPP__ -#include +#include #include #include diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 891daca53..082ee51d4 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -30,7 +30,7 @@ Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' - (C) 2009-2012 Stefan Seyfried + (C) 2009-2014 Stefan Seyfried ****************************************************************************/ @@ -65,6 +65,8 @@ #include #include +#include + extern CPictureViewer * g_PicViewer; static CProgressBar *timescale; diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 4651df1a9..97812d6d7 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -47,6 +47,8 @@ #include #include +#include + #include #include diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index d21a87425..35180e121 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -2,6 +2,7 @@ Neutrino-GUI - DBoxII-Project Timerliste by Zwen + (C) 2009, 2011-2014 Stefan Seyfried Homepage: http://dbox.cyberphoria.org/ @@ -70,6 +71,8 @@ #include #include +#include + #include extern CBouquetManager *g_bouquetManager; diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 8b74bc278..4e752c4e6 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -33,7 +33,7 @@ #ifndef __timerlist__ #define __timerlist__ -#include +#include #include @@ -42,6 +42,7 @@ #include +class CTimerdClient; class CTimerList : public CMenuTarget { private: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 09d88c2b7..3a6f2471e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -5,6 +5,8 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2006-2014 Stefan Seyfried + Copyright (C) 2011 CoolStream International Ltd License: GPL @@ -108,7 +110,7 @@ #include #include -#include +#include #include #include From 0d179f3f540c08010daee4e1a8ca2174a31b5b7b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Jan 2014 16:56:31 +0100 Subject: [PATCH 12/26] timerdclient: remove EVT_NEXTPROGRAM ...and EVT_ANNOUNCE_NEXTPROGRAM. These are only internal API, so no incompatibility should occur. --- lib/timerdclient/timerdclient.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 538ac3351..89ef81d84 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -48,8 +48,6 @@ class CTimerdClient:private CBasicClient EVT_ANNOUNCE_SHUTDOWN, EVT_ZAPTO, EVT_ANNOUNCE_ZAPTO, - EVT_NEXTPROGRAM, - EVT_ANNOUNCE_NEXTPROGRAM, EVT_STANDBY_ON, EVT_STANDBY_OFF, EVT_RECORD_START, From 07caa88ad2ea6fb6ec1a81cb1c58850c8e3c57e1 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Jan 2014 16:56:41 +0100 Subject: [PATCH 13/26] timerd: rename TIMER_NEXTPROGRAM To ensure it is no longer used, rename it to __TIMER_NEXTPROGRAM. It cannot be removed without breaking compatibility, since it is part of the API (the integers values of enum CTimerEventTypes are written to timerd.conf) --- lib/timerdclient/timerdtypes.h | 2 +- src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index b91d0ee79..a57a2009f 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -61,7 +61,7 @@ class CTimerd enum CTimerEventTypes { TIMER_SHUTDOWN = 1, - TIMER_NEXTPROGRAM, + __TIMER_NEXTPROGRAM, /* unused, here to keep compatibility with old timerd.conf */ TIMER_ZAPTO, TIMER_STANDBY, TIMER_RECORD, diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 28f6b49f4..9d557fbbb 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -884,7 +884,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string /*------------------------------------------------------------------------------ CTimerd::TIMER_RECORD = 5 CTimerd::TIMER_STANDBY = 4 - CTimerd::TIMER_NEXTPROGRAM = 2 + CTimerd::TIMER_NEXTPROGRAM = 2 !!! no longer used !!! CTimerd::TIMER_ZAPTO = 3 CTimerd::TIMER_REMIND = 6 CTimerd::TIMER_EXEC_PLUGIN = 8 @@ -945,7 +945,7 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin std::string sel; for(int i=1; i<=8;i++) { - if(i!=(int)CTimerd::TIMER_NEXTPROGRAM) + if (i != (int)CTimerd::__TIMER_NEXTPROGRAM) { std::string zType = NeutrinoAPI->timerEventType2Str((CTimerd::CTimerEventTypes) i); if(cmd != "new") From 84dff7ea594f1ba14d93eaa23ee53cc914948284 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 12 Jan 2014 16:57:40 +0100 Subject: [PATCH 14/26] scannit: fix printf format --- src/zapit/src/scannit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index 698e8ae34..2292db284 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -430,7 +430,7 @@ bool CNit::ParseLogicalChannels(LogicalChannelDescriptor * ld, TransportStreamIn transport_stream_id, original_network_id, service_id); int visible = (*it)->getVisibleServiceFlag(); #ifdef DEBUG_LCN - printf("NIT: logical channel tsid %04x onid %04x %012llx -> %d (%s, %d)\n", transport_stream_id, original_network_id, channel_id, lcn, hd ? "hd", : "sd", visible); + printf("NIT: logical channel tsid %04x onid %04x %012llx -> %d (%s, %d)\n", transport_stream_id, original_network_id, channel_id, lcn, hd ? "hd" : "sd", visible); #endif if (visible && lcn) { if(hd) From 1640784844f0f069c76a5f211f79432c745c34d9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 13 Jan 2014 21:09:03 +0100 Subject: [PATCH 15/26] zapit: improve the lockPlayBack "nonblank-Hack" --- src/zapit/include/zapit/zapit.h | 2 +- src/zapit/src/zapit.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 9be18fe7f..00b8e4da6 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -198,7 +198,7 @@ class CZapit : public OpenThreads::Thread void LoadVolumeMap(); void SaveChannelPids(CZapitChannel* channel); virtual void ConfigFrontend(); - bool StopPlayBack(bool send_pmt); + bool StopPlayBack(bool send_pmt, bool blank = true); virtual void leaveStandby(); static CZapit * zapit; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index f09d76532..9ba547180 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1617,10 +1617,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) #endif case CZapitMessages::CMD_SB_LOCK_PLAYBACK: - /* hack. if standby true, dont blank video */ - standby = true; - StopPlayBack(true); - standby = false; + StopPlayBack(msgBool.truefalse, false); playbackStopForced = true; lock_channel_id = live_channel_id; SendCmdReady(connfd); @@ -2103,7 +2100,7 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) return true; } -bool CZapit::StopPlayBack(bool send_pmt) +bool CZapit::StopPlayBack(bool send_pmt, bool blank) { if(send_pmt) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY); @@ -2122,7 +2119,7 @@ bool CZapit::StopPlayBack(bool send_pmt) audioDecoder->Stop(); /* hack. if standby, dont blank video -> for paused timeshift */ - videoDecoder->Stop(standby ? false : true); + videoDecoder->Stop(standby ? false : blank); #ifdef USE_VBI videoDecoder->StopVBI(); #endif From 51a46646a8c980f0272c48768c4de01962ef94bb Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 13 Jan 2014 21:22:40 +0100 Subject: [PATCH 16/26] Revert "zapit: improve the lockPlayBack "nonblank-Hack"" This reverts commit 1640784844f0f069c76a5f211f79432c745c34d9 because previous changes are missing. --- src/zapit/include/zapit/zapit.h | 2 +- src/zapit/src/zapit.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 00b8e4da6..9be18fe7f 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -198,7 +198,7 @@ class CZapit : public OpenThreads::Thread void LoadVolumeMap(); void SaveChannelPids(CZapitChannel* channel); virtual void ConfigFrontend(); - bool StopPlayBack(bool send_pmt, bool blank = true); + bool StopPlayBack(bool send_pmt); virtual void leaveStandby(); static CZapit * zapit; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 9ba547180..f09d76532 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1617,7 +1617,10 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) #endif case CZapitMessages::CMD_SB_LOCK_PLAYBACK: - StopPlayBack(msgBool.truefalse, false); + /* hack. if standby true, dont blank video */ + standby = true; + StopPlayBack(true); + standby = false; playbackStopForced = true; lock_channel_id = live_channel_id; SendCmdReady(connfd); @@ -2100,7 +2103,7 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) return true; } -bool CZapit::StopPlayBack(bool send_pmt, bool blank) +bool CZapit::StopPlayBack(bool send_pmt) { if(send_pmt) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY); @@ -2119,7 +2122,7 @@ bool CZapit::StopPlayBack(bool send_pmt, bool blank) audioDecoder->Stop(); /* hack. if standby, dont blank video -> for paused timeshift */ - videoDecoder->Stop(standby ? false : blank); + videoDecoder->Stop(standby ? false : true); #ifdef USE_VBI videoDecoder->StopVBI(); #endif From f373f621efb2aeefe3dd5106d04e2b8147cc4a3a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 14 Jan 2014 19:15:46 +0100 Subject: [PATCH 17/26] CControlAPI:: -add epgsearchxml & epgsearch --- .../tuxboxapi/coolstream/controlapi.cpp | 129 +++++++++++++++++- src/nhttpd/tuxboxapi/coolstream/controlapi.h | 4 +- 2 files changed, 130 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 381d72a87..2c29ca2b6 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -155,8 +155,10 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, - {"epg", &CControlAPI::EpgCGI, ""}, - {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, + {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, + {"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""}, + {"epg", &CControlAPI::EpgCGI, ""}, + {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system @@ -1283,6 +1285,128 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { hh->WriteLn(result); } } +//------------------------------------------------------------------------------------------------- +inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +{ + return a.startTime < b.startTime; +} +extern const char * GetGenre(const unsigned char contentClassification); // UTF-8 +void CControlAPI::EpgSearchXMLCGI(CyhookHandler *hh) +{ + EpgSearchCGI(hh, true);//xml_forat = true +} +void CControlAPI::EpgSearchTXTCGI(CyhookHandler *hh) +{ + EpgSearchCGI(hh, false);//xml_forat = false +} + +void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) +{ + t_channel_id channel_id; + CChannelEventList evtlist; + bool param_empty = hh->ParamList.empty(); + const int m_search_epg_item = 5; + if(!param_empty){ + if(xml_forat){ + hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); + hh->WriteLn(""); + hh->WriteLn(""); + } + else{ + hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default + } + + std::string m_search_keyword =hh->ParamList["1"]; + + std::vector v; + int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio + for(int channel = 0; channel < channel_nr; channel++){ + channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; + v.push_back(channel_id); + } + std::map ch_id_map; + std::vector::iterator it; + for (it = v.begin(); it != v.end(); ++it){ + ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; + } + CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann + + if(!evtlist.empty()){ + std::map::iterator map_it; + CChannelEventList::iterator e; + for ( e=evtlist.begin(); e!=evtlist.end();++e){ + map_it = ch_id_map.find(e->channelID); + if (map_it != ch_id_map.end()){ + e->channelID = map_it->second;//map channelID48 to channelID + } + else{ + evtlist.erase(e--);// remove event for not found channels in channelList + } + } + } + if(!evtlist.empty()){ + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + } + + time_t azeit=time(NULL); + CShortEPGData epg; + CEPGData longepg; + char tmpstr[256] ={0}; + CChannelEventList::iterator eventIterator; + unsigned int u_azeit = ( azeit > -1)? azeit:0; + for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator){ + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { + if( (eventIterator->startTime+eventIterator->duration) < u_azeit) + continue; + struct tm *tmStartZeit = localtime(&eventIterator->startTime); + if(xml_forat){ + hh->printf("\t"); + hh->printf("\t\t%s\n",NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()); + hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.title.c_str()).c_str()); + hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info1.c_str()).c_str()); + hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str()); + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { + hh->printf("\t\t%u\n", longepg.fsk); + if (longepg.contentClassification.length()> 0){ + std::string genere = GetGenre(longepg.contentClassification[0]); + hh->printf("\t\t%s\n", ZapitTools::UTF8_to_UTF8XML(genere.c_str()).c_str()); + } + } + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); + hh->printf("\t\t%s\n", tmpstr); + strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit ); + hh->printf("\t\t\n", tmpstr); + hh->printf("\t\t%d\n", eventIterator->duration); + hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",eventIterator->channelID); + hh->printf("\t\t\t%ld\n",eventIterator->eventID); + hh->printf("\t"); + }else{ + std::string datetimer_str ; + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d %H:%M", tmStartZeit ); + datetimer_str = tmpstr; + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + + hh->WriteLn(datetimer_str); + hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); + hh->WriteLn(epg.title); + if(!epg.info1.empty()) + hh->WriteLn(epg.info1); + if(!epg.info2.empty()) + hh->WriteLn(epg.info2); + hh->WriteLn("----------------------------------------------------------"); + + } + } + } + if(xml_forat) + hh->printf(""); + }else + hh->SendError(); + +} //------------------------------------------------------------------------- /** Return EPG data @@ -1300,6 +1424,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { * stoptime : show only items until stoptime reached * @endcode */ + //------------------------------------------------------------------------- void CControlAPI::EpgCGI(CyhookHandler *hh) { NeutrinoAPI->eList.clear(); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index 151dbf160..33d969ae6 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -40,7 +40,9 @@ private: void SendTimers(CyhookHandler *hh); void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); - + void EpgSearchXMLCGI(CyhookHandler *hh); + void EpgSearchTXTCGI(CyhookHandler *hh); + void EpgSearchCGI(CyhookHandler *hh, bool xml_forat = false); // subs friend class CNeutrinoWebserver; // for timer /fb/ compatibility void doModifyTimer(CyhookHandler *hh); From 3f65005339ee198636e365c84d6b204aadc7fd30 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 16 Jan 2014 18:46:51 +0100 Subject: [PATCH 18/26] CControlAPI:: epgsearchxml fix time format --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 2c29ca2b6..186501960 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1352,6 +1352,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) CShortEPGData epg; CEPGData longepg; char tmpstr[256] ={0}; + std::string genere; CChannelEventList::iterator eventIterator; unsigned int u_azeit = ( azeit > -1)? azeit:0; for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator){ @@ -1368,13 +1369,14 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { hh->printf("\t\t%u\n", longepg.fsk); if (longepg.contentClassification.length()> 0){ - std::string genere = GetGenre(longepg.contentClassification[0]); - hh->printf("\t\t%s\n", ZapitTools::UTF8_to_UTF8XML(genere.c_str()).c_str()); + genere = GetGenre(longepg.contentClassification[0]); + genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); + hh->printf("\t\t%s\n", genere.c_str()); } } strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); hh->printf("\t\t%s\n", tmpstr); - strftime(tmpstr, sizeof(tmpstr), ". %H:%M", tmStartZeit ); + strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); hh->printf("\t\t\n", tmpstr); hh->printf("\t\t%d\n", eventIterator->duration); hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",eventIterator->channelID); @@ -1396,6 +1398,14 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) hh->WriteLn(epg.info1); if(!epg.info2.empty()) hh->WriteLn(epg.info2); + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { + hh->printf("fsk:%u\n", longepg.fsk); + if (longepg.contentClassification.length()> 0){ + genere = GetGenre(longepg.contentClassification[0]); + genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); + hh->WriteLn(genere); + } + } hh->WriteLn("----------------------------------------------------------"); } From 9455b0eedab2a6b3114fe086dc4afb5185d8e881 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 16 Jan 2014 20:58:14 +0100 Subject: [PATCH 19/26] CRecordInstance::FillMovieInfo: -fix epg title if epgid removed http://www.dbox2world.net/board293-cst-coolstream/board314-cst-coolstream-development/12026-probleme-mit-timeraufnahme/ --- src/driver/record.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index da5343fb1..e8c49cca7 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -570,8 +570,23 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->length = epgdata.epg_times.dauer / 60; + printf("fsk:%d, Genre:%d, Dauer: %d\r\n",recMovieInfo->parentalLockAge,recMovieInfo->genreMajor,recMovieInfo->length); + } else if (!epgTitle.empty()) {//if old eepgid removed + tmpstring = epgTitle; + } else if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgdata )){ + tmpstring = epgdata.title; + info1 = epgdata.info1; + info2 = epgdata.info2; + + recMovieInfo->parentalLockAge = epgdata.fsk; + if( !epgdata.contentClassification.empty() ) + recMovieInfo->genreMajor = epgdata.contentClassification[0]; + + recMovieInfo->length = epgdata.epg_times.dauer / 60; + printf("fsk:%d, Genre:%d, Dauer: %d\r\n",recMovieInfo->parentalLockAge,recMovieInfo->genreMajor,recMovieInfo->length); } + } else if (!epgTitle.empty()) { tmpstring = epgTitle; } From 1f2fc31438b4e0a5c24b1f66632cbbda4b0d4b56 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 17 Jan 2014 14:17:24 +0400 Subject: [PATCH 20/26] locals: add locale for vfd scroll on/off option --- 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 0bb1c71df..60774fae3 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -718,6 +718,7 @@ lcdmenu.dim_brightness Brightness after dim timeout lcdmenu.dim_time Dim timeout lcdmenu.head VFD Settings lcdmenu.lcdcontroler Brightness +lcdmenu.scroll Enable text scroll lcdmenu.statusline status line lcdmenu.statusline.both volume / playtime lcdmenu.statusline.playtime playtime @@ -1175,6 +1176,7 @@ menu.hint_vfd_brightnessstandby Brightness in soft-standby mode menu.hint_vfd_defaults Restore default brightness values menu.hint_vfd_dimtime Auto-dim time, in seconds menu.hint_vfd_infoline Choose what to display in main VFD line +menu.hint_vfd_scroll Enable or disable text scrolling on VFD menu.hint_vfd_statusline Choose what to display in short\nVFD status line menu.hint_video Video output, resolution, format\nAspect ratio, fast mode switch options menu.hint_video_43mode Display mode for 4:3 content\non 16:9 TV diff --git a/src/system/locals.h b/src/system/locals.h index f39eae2a9..f9079ba73 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -745,6 +745,7 @@ typedef enum LOCALE_LCDMENU_DIM_TIME, LOCALE_LCDMENU_HEAD, LOCALE_LCDMENU_LCDCONTROLER, + LOCALE_LCDMENU_SCROLL, LOCALE_LCDMENU_STATUSLINE, LOCALE_LCDMENU_STATUSLINE_BOTH, LOCALE_LCDMENU_STATUSLINE_PLAYTIME, @@ -1202,6 +1203,7 @@ typedef enum LOCALE_MENU_HINT_VFD_DEFAULTS, LOCALE_MENU_HINT_VFD_DIMTIME, LOCALE_MENU_HINT_VFD_INFOLINE, + LOCALE_MENU_HINT_VFD_SCROLL, LOCALE_MENU_HINT_VFD_STATUSLINE, LOCALE_MENU_HINT_VIDEO, LOCALE_MENU_HINT_VIDEO_43MODE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e967782e2..c40f74378 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -745,6 +745,7 @@ const char * locale_real_names[] = "lcdmenu.dim_time", "lcdmenu.head", "lcdmenu.lcdcontroler", + "lcdmenu.scroll", "lcdmenu.statusline", "lcdmenu.statusline.both", "lcdmenu.statusline.playtime", @@ -1202,6 +1203,7 @@ const char * locale_real_names[] = "menu.hint_vfd_defaults", "menu.hint_vfd_dimtime", "menu.hint_vfd_infoline", + "menu.hint_vfd_scroll", "menu.hint_vfd_statusline", "menu.hint_video", "menu.hint_video_43mode", From 42fef516fe02d7dc3b1df7cfc69d0dc5c7d4680d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 17 Jan 2014 14:17:59 +0400 Subject: [PATCH 21/26] gui/vfd_setup.cpp: add option to switch on/off text scroll --- src/gui/vfd_setup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index ecfc2f891..03796cba5 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -148,6 +148,10 @@ int CVfdSetup::showSetup() vfds->addItem(oj); vfds->addItem(lcd_clock_channelname_menu); + oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); + oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); + vfds->addItem(oj); + int res = vfds->exec(NULL, ""); delete vfds; From b1f21b47ca11761533dabfef9887fe6651dfcbd4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 17 Jan 2014 14:20:26 +0400 Subject: [PATCH 22/26] neutrino.cpp: add g_settings.lcd_scroll option; move rcK and umount on shutdown later to fix deep-standby clock in case of /var partition (thanks Thomas) --- src/neutrino.cpp | 11 +++++++---- src/system/settings.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3a6f2471e..453f9f5a8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -384,6 +384,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.backlight_tv = configfile.getInt32( "backlight_tv", 1); g_settings.backlight_standby = configfile.getInt32( "backlight_standby", 0); g_settings.backlight_deepstandby = configfile.getInt32( "backlight_deepstandby", 0); + g_settings.lcd_scroll = configfile.getInt32( "lcd_scroll", 1); g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120); @@ -895,6 +896,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "backlight_tv", g_settings.backlight_tv); configfile.setInt32( "backlight_standby", g_settings.backlight_standby); configfile.setInt32( "backlight_deepstandby", g_settings.backlight_deepstandby); + configfile.setInt32( "lcd_scroll", g_settings.lcd_scroll); //misc configfile.setInt32( "power_standby", g_settings.power_standby); @@ -3087,10 +3089,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) mode = mode_off; //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); - my_system("/etc/init.d/rcK"); - sync(); - my_system(2,"/bin/umount", "-a"); - sleep(1); { fp_standby_data_t standby; time_t mtime = time(NULL); @@ -3130,6 +3128,11 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) standby.timer_minutes_hi = fp_timer >> 8;; standby.timer_minutes_lo = fp_timer & 0xFF; + my_system("/etc/init.d/rcK"); + sync(); + my_system(2,"/bin/umount", "-a"); + sleep(1); + stop_video(); int fd = open("/dev/display", O_RDONLY); diff --git a/src/system/settings.h b/src/system/settings.h index 6eb960b76..61b9998cb 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -578,6 +578,7 @@ struct SNeutrinoSettings int backlight_tv; int backlight_standby; int backlight_deepstandby; + int lcd_scroll; //#define FILESYSTEM_ENCODING_TO_UTF8(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define FILESYSTEM_ENCODING_TO_UTF8(a) (isUTF8(a) ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define UTF8_TO_FILESYSTEM_ENCODING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::UTF8_to_Latin1(a).c_str()) From eba370d876269164570498141a186d3a65682b8f Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 17 Jan 2014 14:23:02 +0400 Subject: [PATCH 23/26] driver/vfd.cpp: add support to switch scroll on/off --- src/driver/vfd.cpp | 33 +++++++++++++++------------------ src/driver/vfd.h | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index da15d7467..6cfabe673 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -41,6 +41,9 @@ #include #include +#include +#include + #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ @@ -697,29 +700,23 @@ void CVFD::ShowIcon(fp_icon icon, bool show) perror(show ? "IOC_FP_SET_ICON" : "IOC_FP_CLEAR_ICON"); } -void CVFD::ShowText(const char *str) +void CVFD::ShowText(const char * str) { - int len = strlen(str); - int i = 0, ret; + char flags[2] = { FP_FLAG_ALIGN_LEFT, 0 }; -printf("CVFD::ShowText: [%s]\n", str); - if (len > 0) - { - for (i = len; i > 0; i--) { - if (str[i - 1] != ' ') - break; - } - } + if (g_settings.lcd_scroll) + flags[0] |= FP_FLAG_SCROLL_ON | FP_FLAG_SCROLL_SIO | FP_FLAG_SCROLL_DELAY; - if (((int)strlen(text) == i && !strncmp(str, text, i)) || len > 255) + std::string txt = std::string(flags) + str; + txt = trim(txt); + printf("CVFD::ShowText: [%s]\n", txt.c_str() + 1); + + size_t len = txt.length(); + if (txt == text || len > 255) return; - strncpy(text, str, i); - text[i] = '\0'; - -//printf("****************************** CVFD::ShowText: %s\n", str); - //FIXME !! - ret = ioctl(fd, IOC_FP_SET_TEXT, len ? str : NULL); + text = txt; + int ret = ioctl(fd, IOC_FP_SET_TEXT, len > 1 ? txt.c_str() : NULL); if(ret < 0) perror("IOC_FP_SET_TEXT"); } diff --git a/src/driver/vfd.h b/src/driver/vfd.h index d4192eb83..8adaf13b5 100644 --- a/src/driver/vfd.h +++ b/src/driver/vfd.h @@ -90,7 +90,7 @@ class CVFD unsigned int switch_name_time_cnt; int fd; int brightness; - char text[256]; + std::string text; void count_down(); From 14580b1dd157340c23e7f8d42d17f7da7b895072 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 18 Jan 2014 19:58:40 +0100 Subject: [PATCH 24/26] CRecordInstance::FillMovieInfo supplement to 9455b0eedab2a6b3114fe086dc4afb5185d8e881 , check current epg before we take title from timer --- src/driver/record.cpp | 47 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index e8c49cca7..1ba5b97c8 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -559,34 +559,31 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = "not available"; if (epgid != 0) { CEPGData epgdata; - if (CEitManager::getInstance()->getEPGid(epgid, epg_time, &epgdata)) { - tmpstring = epgdata.title; - info1 = epgdata.info1; - info2 = epgdata.info2; + bool epg_ok = CEitManager::getInstance()->getEPGid(epgid, epg_time, &epgdata); + if(!epg_ok){//if old epgid removed check currurrent epgid + epg_ok = CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgdata ); - recMovieInfo->parentalLockAge = epgdata.fsk; - if( !epgdata.contentClassification.empty() ) - recMovieInfo->genreMajor = epgdata.contentClassification[0]; - - recMovieInfo->length = epgdata.epg_times.dauer / 60; - - printf("fsk:%d, Genre:%d, Dauer: %d\r\n",recMovieInfo->parentalLockAge,recMovieInfo->genreMajor,recMovieInfo->length); - } else if (!epgTitle.empty()) {//if old eepgid removed - tmpstring = epgTitle; - } else if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgdata )){ - tmpstring = epgdata.title; - info1 = epgdata.info1; - info2 = epgdata.info2; - - recMovieInfo->parentalLockAge = epgdata.fsk; - if( !epgdata.contentClassification.empty() ) - recMovieInfo->genreMajor = epgdata.contentClassification[0]; - - recMovieInfo->length = epgdata.epg_times.dauer / 60; - - printf("fsk:%d, Genre:%d, Dauer: %d\r\n",recMovieInfo->parentalLockAge,recMovieInfo->genreMajor,recMovieInfo->length); + if(epg_ok && !epgTitle.empty()){ + std::string tmp_title = epgdata.title; + if(epgTitle != tmp_title) + epg_ok = false; + } } + if (epg_ok) { + tmpstring = epgdata.title; + info1 = epgdata.info1; + info2 = epgdata.info2; + recMovieInfo->parentalLockAge = epgdata.fsk; + if( !epgdata.contentClassification.empty() ) + recMovieInfo->genreMajor = epgdata.contentClassification[0]; + + recMovieInfo->length = epgdata.epg_times.dauer / 60; + + printf("fsk:%d, Genre:%d, Dauer: %d\r\n",recMovieInfo->parentalLockAge,recMovieInfo->genreMajor,recMovieInfo->length); + } else if (!epgTitle.empty()) {//if old epgid removed + tmpstring = epgTitle; + } } else if (!epgTitle.empty()) { tmpstring = epgTitle; } From 59b3245680311ca5f46bbb9dd5561ec2ba07facf Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 18 Jan 2014 20:17:24 +0100 Subject: [PATCH 25/26] CControlAPI::EpgSearchCGI add duration to txt output --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 186501960..48c500b05 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1390,6 +1390,8 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); datetimer_str += " "; datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); + datetimer_str += tmpstr; hh->WriteLn(datetimer_str); hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); From 7b40b61c9af2d7ba56e0809262fab87a2ca8994e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 18 Jan 2014 21:02:23 +0100 Subject: [PATCH 26/26] remove CURRENTSERVICES_XML after reload channels --- src/gui/scan_setup.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 3cc6ccd67..638956ef3 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -33,6 +33,8 @@ #include #endif +#include + #include #include #include @@ -259,6 +261,9 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) if (reloadhintBox) reloadhintBox->hide(); CNeutrinoApp::getInstance ()->SDTreloadChannels = false; + if(file_exists(CURRENTSERVICES_XML)){ + unlink(CURRENTSERVICES_XML); + } return res; } else if(actionKey == "satsetup")