diff --git a/cross-configure.cool b/cross-configure.cool index b35b48763..60daab140 100755 --- a/cross-configure.cool +++ b/cross-configure.cool @@ -27,5 +27,5 @@ export FREETYPE_CONFIG=$PREFIX/bin/freetype-config export CURL_CONFIG=$PREFIX/bin/curl-config ./autogen.sh -./configure --prefix=${PREFIX} --build=i386-pc-linux-gnu --host=$HOST --without-driver --with-target=cdk --with-targetprefix="" "$*" +./configure --prefix=${PREFIX} --build=i386-pc-linux-gnu --host=$HOST --enable-flac --with-target=cdk --with-targetprefix="" "$*" diff --git a/cross-configure.cool.debug b/cross-configure.cool.debug index 6ce9ebed1..10f42ba3b 100755 --- a/cross-configure.cool.debug +++ b/cross-configure.cool.debug @@ -1,6 +1,6 @@ #!/bin/sh -PREFIX=/opt/newcross/arm-cx2450x-linux-gnueabi/arm-cx2450x-linux-gnueabi/sys-root/usr +PREFIX=/opt/arm/arm-cx2450x-linux-gnueabi/arm-cx2450x-linux-gnueabi/sys-root/usr CCPATH= HOST=arm-cx2450x-linux-gnueabi @@ -27,5 +27,5 @@ export FREETYPE_CONFIG=$PREFIX/bin/freetype-config export CURL_CONFIG=$PREFIX/bin/curl-config ./autogen.sh -./configure --prefix=${PREFIX} --build=i386-pc-linux-gnu --host=$HOST --without-driver --with-target=cdk --with-targetprefix="" "$*" +./configure --prefix=${PREFIX} --build=i386-pc-linux-gnu --host=$HOST --enable-flac --with-target=cdk --with-targetprefix="" "$*" diff --git a/data/cables.xml b/data/cables.xml index b0b9f8965..619c3279a 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -1337,6 +1337,7 @@ + diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d09ead308..2ca31dd32 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -125,6 +125,7 @@ audiomenu.pref_subs Sprache audiomenu.pref_subs_head Untertitelwahl audiomenu.spdif_dd Dolby Digital über S/PDIF audiomenu.stereo stereo +audiomenu.volume_adjust Lautstärke ändern, in % audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen audioplayer.add_ic Icecast @@ -291,6 +292,7 @@ date.Sun So date.Thu Do date.Tue Di date.Wed Mi +epg.saving Speichere EPG epgextended.actors Darsteller epgextended.director Regie epgextended.guests Gäste @@ -866,7 +868,7 @@ menu.hint_misc_zapit Behandlung der Start-TV/Start-Radio Kanäle menu.hint_movie Wiedergabe von Filmen menu.hint_net_broadcast Hier können Sie die Broadcast-Adresse ändern,\nwenn Sie unsicher sind, verwenden Sie zuletzt .255 menu.hint_net_dhcp Verwenden Sie einen DHCP-Server für die automatische\nKonfiguration können Sie es hier einstellen -menu.hint_net_djmount Mountet UPnP-Geräte als Dateisystem\nunter / media/00upnp +menu.hint_net_djmount Mountet UPnP-Geräte als Dateisystem\nunter /media/00upnp menu.hint_net_ftpd Aktivieren Sie die Dateiübertragung über FTP menu.hint_net_gateway Hier können Sie die Gateway-Adresse des Routers eingeben menu.hint_net_hostname Hier kann man den Hostnamen der Box ändern @@ -975,6 +977,7 @@ menu.hint_scan_logical_hd Wenn der Kanal in SD und in HD verfügbar ist,\nwird H menu.hint_scan_longitude Geben Sie ihren Längengrad ein menu.hint_scan_manual Manueller Transponder-Scan mit ausgewählten Parametern menu.hint_scan_mod Wählen Sie eine Transponder-Modulation +menu.hint_scan_motor_18v Benutze 18V für Motorbewegung menu.hint_scan_motor_speed Rotor-Bewegungsgeschwindigkeit in 1/10 Grad pro Sekunde menu.hint_scan_motorpos Wählen Sie eine gespeicherten Positions-Nummer für diesen Satelliten menu.hint_scan_nid Hier können Sie ihre Kabelnetzwerk-Id in dezimal eingeben @@ -1158,6 +1161,7 @@ motorcontrol.store Speichere Motorposition (a) motorcontrol.timed_mode Zeitgesteuerter Schrittweitenmodus motorcontrol.user_menu Benutzermenü motorcontrol.west_limit Setze westliches (soft) Limit +moviebrowser.book_add Lesezeichen setzen moviebrowser.book_clear_all Lösche alle moviebrowser.book_head Markierungen moviebrowser.book_lastmoviestop letzter Wiedergabestopp: diff --git a/data/locale/english.locale b/data/locale/english.locale index 10e8c4549..3f3100cbf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -125,6 +125,7 @@ audiomenu.pref_subs Prefered subtitle language audiomenu.pref_subs_head Subtitle language preferences audiomenu.spdif_dd Encoded DD on SPDIF audiomenu.stereo stereo +audiomenu.volume_adjust Volume adjustment, in % audiomenu.volume_step Volume step audioplayer.add Add audioplayer.add_ic Icecast @@ -291,6 +292,7 @@ date.Sun Sun date.Thu Thu date.Tue Tue date.Wed Wed +epg.saving Saving EPG epgextended.actors Actors epgextended.director Director epgextended.guests Guests @@ -866,7 +868,7 @@ menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies menu.hint_net_broadcast Enter broadcast address\nif unsure, use IP address with last .255 menu.hint_net_dhcp Use DHCP server to auto-configure -menu.hint_net_djmount mount uPnp devices as filesystem\nunder /media/00upnp +menu.hint_net_djmount Mount UPnP devices as filesystem\nunder /media/00upnp menu.hint_net_ftpd Enable file transfer using FTP menu.hint_net_gateway Enter gateway/router IP address menu.hint_net_hostname Change your box hostname @@ -975,6 +977,7 @@ menu.hint_scan_logical_hd If both SD and HD channel versions present\nput HD to menu.hint_scan_longitude Enter your longtitude menu.hint_scan_manual Manual transponder scan using\nselected parameters menu.hint_scan_mod Select transponder modulation +menu.hint_scan_motor_18v Use 18V when moving rotor menu.hint_scan_motor_speed Rotor moving speed in 1/10 degree\nper second menu.hint_scan_motorpos Select stored position number for\nthis satellite menu.hint_scan_nid Enter decimal network ID @@ -1158,6 +1161,7 @@ motorcontrol.store Store Motor Position (a) motorcontrol.timed_mode Timed Step Mode motorcontrol.user_menu User menu motorcontrol.west_limit Set West (soft) Limit +moviebrowser.book_add Add bookmark moviebrowser.book_clear_all Clear all moviebrowser.book_head Bookmarks moviebrowser.book_lastmoviestop Last play stop: diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index ad67f055e..21a2b1bc6 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -16,7 +16,6 @@ #include "Debug.hpp" #include "PacketQueue.hpp" -#include "semaphore.h" #include "helpers.hpp" #include "dvbsubtitle.h" diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index 43297eade..b88ed4d6d 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -22,7 +22,7 @@ extern "C" { #include #include } -#include "driver/framebuffer.h" +#include #include "Debug.hpp" // Set these to 'true' for debug output: diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index c629daa6a..9ef4c5c67 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -15,9 +15,10 @@ #include "teletext.h" #include "tuxtxt.h" -#include "driver/framebuffer.h" +#include #include #include +#include /* same as in rcinput.h... */ #define KEY_TTTV KEY_FN_1 @@ -82,7 +83,7 @@ void gethotlist() hotlistchanged = 0; maxhotlist = -1; - sprintf(line, CONFIGDIR "/tuxtxt/hotlist%d.conf", tuxtxt_cache.vtxtpid); + sprintf(line, TUXTXTDIR "/hotlist%d.conf", tuxtxt_cache.vtxtpid); #if TUXTXT_DEBUG printf("TuxTxt -#ifndef NEW_CST_KERNEL -#include -#endif - #include #include @@ -68,7 +64,8 @@ extern int tuxtxt_get_zipsize(int p, int sp); #endif -#define TUXTXTCONF CONFIGDIR "/tuxtxt/tuxtxt2.conf" +#define TUXTXTDIR CONFIGDIR "/tuxtxt" +#define TUXTXTCONF TUXTXTDIR "/tuxtxt2.conf" /* fonts */ #define TUXTXTTTF FONTDIR "/tuxtxt.ttf" diff --git a/lib/sectionsdclient/sectionsdMsg.h b/lib/sectionsdclient/sectionsdMsg.h index 527b45cce..4595a80ca 100644 --- a/lib/sectionsdclient/sectionsdMsg.h +++ b/lib/sectionsdclient/sectionsdMsg.h @@ -54,28 +54,12 @@ struct sectionsd enum commands { dumpStatusinformation, // commandDumpStatusInformation - allEventsChannelIDSearch, // commandAllEventsChannelIDSearch pauseScanning, // commandPauseScanning // for the grabbers ;) getIsScanningActive, // commandGetIsScanningActive - actualEPGchannelID, // commandActualEPGchannelID - actualEventListTVshortIDs, // commandEventListTVids - actualEventListRadioShortIDs, // commandEventListRadioIDs - currentNextInformationID, // commandCurrentNextInfoChannelID - epgEPGid, // commandEPGepgID - epgEPGidShort, // commandEPGepgIDshort - ComponentTagsUniqueKey, // commandComponentTagsUniqueKey - allEventsChannelID_, // commandAllEventsChannelID - timesNVODservice, // commandTimesNVODservice getIsTimeSet, // commandGetIsTimeSet serviceChanged, // commandserviceChanged - LinkageDescriptorsUniqueKey, // commandLinkageDescriptorsUniqueKey CMD_registerEvents, // commandRegisterEventClient CMD_unregisterEvents, // commandUnRegisterEventClient -#ifdef ENABLE_PPT - setPrivatePid, // commandSetPrivatePid -#else - dummy11_setPrivatePid, -#endif freeMemory, // commandFreeMemory readSIfromXML, // commandReadSIfromXML writeSI2XML, // commandWriteSI2XML @@ -85,11 +69,13 @@ struct sectionsd numberOfCommands // <- no actual command, end of command marker }; +#if 0 struct commandGetEPGid { uint64_t eventid; time_t starttime; } __attribute__ ((packed)) ; +#endif struct commandSetServiceChanged { diff --git a/lib/sectionsdclient/sectionsdclient.cpp b/lib/sectionsdclient/sectionsdclient.cpp index 6d6da6b4b..4c6e16c0c 100644 --- a/lib/sectionsdclient/sectionsdclient.cpp +++ b/lib/sectionsdclient/sectionsdclient.cpp @@ -56,7 +56,6 @@ int CSectionsdClient::readResponse(char* data,unsigned int size) return responseHeader.dataLength; } - bool CSectionsdClient::send(const unsigned char command, const char* data, const unsigned int size) { sectionsd::msgRequestHeader msgHead; @@ -161,7 +160,61 @@ void CSectionsdClient::setServiceChanged(const t_channel_id channel_id, const bo close_connection(); } +void CSectionsdClient::freeMemory() +{ + send(sectionsd::freeMemory); + readResponse(); + close_connection(); +} + +void CSectionsdClient::readSIfromXML(const char * epgxmlname) +{ + send(sectionsd::readSIfromXML, (char*) epgxmlname, strlen(epgxmlname)); + + readResponse(); + close_connection(); +} + +void CSectionsdClient::writeSI2XML(const char * epgxmlname) +{ + send(sectionsd::writeSI2XML, (char*) epgxmlname, strlen(epgxmlname)); + + readResponse(); + close_connection(); +} + +void CSectionsdClient::setConfig(const epg_config config) +{ + sectionsd::commandSetConfig *msg; + char* pData = new char[sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1 + config.epg_dir.length() + 1]; + msg = (sectionsd::commandSetConfig *)pData; + + msg->scanMode = config.scanMode; + msg->epg_cache = config.epg_cache; + msg->epg_old_events = config.epg_old_events; + msg->epg_max_events = config.epg_max_events; + msg->network_ntprefresh = config.network_ntprefresh; + msg->network_ntpenable = config.network_ntpenable; + msg->epg_extendedcache = config.epg_extendedcache; +// config.network_ntpserver: + strcpy(&pData[sizeof(sectionsd::commandSetConfig)], config.network_ntpserver.c_str()); +// config.epg_dir: + strcpy(&pData[sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1], config.epg_dir.c_str()); + + send(sectionsd::setConfig, (char*)pData, sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1 + config.epg_dir.length() + 1); + readResponse(); + close_connection(); + delete[] pData; +} + +void CSectionsdClient::dumpStatus() +{ + send(sectionsd::dumpStatusinformation); + close_connection(); +} + +#if 0 bool CSectionsdClient::getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags) { if (send(sectionsd::ComponentTagsUniqueKey, (char*)&uniqueKey, sizeof(uniqueKey))) @@ -277,7 +330,6 @@ bool CSectionsdClient::getNVODTimesServiceKey(const t_channel_id channel_id, CSe } } - bool CSectionsdClient::getCurrentNextServiceKey(const t_channel_id channel_id, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next) { if (send(sectionsd::currentNextInformationID, (char*)&channel_id, sizeof(channel_id))) @@ -321,8 +373,6 @@ bool CSectionsdClient::getCurrentNextServiceKey(const t_channel_id channel_id, C } } - - CChannelEventList CSectionsdClient::getChannelEvents(const bool tv_mode, t_channel_id *p_requested_channels, int size_requested_channels) { CChannelEventList eList; @@ -375,8 +425,6 @@ CChannelEventList CSectionsdClient::getChannelEvents(const bool tv_mode, t_chann 3: keyword search in EPG description (INFO2) In case of a match, the EPG event is added to the Eventlist eList. */ -#if 0 -//never used bool CSectionsdClient::getEventsServiceKeySearchAdd(CChannelEventList& eList,const t_channel_id channel_id,char search_typ,std::string& search_text) { int nBufSize=0; @@ -437,7 +485,7 @@ bool CSectionsdClient::getEventsServiceKeySearchAdd(CChannelEventList& eList,con close_connection(); return true; } -#endif + CChannelEventList CSectionsdClient::getEventsServiceKey(const t_channel_id channel_id) { CChannelEventList eList; @@ -481,7 +529,7 @@ CChannelEventList CSectionsdClient::getEventsServiceKey(const t_channel_id chann close_connection(); return eList; } -#if 0 + //never used void showhexdumpa (char *label, unsigned char * from, int len) { @@ -523,7 +571,7 @@ void showhexdumpa (char *label, unsigned char * from, int len) } printf ("\n"); } -#endif + // 21.07.2005 - rainerk // Convert line-terminated extended events to vector of strings char * CSectionsdClient::parseExtendedEvents(char * dp, CEPGData * epgdata) { @@ -617,7 +665,6 @@ bool CSectionsdClient::getActualEPGServiceKey(const t_channel_id channel_id, CEP return false; } - bool CSectionsdClient::getEPGid(const event_id_t eventid, const time_t starttime, CEPGData * epgdata) { sectionsd::commandGetEPGid msg; @@ -673,7 +720,6 @@ bool CSectionsdClient::getEPGid(const event_id_t eventid, const time_t starttime return false; } - bool CSectionsdClient::getEPGidShort(const event_id_t eventid, CShortEPGData * epgdata) { if (send(sectionsd::epgEPGidShort, (char*)&eventid, sizeof(eventid))) @@ -721,57 +767,5 @@ void CSectionsdClient::setPrivatePid(const unsigned short pid) close_connection(); } #endif +#endif -void CSectionsdClient::freeMemory() -{ - send(sectionsd::freeMemory); - - readResponse(); - close_connection(); -} - -void CSectionsdClient::readSIfromXML(const char * epgxmlname) -{ - send(sectionsd::readSIfromXML, (char*) epgxmlname, strlen(epgxmlname)); - - readResponse(); - close_connection(); -} - -void CSectionsdClient::writeSI2XML(const char * epgxmlname) -{ - send(sectionsd::writeSI2XML, (char*) epgxmlname, strlen(epgxmlname)); - - readResponse(); - close_connection(); -} - -void CSectionsdClient::setConfig(const epg_config config) -{ - sectionsd::commandSetConfig *msg; - char* pData = new char[sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1 + config.epg_dir.length() + 1]; - msg = (sectionsd::commandSetConfig *)pData; - - msg->scanMode = config.scanMode; - msg->epg_cache = config.epg_cache; - msg->epg_old_events = config.epg_old_events; - msg->epg_max_events = config.epg_max_events; - msg->network_ntprefresh = config.network_ntprefresh; - msg->network_ntpenable = config.network_ntpenable; - msg->epg_extendedcache = config.epg_extendedcache; -// config.network_ntpserver: - strcpy(&pData[sizeof(sectionsd::commandSetConfig)], config.network_ntpserver.c_str()); -// config.epg_dir: - strcpy(&pData[sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1], config.epg_dir.c_str()); - - send(sectionsd::setConfig, (char*)pData, sizeof(sectionsd::commandSetConfig) + config.network_ntpserver.length() + 1 + config.epg_dir.length() + 1); - readResponse(); - close_connection(); - delete[] pData; -} - -void CSectionsdClient::dumpStatus() -{ - send(sectionsd::dumpStatusinformation); - close_connection(); -} diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 4065ffc2d..3d2d0d438 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -36,13 +36,6 @@ class CShortEPGData std::string title; std::string info1; std::string info2; - - CShortEPGData() - { - title = ""; - info1 = ""; - info2 = ""; - }; }; class CEPGData; @@ -69,7 +62,7 @@ class CSectionsdClient : private CBasicClient int readResponse(char* data = NULL, unsigned int size = 0); bool send(const unsigned char command, const char* data = NULL, const unsigned int size = 0); - char * parseExtendedEvents(char * dp, CEPGData * epgdata); + //char * parseExtendedEvents(char * dp, CEPGData * epgdata); public: virtual ~CSectionsdClient() {}; @@ -86,8 +79,10 @@ class CSectionsdClient : private CBasicClient { EVT_TIMESET, EVT_GOT_CN_EPG, +#if 0 EVT_SERVICES_UPDATE, EVT_BOUQUETS_UPDATE, +#endif EVT_WRITE_SI_FINISHED }; @@ -126,6 +121,10 @@ class CSectionsdClient : private CBasicClient { time_t startzeit; unsigned dauer; + sectionsdTime() { + startzeit = 0; + dauer = 0; + } } __attribute__ ((packed)) ; struct responseGetNVODTimes @@ -165,35 +164,25 @@ class CSectionsdClient : private CBasicClient std::string epg_dir; } epg_config; +#if 0 bool getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); - bool getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); - bool getNVODTimesServiceKey(const t_channel_id channel_id, CSectionsdClient::NVODTimesList& nvod_list); - bool getCurrentNextServiceKey(const t_channel_id channel_id, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next); + CChannelEventList getChannelEvents(const bool tv_mode = true, t_channel_id* = NULL, int size = 0); + CChannelEventList getEventsServiceKey(const t_channel_id channel_id); + bool getEventsServiceKeySearchAdd(CChannelEventList& evtlist,const t_channel_id channel_id,char m_search_typ,std::string& m_search_text); + bool getEPGid(const event_id_t eventid, const time_t starttime, CEPGData * epgdata); + bool getActualEPGServiceKey(const t_channel_id channel_id, CEPGData * epgdata); + bool getEPGidShort(const event_id_t eventid, CShortEPGData * epgdata); + void setPrivatePid(const unsigned short pid); +#endif bool getIsTimeSet(); - void setPauseScanning(const bool doPause); - - bool getIsScanningActive(); - void setServiceChanged(const t_channel_id channel_id, const bool requestEvent); - CChannelEventList getChannelEvents(const bool tv_mode = true, t_channel_id* = NULL, int size = 0); - - CChannelEventList getEventsServiceKey(const t_channel_id channel_id); - - bool getEventsServiceKeySearchAdd(CChannelEventList& evtlist,const t_channel_id channel_id,char m_search_typ,std::string& m_search_text); - - bool getEPGid(const event_id_t eventid, const time_t starttime, CEPGData * epgdata); - - bool getActualEPGServiceKey(const t_channel_id channel_id, CEPGData * epgdata); - - bool getEPGidShort(const event_id_t eventid, CShortEPGData * epgdata); - - void setPrivatePid(const unsigned short pid); + bool getIsScanningActive(); void freeMemory(); @@ -235,15 +224,9 @@ class CEPGData CEPGData() { eventID = 0; - title = ""; - info1 = ""; - info2 = ""; fsk = 0; table_id = 0xff; - contentClassification = ""; - userClassification = ""; }; - }; #endif diff --git a/lib/xmltree/xmlparse.cpp b/lib/xmltree/xmlparse.cpp index d0a531824..f2c2c5fd2 100644 --- a/lib/xmltree/xmlparse.cpp +++ b/lib/xmltree/xmlparse.cpp @@ -43,7 +43,7 @@ ChangeLog: #include #include -#include "xmldef.h" +#include "xmltok/xmldef.h" #ifdef XML_UNICODE #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX diff --git a/lib/xmltree/xmlrole.c b/lib/xmltree/xmlrole.c index 27d5c41ce..23b3a62c4 100644 --- a/lib/xmltree/xmlrole.c +++ b/lib/xmltree/xmlrole.c @@ -18,7 +18,7 @@ James Clark. All Rights Reserved. Contributor(s): */ -#include "xmldef.h" +#include "xmltok/xmldef.h" #include "xmlrole.h" /* Doesn't check: diff --git a/lib/xmltree/xmltok.c b/lib/xmltree/xmltok.c index 4634a0356..989ea638b 100644 --- a/lib/xmltree/xmltok.c +++ b/lib/xmltree/xmltok.c @@ -18,9 +18,9 @@ James Clark. All Rights Reserved. Contributor(s): */ -#include "xmldef.h" +#include "xmltok/xmldef.h" #include "xmltok.h" -#include "nametab.h" +#include "xmltok/nametab.h" #define VTABLE1 \ { PREFIX(prologTok), PREFIX(contentTok), PREFIX(cdataSectionTok) }, \ @@ -265,7 +265,7 @@ static const struct normal_encoding utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "asciitab.h" -#include "utf8tab.h" +#include "xmltok/utf8tab.h" }, NORMAL_VTABLE(utf8_) }; @@ -274,7 +274,7 @@ static const struct normal_encoding internal_utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "iasctab.h" -#include "utf8tab.h" +#include "xmltok/utf8tab.h" }, NORMAL_VTABLE(utf8_) }; @@ -319,7 +319,7 @@ static const struct normal_encoding latin1_encoding = { { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, { #include "asciitab.h" -#include "latin1tab.h" +#include "xmltok/latin1tab.h" }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -490,7 +490,7 @@ static const struct normal_encoding little2_encoding = { }, { #include "asciitab.h" -#include "latin1tab.h" +#include "xmltok/latin1tab.h" }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -501,7 +501,7 @@ static const struct normal_encoding internal_little2_encoding = { { VTABLE, 2, 0, 1 }, { #include "iasctab.h" -#include "latin1tab.h" +#include "xmltok/latin1tab.h" }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -559,7 +559,7 @@ static const struct normal_encoding big2_encoding = { }, { #include "asciitab.h" -#include "latin1tab.h" +#include "xmltok/latin1tab.h" }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index d6659148d..a9f1937a8 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -41,13 +41,14 @@ #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include #include #include #include +#include #define ZAP_GUARD_TIME 2000 // ms @@ -55,11 +56,6 @@ extern CBouquetManager *g_bouquetManager; extern uint32_t scrambled_timer; -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); -void sectionsd_setPrivatePid(unsigned short pid); - CSubService::CSubService(const t_original_network_id anoriginal_network_id, const t_service_id aservice_id, const t_transport_stream_id atransport_stream_id, const std::string &asubservice_name) { service.original_network_id = anoriginal_network_id; @@ -293,8 +289,6 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data { CVFD::getInstance()->showServicename(current_channel_name); // UTF-8 g_Zapit->getPIDS( current_PIDs ); - //g_Sectionsd->setPrivatePid( current_PIDs.PIDs.privatepid ); - sectionsd_setPrivatePid( current_PIDs.PIDs.privatepid ); //tuxtxt #if 1 tuxtxt_stop(); @@ -369,8 +363,7 @@ void CRemoteControl::getSubChannels() if ( subChannels.empty() ) { CSectionsdClient::LinkageDescriptorList linkedServices; - //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) - if ( sectionsd_getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices)) { if ( linkedServices.size()> 1 ) { @@ -403,8 +396,7 @@ void CRemoteControl::getNVODs() if ( subChannels.empty() ) { CSectionsdClient::NVODTimesList NVODs; - //if ( g_Sectionsd->getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) - if ( sectionsd_getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) + if (CEitManager::getInstance()->getNVODTimesServiceKey( current_channel_id, NVODs)) { are_subchannels = false; //printf("CRemoteControl::getNVODs NVODs.size %d\n", NVODs.size()); @@ -534,8 +526,7 @@ void CRemoteControl::processAPIDnames() if ( current_EPGid != 0 ) { CSectionsdClient::ComponentTagList tags; - //if ( g_Sectionsd->getComponentTagsUniqueKey( current_EPGid, tags ) ) - if ( sectionsd_getComponentTagsUniqueKey( current_EPGid, tags ) ) + if (CEitManager::getInstance()->getComponentTagsUniqueKey(current_EPGid, tags)) { has_unresolved_ctags = false; diff --git a/src/driver/audioplay.cpp b/src/driver/audioplay.cpp index 3358043df..3ea3fd4d4 100644 --- a/src/driver/audioplay.cpp +++ b/src/driver/audioplay.cpp @@ -34,7 +34,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include "global.h" +#include #include #include #include diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index ab4a80c3e..b727ef51e 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -38,8 +38,6 @@ #include -#include - #include #include #include diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 2b6303cb2..3a235e3fa 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -101,12 +101,10 @@ #endif #include "netfile.h" -#include "global.h" +#include #include #include #include -#include -#include #include /* TODO: diff --git a/src/driver/pictureviewer/fb_display.cpp b/src/driver/pictureviewer/fb_display.cpp index 469b07815..95b2a9b0e 100644 --- a/src/driver/pictureviewer/fb_display.cpp +++ b/src/driver/pictureviewer/fb_display.cpp @@ -18,7 +18,7 @@ #include #include "fb_display.h" #include "pictureviewer.h" -#include "driver/framebuffer.h" +#include static unsigned char *lfb = 0; diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 39ca3203d..3cef358f1 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -3,7 +3,6 @@ #include #include "pictureviewer.h" #include "pv_config.h" -#include "driver/framebuffer.h" #include #include diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index 094a11217..011fa8bee 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -30,7 +30,7 @@ #include #include /* printf */ #include /* gettimeofday */ -#include "driver/framebuffer.h" +#include class CPictureViewer { struct cformathandler diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 269a4b442..4f2f723e2 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -40,13 +40,15 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include + #include #include @@ -54,6 +56,7 @@ #include #include #include +#include /* TODO: * nextRecording / pending recordings - needs testing @@ -63,11 +66,6 @@ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); - extern "C" { #include } @@ -173,10 +171,10 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) record->Open(); if(!record->Start(fd, (unsigned short ) allpids.PIDs.vpid, (unsigned short *) apids, numpids, channel_id)) { - /* Stop do close fd */ record->Stop(); delete record; record = NULL; + close(fd); unlink(tsfile.c_str()); hintBox.hide(); return RECORD_FAILURE; @@ -217,6 +215,7 @@ bool CRecordInstance::Stop(bool remove_event) printf("%s: channel %llx recording_id %d\n", __FUNCTION__, channel_id, recording_id); SaveXml(); + /* Stop do close fd - if started */ record->Stop(); if(!autoshift) @@ -225,7 +224,7 @@ bool CRecordInstance::Stop(bool remove_event) CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD); if((autoshift && g_settings.auto_delete) /* || autoshift_delete*/) { - snprintf(buf,sizeof(buf), "nice -n 20 rm -f %s.ts &", filename); + snprintf(buf,sizeof(buf), "nice -n 20 rm -f \"%s.ts\" &", filename); system(buf); snprintf(buf,sizeof(buf), "%s.xml", filename); //autoshift_delete = false; @@ -353,7 +352,7 @@ void CRecordInstance::ProcessAPIDnames() if(has_unresolved_ctags && (epgid != 0)) { CSectionsdClient::ComponentTagList tags; - if(sectionsd_getComponentTagsUniqueKey(epgid, tags)) { + if(CEitManager::getInstance()->getComponentTagsUniqueKey(epgid, tags)) { for(unsigned int i=0; i< tags.size(); i++) { for(unsigned int j=0; j< allpids.APIDs.size(); j++) { if(allpids.APIDs[j].component_tag == tags[i].componentTag) { @@ -401,9 +400,7 @@ record_error_msg_t CRecordInstance::Record() { int pre=0, post=0; CEPGData epgData; - epgData.epg_times.startzeit = 0; - epgData.epg_times.dauer = 0; - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData )) { g_Timerd->getRecordingSafety(pre, post); if (epgData.epg_times.startzeit > 0) record_end = epgData.epg_times.startzeit + epgData.epg_times.dauer + post; @@ -508,7 +505,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = "not available"; if (epgid != 0) { CEPGData epgdata; - if (sectionsd_getEPGid(epgid, epg_time, &epgdata)) { + if (CEitManager::getInstance()->getEPGid(epgid, epg_time, &epgdata)) { tmpstring = epgdata.title; info1 = epgdata.info1; info2 = epgdata.info2; @@ -614,7 +611,7 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) if (g_settings.recording_epg_for_filename) { if(epgid != 0) { CShortEPGData epgdata; - if(sectionsd_getEPGidShort(epgid, &epgdata)) { + if(CEitManager::getInstance()->getEPGidShort(epgid, &epgdata)) { if (!(epgdata.title.empty())) { strcpy(&(filename[pos]), epgdata.title.c_str()); ZapitTools::replace_char(&filename[pos]); @@ -803,7 +800,7 @@ bool CRecordManager::Record(const t_channel_id channel_id, const char * dir, boo eventinfo.eventID = 0; eventinfo.channel_id = channel_id; - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData )) { eventinfo.epgID = epgData.eventID; eventinfo.epg_starttime = epgData.epg_times.startzeit; strncpy(eventinfo.epgTitle, epgData.title.c_str(), EPG_TITLE_MAXLEN-1); @@ -894,23 +891,25 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons mutex.unlock(); - if (error_msg == RECORD_OK) { + if (error_msg == RECORD_OK) return true; - } - else if(!timeshift) { - RunStopScript(); - RestoreNeutrino(); - printf("[recordmanager] %s: error code: %d\n", __FUNCTION__, error_msg); + printf("[recordmanager] %s: error code: %d\n", __FUNCTION__, error_msg); + /* RestoreNeutrino must be called always if record start failed */ + RunStopScript(); + RestoreNeutrino(); + + /* FIXME show timeshift start error or not ? */ + //if(!timeshift) + { //FIXME: Use better error message DisplayErrorMessage(g_Locale->getText( error_msg == RECORD_BUSY ? LOCALE_STREAMING_BUSY : error_msg == RECORD_INVALID_DIRECTORY ? LOCALE_STREAMING_DIR_NOT_WRITABLE : LOCALE_STREAMING_WRITE_ERROR )); // UTF-8 - return false; } - return true; + return false; } bool CRecordManager::StartAutoRecord() @@ -1452,7 +1451,7 @@ bool CRecordManager::RunStartScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_START_SCRIPT "."); - if (system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { + if (my_system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1466,7 +1465,7 @@ bool CRecordManager::RunStopScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_ENDED_SCRIPT "."); - if (system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { + if (my_system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/driver/screen_max.cpp b/src/driver/screen_max.cpp index 404fbb50a..601d46206 100644 --- a/src/driver/screen_max.cpp +++ b/src/driver/screen_max.cpp @@ -12,8 +12,8 @@ -#include "global.h" -#include "driver/screen_max.h" +#include +#include // -- this is a simple odd class provided for 'static' usage diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 7aea07577..95a146daf 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -345,8 +346,6 @@ bool CScreenShot::SaveBmp() return true; } -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); /* * create filename member from channel name and its current EPG data, @@ -370,9 +369,9 @@ void CScreenShot::MakeFileName(const t_channel_id channel_id) } pos = strlen(fname); - if(sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData)) { + if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData)) { CShortEPGData epgdata; - if(sectionsd_getEPGidShort(epgData.eventID, &epgdata)) { + if(CEitManager::getInstance()->getEPGidShort(epgData.eventID, &epgdata)) { if (!(epgdata.title.empty())) { strcpy(&(fname[pos]), epgdata.title.c_str()); ZapitTools::replace_char(&fname[pos]); diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index a5534d80d..35f75ea4e 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -36,21 +36,20 @@ #include #include #include -#include #include +#include #if HAVE_COOL_HARDWARE #include #endif -CFrameBuffer * frameBuffer; extern CRemoteControl * g_RemoteControl; extern cAudio * audioDecoder; -static CProgressBar *g_volscale = NULL; CVolume::CVolume() { frameBuffer = CFrameBuffer::getInstance(); + volscale = NULL; #if 0 g_Zapit = new CZapitClient; g_RCInput = new CRCInput; @@ -62,14 +61,15 @@ CVolume::CVolume() ShadowOffset = 4; mute_ay = 0; m_mode = CNeutrinoApp::getInstance()->getMode(); + channel_id = 0; + apid = 0; Init(); } CVolume::~CVolume() { - if (g_volscale) - delete g_volscale; + delete volscale; } void CVolume::Init() @@ -79,7 +79,7 @@ void CVolume::Init() int faktor_h = 18; // scale * 10 int clock_height= 0; int clock_width = 0; - int x_corr = 0; + pB = 2; // progress border spacer = 8; @@ -105,8 +105,9 @@ void CVolume::Init() progress_h = std::max(icon_h, digit_h) - 2*pB; vbar_w += digit_w; } - delete g_volscale; - g_volscale = new CProgressBar(true, progress_w, progress_h, 50, 100, 80, true); + if (volscale) + delete volscale; + volscale = new CProgressBar(true, progress_w, progress_h, 50, 100, 80, true); // mute icon mute_icon_dx = 0; @@ -140,7 +141,8 @@ void CVolume::Init() //printf("\n##### [volume.cpp Zeile %d] mute_ax %d, mute_dx %d\n \n", __LINE__, mute_ax, mute_dx); switch (g_settings.volume_pos) { - case 0:// upper right + case 0:{// upper right + int x_corr = 0; if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { if ((neutrino->isMuted()) && (!g_settings.mode_clock)) x_corr = mute_dx + spacer; @@ -149,6 +151,7 @@ void CVolume::Init() } x = sw - vbar_w - x_corr; break; + } case 1:// upper left break; case 2:// bottom left @@ -212,7 +215,8 @@ void CVolume::AudioMute(int newValue, bool isEvent) void CVolume::setvol(int vol) { - audioDecoder->setVolume(vol, vol); + //audioDecoder->setVolume(vol, vol); + CZapit::getInstance()->SetVolume(vol); } void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowait) @@ -247,7 +251,7 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa // volume icon frameBuffer->paintIcon(NEUTRINO_ICON_VOLUME, icon_x, icon_y, 0, colBar); - g_volscale->reset(); + volscale->reset(); refreshVolumebar(vol); } @@ -353,7 +357,7 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa void CVolume::refreshVolumebar(int current_volume) { // progressbar - g_volscale->paintProgressBar2(progress_x, progress_y, current_volume); + volscale->paintProgressBar2(progress_x, progress_y, current_volume); if (paintDigits) { // shadow for erase digits if (paintShadow) @@ -366,3 +370,21 @@ void CVolume::refreshVolumebar(int current_volume) g_Font[VolumeFont]->RenderString(digit_x, digit_y, digit_w, buff, colContent); } } + +bool CVolume::changeNotify(const neutrino_locale_t OptionName, void * data) +{ + bool ret = false; + if (ARE_LOCALES_EQUAL(OptionName, NONEXISTANT_LOCALE)) { + int percent = *(int *) data; + int vol = CZapit::getInstance()->GetVolume(); + /* keep resulting volume = (vol * percent)/100 not more than 115 */ + if (vol * percent > 11500) + percent = 11500 / vol; + + printf("CVolume::changeNotify: percent %d\n", percent); + CZapit::getInstance()->SetPidVolume(channel_id, apid, percent); + CZapit::getInstance()->SetVolumePercent(percent); + *(int *) data = percent; + } + return ret; +} diff --git a/src/driver/volume.h b/src/driver/volume.h index 797d9ccb1..1acb333b1 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -28,11 +28,15 @@ #ifndef __CVOLUME__ #define __CVOLUME__ +#include + #define ROUNDED g_settings.rounded_corners ? vbar_h/2 : 0 -class CVolume +class CVolume : public CChangeObserver { private: + CFrameBuffer * frameBuffer; + CProgressBar *volscale; void refreshVolumebar(int current_volume); int x, y, sy, sw, sh; @@ -47,12 +51,15 @@ class CVolume int rounded; int m_mode; bool paintShadow, paintDigits, MuteIconFrame; + /* volume adjustment variables */ + t_channel_id channel_id; + int apid; public: CVolume(); ~CVolume(); static CVolume* getInstance(); - + int spacer, mute_dx; void Init(); void AudioMute(int newValue, bool isEvent= false); @@ -60,7 +67,10 @@ class CVolume void setVolume(const neutrino_msg_t key, const bool bDoPaint = true, bool nowait = false); int getStartPosTop(){ return sy; } int getEndPosRight(){ return sw; } + + void SetCurrentPid(int pid) { apid = pid; } + void SetCurrentChannel(t_channel_id id) { channel_id = id; } + bool changeNotify(const neutrino_locale_t OptionName, void *); }; - #endif // __CVOLUME__ diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 493e74b51..7f40b6452 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -60,7 +60,6 @@ #define DEBUG_SECTION_THREADS #define DEBUG_CN_THREAD -static bool sectionsd_ready = false; /*static*/ bool reader_ready = true; static unsigned int max_events; static bool notify_complete = false; @@ -142,7 +141,7 @@ static CFreeSatThread threadFSEIT; CSdtThread threadSDT; #endif -int sectionsd_stop = 0; +static int sectionsd_stop = 0; static bool slow_addevent = true; @@ -1184,24 +1183,12 @@ struct s_cmd_table static s_cmd_table connectionCommands[sectionsd::numberOfCommands] = { { commandDumpStatusInformation, "commandDumpStatusInformation" }, - { sendEmptyResponse, "commandAllEventsChannelIDSearch" }, { commandPauseScanning, "commandPauseScanning" }, { commandGetIsScanningActive, "commandGetIsScanningActive" }, - { sendEmptyResponse, "commandActualEPGchannelID" }, - { sendEmptyResponse, "commandEventListTVids" }, - { sendEmptyResponse, "commandEventListRadioIDs" }, - { sendEmptyResponse, "commandCurrentNextInfoChannelID" }, - { sendEmptyResponse, "commandEPGepgID" }, - { sendEmptyResponse, "commandEPGepgIDshort" }, - { sendEmptyResponse, "commandComponentTagsUniqueKey" }, - { sendEmptyResponse, "commandAllEventsChannelID" }, - { sendEmptyResponse, "commandTimesNVODservice" }, { commandGetIsTimeSet, "commandGetIsTimeSet" }, { commandserviceChanged, "commandserviceChanged" }, - { sendEmptyResponse, "commandLinkageDescriptorsUniqueKey" }, { commandRegisterEventClient, "commandRegisterEventClient" }, { commandUnRegisterEventClient, "commandUnRegisterEventClient" }, - { sendEmptyResponse, "commandSetPrivatePid" }, { commandFreeMemory, "commandFreeMemory" }, { commandReadSIfromXML, "commandReadSIfromXML" }, { commandWriteSI2XML, "commandWriteSI2XML" }, @@ -2107,8 +2094,6 @@ printf("SIevent size: %d\n", sizeof(SIevent)); if (sections_debug) dump_sched_info("main"); - sectionsd_ready = true; - while (running && sectionsd_server.run(sectionsd_parse_command, sectionsd::ACTVERSION, true)) { sched_yield(); if (threadCN.checkUpdate()) { @@ -2170,65 +2155,71 @@ printf("SIevent size: %d\n", sizeof(SIevent)); } /* was: commandAllEventsChannelID sendAllEvents */ -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "") +void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text) { dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey); - if ((serviceUniqueKey& 0xFFFFFFFFFFFFULL) != 0) { //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 - // service Found - readLockEvents(); - int serviceIDfound = 0; + if(!eList.empty() && search == 0)//skip on search mode + eList.clear(); - if (search_text.length()) - std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); - for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) - { - if ((*e)->get_channel_id() == (serviceUniqueKey& 0xFFFFFFFFFFFFULL)) { //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 - serviceIDfound = 1; + t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 + if(serviceUniqueKey64 == 0) + return; - bool copy = true; - if(search == 0); // nothing to do here - else if(search == 1) { - std::string eName = (*e)->getName(); - std::transform(eName.begin(), eName.end(), eName.begin(), tolower); - if(eName.find(search_text) == std::string::npos) - copy = false; - } - else if(search == 2) { - std::string eText = (*e)->getText(); - std::transform(eText.begin(), eText.end(), eText.begin(), tolower); - if(eText.find(search_text) == std::string::npos) - copy = false; - } - else if(search == 3) { - std::string eExtendedText = (*e)->getExtendedText(); - std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); - if(eExtendedText.find(search_text) == std::string::npos) - copy = false; - } + // service Found + readLockEvents(); + int serviceIDfound = 0; - if(copy) { - for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t) - { - CChannelEvent aEvent; - aEvent.eventID = (*e)->uniqueKey(); - aEvent.startTime = t->startzeit; - aEvent.duration = t->dauer; - aEvent.description = (*e)->getName(); - if (((*e)->getText()).empty()) - aEvent.text = (*e)->getExtendedText().substr(0, 120); - else - aEvent.text = (*e)->getText(); - aEvent.channelID = serviceUniqueKey; - eList.push_back(aEvent); - } - } // if = serviceID + if (search_text.length()) + std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); + + for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) + { + if ((*e)->get_channel_id() == serviceUniqueKey64) { + serviceIDfound = 1; + + bool copy = true; + if(search == 0); // nothing to do here + else if(search == 1) { + std::string eName = (*e)->getName(); + std::transform(eName.begin(), eName.end(), eName.begin(), tolower); + if(eName.find(search_text) == std::string::npos) + copy = false; } - else if ( serviceIDfound ) - break; // sind nach serviceID und startzeit sortiert -> nicht weiter suchen + else if(search == 2) { + std::string eText = (*e)->getText(); + std::transform(eText.begin(), eText.end(), eText.begin(), tolower); + if(eText.find(search_text) == std::string::npos) + copy = false; + } + else if(search == 3) { + std::string eExtendedText = (*e)->getExtendedText(); + std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); + if(eExtendedText.find(search_text) == std::string::npos) + copy = false; + } + + if(copy) { + for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t) + { + CChannelEvent aEvent; + aEvent.eventID = (*e)->uniqueKey(); + aEvent.startTime = t->startzeit; + aEvent.duration = t->dauer; + aEvent.description = (*e)->getName(); + if (((*e)->getText()).empty()) + aEvent.text = (*e)->getExtendedText().substr(0, 120); + else + aEvent.text = (*e)->getText(); + aEvent.channelID = serviceUniqueKey; + eList.push_back(aEvent); + } + } // if = serviceID } - unlockEvents(); + else if ( serviceIDfound ) + break; // sind nach serviceID und startzeit sortiert -> nicht weiter suchen } + unlockEvents(); } /* send back the current and next event for the channel id passed to it @@ -2242,7 +2233,7 @@ void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventL * TODO: the handling of "flag" should be vastly simplified. */ /* was: commandCurrentNextInfoChannelID */ -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ) +void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ) { dprintf("[sectionsd] Request of current/next information for " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); @@ -2252,7 +2243,7 @@ void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSections /* ugly hack: retry fetching current/next by restarting dmxCN if this is true */ //bool change = false;//TODO remove ? - //t_channel_id * uniqueServiceKey = (t_channel_id *)data; + uniqueServiceKey &= 0xFFFFFFFFFFFFULL; readLockEvents(); /* if the currently running program is requested... */ @@ -2434,7 +2425,7 @@ void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSections } /* commandEPGepgIDshort */ -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata) +bool CEitManager::getEPGidShort(event_id_t epgID, CShortEPGData * epgdata) { bool ret = false; dprintf("Request of current EPG for 0x%llx\n", epgID); @@ -2459,7 +2450,7 @@ bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata) /*was getEPGid commandEPGepgID(int connfd, char *data, const unsigned dataLength) */ /* TODO item / itemDescription */ -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata) +bool CEitManager::getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata) { bool ret = false; dprintf("Request of actual EPG for 0x%llx 0x%lx\n", epgID, startzeit); @@ -2503,14 +2494,15 @@ bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData return ret; } /* was commandActualEPGchannelID(int connfd, char *data, const unsigned dataLength) */ -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata) +bool CEitManager::getActualEPGServiceKey(const t_channel_id channel_id, CEPGData * epgdata) { bool ret = false; SIevent evt; SItime zeit(0, 0); - dprintf("[commandActualEPGchannelID] Request of current EPG for " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); + dprintf("[commandActualEPGchannelID] Request of current EPG for " PRINTF_CHANNEL_ID_TYPE "\n", channel_id); + t_channel_id uniqueServiceKey = channel_id & 0xFFFFFFFFFFFFULL; readLockEvents(); if (uniqueServiceKey == messaging_current_servicekey) { if (myCurrentEvent) { @@ -2566,23 +2558,20 @@ bool channel_in_requested_list(t_channel_id * clist, t_channel_id chid, int len) { if(len == 0) return true; for(int i = 0; i < len; i++) { - if(clist[i] == chid) + if((clist[i] & 0xFFFFFFFFFFFFULL) == chid) return true; } return false; } /* was static void sendEventList(int connfd, const unsigned char serviceTyp1, const unsigned char serviceTyp2 = 0, int sendServiceName = 1, t_channel_id * chidlist = NULL, int clen = 0) */ -void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = true, t_channel_id *chidlist = NULL, int clen = 0) +void CEitManager::getChannelEvents(CChannelEventList &eList, t_channel_id *chidlist, int clen) { - clen = clen / sizeof(t_channel_id); - t_channel_id uniqueNow = 0; t_channel_id uniqueOld = 0; bool found_already = true; time_t azeit = time(NULL); - if(tv_mode) {} showProfiling("sectionsd_getChannelEvents start"); readLockEvents(); @@ -2632,7 +2621,7 @@ showProfiling("sectionsd_getChannelEvents end"); } /*was static void commandComponentTagsUniqueKey(int connfd, char *data, const unsigned dataLength) */ -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags) +bool CEitManager::getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags) { bool ret = false; dprintf("Request of ComponentTags for 0x%llx\n", uniqueKey); @@ -2662,7 +2651,7 @@ bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdC } /* was static void commandLinkageDescriptorsUniqueKey(int connfd, char *data, const unsigned dataLength) */ -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors) +bool CEitManager::getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors) { bool ret = false; dprintf("Request of LinkageDescriptors for 0x%llx\n", uniqueKey); @@ -2693,11 +2682,12 @@ bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSecti } /* was static void commandTimesNVODservice(int connfd, char *data, const unsigned dataLength) */ -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list) +bool CEitManager::getNVODTimesServiceKey(const t_channel_id channel_id, CSectionsdClient::NVODTimesList& nvod_list) { bool ret = false; - dprintf("Request of NVOD times for " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); + dprintf("Request of NVOD times for " PRINTF_CHANNEL_ID_TYPE "\n", channel_id); + t_channel_id uniqueServiceKey = channel_id & 0xFFFFFFFFFFFFULL; nvod_list.clear(); readLockServices(); @@ -2732,17 +2722,8 @@ bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSect return ret; } -void sectionsd_setPrivatePid(unsigned short /*pid*/) -{ -} - -void sectionsd_set_languages(const std::vector& newLanguages) +void CEitManager::setLanguages(const std::vector& newLanguages) { SIlanguage::setLanguages(newLanguages); SIlanguage::saveLanguages(); } - -bool sectionsd_isReady(void) -{ - return sectionsd_ready; -} diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index b0db88026..2181502f6 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -32,13 +32,6 @@ #include #include #include -#include "dmx.h" - -//#include "SIutils.hpp" -//#include "SIservices.hpp" -//#include "SIevents.hpp" -//#include "SIsections.hpp" -//#include "SIlanguage.hpp" class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex { @@ -61,6 +54,17 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex bool Start(); bool Stop(); void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; }; + + void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); + void getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); + bool getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); + bool getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); + bool getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); + void getChannelEvents(CChannelEventList &eList, t_channel_id *chidlist = NULL, int clen = 0); + bool getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); + bool getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); + bool getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); + void setLanguages(const std::vector& newLanguages); }; #endif diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index e75e74742..cabf99de6 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -40,13 +40,15 @@ #include #include #include +#include +#include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CAudioSetupNotifier * audioSetupNotifier; #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include // // -- AUDIO Selector Menue Handler Class @@ -83,7 +85,7 @@ int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &action return menu_return::RETURN_EXIT; } - if (parent) + if (parent) parent->hide(); return doMenu (); @@ -94,7 +96,7 @@ int CAudioSelectMenuHandler::doMenu () CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width); CSubtitleChangeExec SubtitleChanger; - + //show cancel button if configured in usermenu settings if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL]) AudioSelector.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); @@ -103,34 +105,31 @@ int CAudioSelectMenuHandler::doMenu () unsigned int shortcut_num = 1; + uint p_count = g_RemoteControl->current_PIDs.APIDs.size(); // -- setup menue due to Audio PIDs - if (g_RemoteControl->current_PIDs.APIDs.size() > 1) + for( uint i=0; i < p_count; i++ ) { - uint p_count = g_RemoteControl->current_PIDs.APIDs.size(); - CMenuForwarderNonLocalized* fw[p_count]; - - for( uint i=0; i < p_count; i++ ) - { - char apid[5]; - sprintf(apid, "%d", i); - fw[i] = new CMenuForwarderNonLocalized(g_RemoteControl->current_PIDs.APIDs[i].desc, true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1)); - fw[i]->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); - AudioSelector.addItem(fw[i], (i == g_RemoteControl->current_PIDs.PIDs.selected_apid)); - shortcut_num = i+1; - } - AudioSelector.addItem(GenericMenuSeparatorLine); + char apid[5]; + sprintf(apid, "%d", i); + CMenuForwarderNonLocalized *fw = new CMenuForwarderNonLocalized(g_RemoteControl->current_PIDs.APIDs[i].desc, + true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1)); + fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); + AudioSelector.addItem(fw, (i == g_RemoteControl->current_PIDs.PIDs.selected_apid)); + shortcut_num = i+1; } - + if (p_count) + AudioSelector.addItem(GenericMenuSeparatorLine); + // -- setup menue for to Dual Channel Stereo CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, - &g_settings.audio_AnalogMode, - AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, + &g_settings.audio_AnalogMode, + AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); AudioSelector.addItem( oj ); oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); AudioSelector.addItem( oj ); @@ -140,15 +139,15 @@ int CAudioSelectMenuHandler::doMenu () CZapitChannel * cc = channelList->getChannel(curnum); bool sep_added = false; - if(cc) + if(cc) { - for (int i = 0 ; i < (int)cc->getSubtitleCount() ; ++i) + for (int i = 0 ; i < (int)cc->getSubtitleCount() ; ++i) { CZapitAbsSub* s = cc->getChannelSub(i); if (s->thisSubType == CZapitAbsSub::DVB) { CZapitDVBSub* sd = reinterpret_cast(s); printf("[neutrino] adding DVB subtitle %s pid %x\n", sd->ISO639_language_code.c_str(), sd->pId); - if(!sep_added) + if(!sep_added) { sep_added = true; AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); @@ -160,11 +159,11 @@ int CAudioSelectMenuHandler::doMenu () AudioSelector.addItem(new CMenuForwarderNonLocalized(item /*sd->ISO639_language_code.c_str()*/, sd->pId != dvbsub_getpid(), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num))); } - if (s->thisSubType == CZapitAbsSub::TTX) + if (s->thisSubType == CZapitAbsSub::TTX) { CZapitTTXSub* sd = reinterpret_cast(s); printf("[neutrino] adding TTX subtitle %s pid %x mag %X page %x\n", sd->ISO639_language_code.c_str(), sd->pId, sd->teletext_magazine_number, sd->teletext_page_number); - if(!sep_added) + if(!sep_added) { sep_added = true; AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); @@ -172,17 +171,31 @@ int CAudioSelectMenuHandler::doMenu () char spid[64]; int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; int pid = sd->pId; - snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); + snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); char item[64]; snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); AudioSelector.addItem(new CMenuForwarderNonLocalized(item /*sd->ISO639_language_code.c_str()*/, !tuxtx_subtitle_running(&pid, &page, NULL), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++shortcut_num))); } } - - if(sep_added) + + if(sep_added) AudioSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop)); } + AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); + + /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ + CVolume::getInstance()->SetCurrentChannel(0); + CVolume::getInstance()->SetCurrentPid(0); + int percent[p_count]; + for (uint i=0; i < p_count; i++) { + percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid); + AudioSelector.addItem(new CMenuOptionNumberChooser(NONEXISTANT_LOCALE, &percent[i], + i == g_RemoteControl->current_PIDs.PIDs.selected_apid, + 0, 999, CVolume::getInstance(), 0, 0, NONEXISTANT_LOCALE, + g_RemoteControl->current_PIDs.APIDs[i].desc)); + } + return AudioSelector.exec(NULL, ""); } diff --git a/src/gui/audio_setup.cpp b/src/gui/audio_setup.cpp index 4cf8ee6a5..ec407188b 100644 --- a/src/gui/audio_setup.cpp +++ b/src/gui/audio_setup.cpp @@ -33,7 +33,7 @@ #endif -#include "gui/audio_setup.h" +#include "audio_setup.h" #include #include diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 60359eb71..c16d70b09 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -60,14 +60,13 @@ #include #include -#include #include #include #include #include #include -#include +#include #include #include @@ -145,7 +144,7 @@ void CAudiofileExt::operator=(const CAudiofileExt& src) #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif @@ -319,7 +318,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->setPauseScanning(true); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); - if (system(AUDIOPLAYER_START_SCRIPT) != 0) + if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); show(); @@ -331,7 +330,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_frameBuffer->paintBackground(); puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT "."); - if (system(AUDIOPLAYER_END_SCRIPT) != 0) + if (my_system(AUDIOPLAYER_END_SCRIPT) != 0) perror("Datei " AUDIOPLAYER_END_SCRIPT " fehlt. Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_END_SCRIPT " not found. Please create if needed.\n"); g_Zapit->unlockPlayBack(); diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 07a6c6fc5..92ff2a2bb 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -34,11 +34,11 @@ #define __audioplayergui__ -#include "driver/framebuffer.h" -#include "driver/audiofile.h" -#include "gui/filebrowser.h" -#include "gui/widget/components.h" -#include "gui/widget/menue.h" +#include +#include +#include +#include +#include #include diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index 4dea21a80..5ebee8d9a 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -34,7 +34,7 @@ #endif -#include "gui/audioplayer_setup.h" +#include "audioplayer_setup.h" #include #include @@ -44,8 +44,8 @@ #include #include -#include "gui/audioplayer.h" -#include "gui/filebrowser.h" +#include +#include #include diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 6cfb749f6..157723695 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -35,19 +35,17 @@ #include #include +#include "bouqueteditor_channels.h" +#include "bouqueteditor_bouquets.h" #include #include #include #include -#include #include #include -#include #include -#include "bouqueteditor_channels.h" -#include "bouqueteditor_bouquets.h" extern CBouquetManager *g_bouquetManager; CBEBouquetWidget::CBEBouquetWidget() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 00fa4d5e0..86cf9a28d 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -35,10 +35,7 @@ #include #endif -#include -#include #include - #include "bouqueteditor_channels.h" #include @@ -53,7 +50,6 @@ #include #include -#include extern CBouquetManager *g_bouquetManager; CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bouquet) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index e2f787e44..9eadfe56c 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -35,17 +35,16 @@ #include #include +#include "bouqueteditor_chanselect.h" #include #include #include #include -#include #include #include -#include "bouqueteditor_chanselect.h" extern CBouquetManager *g_bouquetManager; diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index d7f81a167..4da3d7427 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -43,7 +43,6 @@ #include #include -#include #include #include #include diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index c433ffad4..009885b51 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -33,7 +33,6 @@ #include #endif -#include #include #include @@ -353,7 +352,8 @@ int CBouquetList::show(bool bShowChannelList) loop = false; } else if ((msg == CRCInput::RC_timeout ) || - (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)) + (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) || + (msg == CRCInput::RC_favorites) ) { selected = oldselected; if(fader.StartFadeOut()) { diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index ae836ced5..6da597a76 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -22,6 +22,7 @@ #ifdef HAVE_CONFIG_H #include #endif +#include "cam_menu.h" #include #include @@ -31,25 +32,21 @@ #include #include #include -#include #include #include #include #include #include -#include -#include "gui/widget/menue.h" -#include "gui/widget/stringinput.h" -#include "gui/widget/messagebox.h" -#include "gui/widget/hintbox.h" -#include "gui/widget/progresswindow.h" +#include "widget/icons.h" +#include "widget/stringinput.h" +#include "widget/messagebox.h" +#include "widget/progresswindow.h" -#include "system/setting_helpers.h" -#include "system/settings.h" -#include "system/debug.h" +#include +#include +#include -#include #include #include diff --git a/src/gui/cec_setup.cpp b/src/gui/cec_setup.cpp index 605fa262b..edc861b6b 100644 --- a/src/gui/cec_setup.cpp +++ b/src/gui/cec_setup.cpp @@ -31,7 +31,7 @@ #endif -#include "gui/cec_setup.h" +#include "cec_setup.h" #include #include diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 06f6226e1..f7c8b1d57 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -50,16 +50,14 @@ #include #include #include +#include #include #include -#include #include #include #include -#include #include -#include #include #include @@ -73,6 +71,8 @@ #include #include +#include + extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -88,10 +88,6 @@ extern CBouquetList * RADIOallList; extern bool autoshift; extern CBouquetManager *g_bouquetManager; -void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen); -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); - extern int old_b_id; CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) @@ -175,7 +171,7 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) unsigned int count; for (count = from; count < to; count++) { events.clear(); - sectionsd_getEventsServiceKey(chanlist[count]->channel_id, events); + CEitManager::getInstance()->getEventsServiceKey(chanlist[count]->channel_id, events); chanlist[count]->nextEvent.startTime = (long)0x7fffffff; for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) { if ((long)e->startTime > atime && @@ -188,17 +184,16 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) } } else { t_channel_id *p_requested_channels; - int size_requested_channels = chanlist_size * sizeof(t_channel_id); - p_requested_channels = new t_channel_id[size_requested_channels]; + p_requested_channels = new t_channel_id[chanlist_size]; if (! p_requested_channels) { fprintf(stderr,"%s:%d allocation failed!\n", __FUNCTION__, __LINE__); return; } - for (uint32_t count = 0; count < chanlist_size; count++) { - p_requested_channels[count] = chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL; - } + for (uint32_t count = 0; count < chanlist_size; count++) + p_requested_channels[count] = chanlist[count + from]->channel_id; + CChannelEventList levents; - sectionsd_getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); + CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size); for (uint32_t count=0; count < chanlist_size; count++) { chanlist[count]->currentEvent = CChannelEvent(); for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { @@ -1544,7 +1539,7 @@ void CChannelList::paintDetails(int index) char buf[128] = {0}; char cFrom[50] = {0}; // UTF-8 CSectionsdClient::CurrentNextInfo CurrentNext; - sectionsd_getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(chanlist[index]->channel_id, CurrentNext); if (!CurrentNext.next_name.empty()) { struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit); snprintf(cFrom, sizeof(cFrom), "%s %02d:%02d",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min ); @@ -1574,7 +1569,7 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; // Clear - frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height); + frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1); // paint Line if detail info (and not valid list pos) if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") { diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 1f66372f8..e00db49e7 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -52,6 +52,7 @@ #include #include +#include static const int FSHIFT = 16; /* nr of bits of precision */ #define FIXED_1 (1<addTimer(5*1000*1000, false); while (doLoop) { @@ -103,6 +105,9 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) if(fader.Fade()) doLoop = false; } + else if((msg == NeutrinoMessages::EVT_TIMER) && (data == updateTimer)) { + paint(); + } else if ( ( msg == CRCInput::RC_timeout ) || ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_ok ) ) { @@ -143,6 +148,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) hide(); fader.Stop(); + g_RCInput->killTimer(updateTimer); return res; } @@ -371,8 +377,12 @@ void CDBoxInfoWidget::paint() uint64_t bytes_free; if (memory_flag) { - bytes_total = info.totalram; - bytes_free = info.freeram; + //bytes_total = info.totalram; + //bytes_free = info.freeram; + unsigned long t, f; + get_mem_usage(t, f); + bytes_total = t*1024; + bytes_free = f*1024; } else { diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 35bbcaca7..386285bcf 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -290,7 +291,6 @@ bool EpgPlus::ChannelEventEntry::isSelected (time_t selectedTime) const return (selectedTime >= this->channelEvent.startTime) && (selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); } -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) { this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight() @@ -315,7 +315,8 @@ void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) CShortEPGData shortEpgData; - this->footer->paintEventDetails (this->channelEvent.description, sectionsd_getEPGidShort(this->channelEvent.eventID, &shortEpgData) ? shortEpgData.info1 : ""); + bool ret = CEitManager::getInstance()->getEPGidShort(this->channelEvent.eventID, &shortEpgData); + this->footer->paintEventDetails (this->channelEvent.description, ret ? shortEpgData.info1 : ""); this->timeLine->paintGrid(); } @@ -522,8 +523,6 @@ EpgPlus::~EpgPlus() this->free(); } -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); - void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) { for (TChannelEntries::iterator It = this->displayedChannelEntries.begin(); @@ -557,9 +556,8 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) ChannelEntry *channelEntry = new ChannelEntry (channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX + 2, yPosChannelEntry, this->channelsTableWidth); //printf("Going to get getEventsServiceKey for %llx\n", (channel->channel_id & 0xFFFFFFFFFFFFULL)); - //CChannelEventList channelEventList = g_Sectionsd->getEventsServiceKey (channel->channel->channel_id & 0xFFFFFFFFFFFFULL); CChannelEventList channelEventList; - sectionsd_getEventsServiceKey(channel->channel_id, channelEventList); + CEitManager::getInstance()->getEventsServiceKey(channel->channel_id, channelEventList); //printf("channelEventList size %d\n", channelEventList.size()); int xPosEventEntry = this->eventsTableX; diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 45adfb0ae..b03aed939 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -35,7 +35,6 @@ #include #include -#include #include #include "color.h" diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 40f6616be..919a869d1 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -55,6 +55,7 @@ #include #include +#include extern CPictureViewer * g_PicViewer; @@ -445,9 +446,6 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) return a.startTime< b.startTime; } -//extern char recDir[255]; -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop ) { int res = menu_return::RETURN_REPAINT; @@ -470,9 +468,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } bigFonts = g_settings.bigFonts; start(); - //evtlist = g_Sectionsd->getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL); - evtlist.clear(); - sectionsd_getEventsServiceKey(channel_id, evtlist); + CEitManager::getInstance()->getEventsServiceKey(channel_id, evtlist); // Houdini added for Private Premiere EPG start sorted by start date/time 2005-08-15 sort(evtlist.begin(),evtlist.end(),sortByDateTime); } @@ -640,7 +636,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int dummy_h,dummy_w; frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); if (dummy_h == 16 && dummy_w == 26){ // show only standard icon size - if ( sectionsd_getComponentTagsUniqueKey( epgData.eventID, tags ) ) + if (CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -941,9 +937,6 @@ void CEpgData::hide() showTimerEventBar (false); } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); - void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear ) { if(clear) @@ -953,11 +946,9 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* st bool res; if ( id!= 0 ) - //res = g_Sectionsd->getEPGid( id, *startzeit, &epgData ); - res = sectionsd_getEPGid(id, *startzeit, &epgData); + res = CEitManager::getInstance()->getEPGid(id, *startzeit, &epgData); else - //res = g_Sectionsd->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); - res = sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); + res = CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData ); if ( res ) { @@ -1057,7 +1048,6 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st char tmpstr[256]={0}; screening_dates = screening_nodual = ""; - // alredy read: evtlist = g_Sectionsd->getEventsServiceKey( channel_id&0xFFFFFFFFFFFFULL ); for (e = followlist.begin(); e != followlist.end(); ++e) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 496f545cf..f0f2f5d21 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -48,7 +48,7 @@ #include "widget/hintbox.h" #include "widget/buttons.h" -#include "gui/bouquetlist.h" +#include "bouquetlist.h" #include #include @@ -57,6 +57,7 @@ #include #include #include +#include #include @@ -65,10 +66,6 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); - #if 0 // sort operators bool sortById (const CChannelEvent& a, const CChannelEvent& b) @@ -151,9 +148,7 @@ bool CNeutrinoEventList::HasTimerConflicts(time_t starttime, time_t duration, ev void CNeutrinoEventList::readEvents(const t_channel_id channel_id) { - //evtlist = g_Sectionsd->getEventsServiceKey(channel_id &0xFFFFFFFFFFFFULL); - evtlist.clear(); - sectionsd_getEventsServiceKey(channel_id , evtlist); + CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); time_t azeit=time(NULL); CChannelEventList::iterator e; @@ -161,14 +156,12 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) CEPGData epgData; // todo: what if there are more than one events in the Portal - //if (g_Sectionsd->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) - if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData )) { // epgData.eventID; // epgData.epg_times.startzeit; CSectionsdClient::LinkageDescriptorList linkedServices; - //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) - if ( sectionsd_getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey( epgData.eventID, linkedServices ) ) { if ( linkedServices.size()> 1 ) { @@ -193,9 +186,7 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) // do not add parent events if (channel_id != channel_id2) { - //evtlist2 = g_Sectionsd->getEventsServiceKey(channel_id2); - evtlist2.clear(); - sectionsd_getEventsServiceKey(channel_id2 , evtlist2); + CEitManager::getInstance()->getEventsServiceKey(channel_id2 , evtlist2); for (unsigned int loop=0 ; loopgetEventsServiceKeySearchAdd(evtlist,m_search_channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(m_search_channel_id, evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(m_search_channel_id, evtlist, m_search_epg_item,m_search_keyword); } else if(m_search_list == SEARCH_LIST_BOUQUET) { @@ -1035,8 +1026,7 @@ bool CNeutrinoEventList::findEvents(void) for(int channel = 0; channel < channel_nr; channel++) { channel_id = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id; - //g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(channel_id, evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(channel_id, evtlist, m_search_epg_item,m_search_keyword); } } else if(m_search_list == SEARCH_LIST_ALL) @@ -1050,8 +1040,7 @@ bool CNeutrinoEventList::findEvents(void) for(int channel = 0; channel < channel_nr; channel++) { channel_id = bouquetList->Bouquets[bouquet]->channelList->getChannelFromIndex(channel)->channel_id; - //g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id & 0xFFFFFFFFFFFFULL,m_search_epg_item,m_search_keyword); - sectionsd_getEventsServiceKey(channel_id,evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(channel_id,evtlist, m_search_epg_item,m_search_keyword); } } box.hide(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 9bfc94f0e..4e7f07f1f 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -58,10 +58,10 @@ #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif - +#include #include #ifdef __USE_FILE_OFFSET64 diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 178c56192..88b618954 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -48,18 +48,18 @@ #include #include #include +#include "hdd_menu.h" #include -#include "gui/widget/stringinput.h" -#include "gui/widget/messagebox.h" -#include "gui/widget/hintbox.h" -#include "gui/widget/progresswindow.h" +#include +#include +#include +#include -#include "system/setting_helpers.h" -#include "system/settings.h" -#include "system/debug.h" +#include +#include +#include -#include #include #include diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index ea5ffd0c7..bb8470a48 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -34,9 +34,9 @@ #include #include -#include "gui/info_menue.h" -#include "gui/imageinfo.h" -#include "gui/dboxinfo.h" +#include +#include +#include #include #include diff --git a/src/gui/infoclock.h b/src/gui/infoclock.h index a03abf2a6..73b4ebb93 100644 --- a/src/gui/infoclock.h +++ b/src/gui/infoclock.h @@ -6,7 +6,7 @@ #include #include -#include "gui/color.h" +#include #include diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 595044fc6..0b6883847 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -32,7 +32,8 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include "infoviewer.h" + #include #include @@ -48,7 +49,6 @@ #include #include -#include #include #include #include @@ -62,11 +62,9 @@ #include #include #include +#include #include -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); - extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -386,8 +384,7 @@ void CInfoViewer::paintBackground(int col_NumBox) void CInfoViewer::show_current_next(bool new_chan, int epgpos) { - //info_CurrentNext = getEPG (channel_id); - sectionsd_getCurrentNextServiceKey(channel_id & 0xFFFFFFFFFFFFULL, info_CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(channel_id, info_CurrentNext); if (!evtlist.empty()) { if (new_chan) { for ( eli=evtlist.begin(); eli!=evtlist.end(); ++eli ) { @@ -600,9 +597,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con col_NumBoxText = COL_MENUHEAD; } if ((channel_id != new_channel_id) || (evtlist.empty())) { - evtlist.clear(); - //evtlist = g_Sectionsd->getEventsServiceKey(new_channel_id & 0xFFFFFFFFFFFFULL); - sectionsd_getEventsServiceKey(new_channel_id, evtlist); + CEitManager::getInstance()->getEventsServiceKey(new_channel_id, evtlist); if (!evtlist.empty()) sort(evtlist.begin(),evtlist.end(), sortByDateTime); new_chan = true; @@ -1157,7 +1152,8 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) infoViewerBB->showIcon_SubT(); //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); - infoViewerBB->showIcon_Tuner(); + if (CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_SINGLE) + infoViewerBB->showIcon_Tuner(); } } return messages_return::handled; @@ -1270,8 +1266,7 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch { static CSectionsdClient::CurrentNextInfo oldinfo; - //g_Sectionsd->getCurrentNextServiceKey (for_channel_id & 0xFFFFFFFFFFFFULL, info); - sectionsd_getCurrentNextServiceKey(for_channel_id & 0xFFFFFFFFFFFFULL, info); + CEitManager::getInstance()->getCurrentNextServiceKey(for_channel_id, info); //printf("CInfoViewer::getEPG: old uniqueKey %llx new %llx\n", oldinfo.current_uniqueKey, info.current_uniqueKey); @@ -1364,7 +1359,8 @@ void CInfoViewer::showSNR () g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR); } } - infoViewerBB->showSysfsHdd(); + if(showButtonBar) + infoViewerBB->showSysfsHdd(); } void CInfoViewer::display_Info(const char *current, const char *next, diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 1d0f8a193..d106d0f98 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -32,7 +32,8 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include "infoviewer_bb.h" + #include #include @@ -49,13 +50,12 @@ #include #include -#include #include #include #include #include #include - +#include #include #include @@ -86,6 +86,8 @@ CInfoViewerBB::CInfoViewerBB() pthread_detach(scrambledT); } #endif + hddperT = 0; + hddperTflag = false; Init(); } @@ -117,6 +119,10 @@ CInfoViewerBB::~CInfoViewerBB() pthread_cancel(scrambledT); scrambledT = 0; } + if(hddperT) { + pthread_cancel(hddperT); + hddperT = 0; + } } CInfoViewerBB* CInfoViewerBB::getInstance() @@ -180,8 +186,10 @@ void CInfoViewerBB::getBBIconInfo() iconView = checkBBIcon(NEUTRINO_ICON_SCRAMBLED2, &w, &h); break; case CInfoViewerBB::ICON_TUNER: - if (g_settings.infobar_show_tuner == 1) { - iconView = checkBBIcon(NEUTRINO_ICON_TUNER_1, &w, &h); + if (CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_SINGLE) { + if (g_settings.infobar_show_tuner == 1) { + iconView = checkBBIcon(NEUTRINO_ICON_TUNER_1, &w, &h); + } } break; default: @@ -587,28 +595,54 @@ void CInfoViewerBB::showIcon_Tuner() void CInfoViewerBB::showSysfsHdd() { - if ((g_settings.infobar_show_sysfs_hdd) && (is_visible)) { - long blocks_used; - struct statfs s; - int per = 0; - if (::statfs("/", &s) == 0 && s.f_blocks) { -// per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); - blocks_used = s.f_blocks - s.f_bfree; - per = (blocks_used * 100ULL) / s.f_blocks; + if (g_settings.infobar_show_sysfs_hdd) { + //sysFS info + int sysper = 0; + sysper = get_fs_usage("/"); + showBarSys(sysper); + +#if 0 + //HDD info in a seperate thread + if(!hddperTflag) { + hddperTflag=true; + pthread_create(&hddperT, NULL, hddperThread, (void*) this); + pthread_detach(hddperT); } - varscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth , 6, per, 100); - per = 0; - //HD info - if(!check_dir(g_settings.network_nfs_recordingdir)){ - if (::statfs(g_settings.network_nfs_recordingdir, &s) == 0 && s.f_blocks) { - blocks_used = s.f_blocks - s.f_bfree; - per = (blocks_used * 100ULL) / s.f_blocks; - } +#else + if (!check_dir(g_settings.network_nfs_recordingdir)) { + sysper = get_fs_usage(g_settings.network_nfs_recordingdir); + showBarHdd(sysper); } - hddscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2, hddwidth, 6, per, 100); +#endif } } +void* CInfoViewerBB::hddperThread(void *arg) +{ + CInfoViewerBB *infoViewerBB = (CInfoViewerBB*) arg; + + int hddper = 0; + hddper = get_fs_usage(g_settings.network_nfs_recordingdir); + infoViewerBB->showBarHdd(hddper); + + infoViewerBB->hddperTflag=false; + pthread_exit(NULL); +} + +void CInfoViewerBB::showBarSys(int percent) +{ + if (is_visible) + varscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6, percent, 100); +} + +void CInfoViewerBB::showBarHdd(int percent) +{ + if (percent < 0) + percent = 0; + if (is_visible) + hddscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6, percent, 100); +} + void CInfoViewerBB::paint_ca_icons(int caid, char * icon, int &icon_space_offset) { char buf[20]; diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index b41c0afcd..84353c6b9 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -42,7 +42,6 @@ #include #include "widget/menue.h" #include -#include #include class CInfoViewerBB @@ -122,6 +121,13 @@ class CInfoViewerBB static void* scrambledThread(void *arg); void scrambledCheck(bool force=false); + void showBarSys(int percent = 0); + void showBarHdd(int percent = 0); + + pthread_t hddperT; + static void* hddperThread(void *arg); + bool hddperTflag; + public: CInfoViewerBB(); ~CInfoViewerBB(); diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index ae783f70e..608046f6c 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -47,7 +47,7 @@ #endif #endif -#include "gui/keybind_setup.h" +#include "keybind_setup.h" #include #include @@ -58,7 +58,7 @@ #include #include -#include "gui/filebrowser.h" +#include #include #include diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index dd4422e0e..30172d0f5 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -31,17 +31,17 @@ #endif -#include "gui/mediaplayer.h" +#include "mediaplayer.h" #include #include #include #include -#include "gui/movieplayer.h" -#include "gui/pictureviewer.h" +#include +#include #if ENABLE_UPNP -#include "gui/upnpbrowser.h" +#include #endif #include diff --git a/src/gui/mediaplayer.h b/src/gui/mediaplayer.h index d2cfe042e..a52199d8b 100644 --- a/src/gui/mediaplayer.h +++ b/src/gui/mediaplayer.h @@ -30,8 +30,8 @@ #define __MEDIAPLAYER__ #include -#include "gui/audioplayer.h" -#include "gui/personalize.h" +#include +#include #include diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index fe48d6646..f10df62d7 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -35,17 +35,17 @@ #endif -#include "gui/mediaplayer_setup.h" +#include "mediaplayer_setup.h" #include #include #include -#include "gui/widget/stringinput.h" +#include -#include "gui/audioplayer_setup.h" -#include "gui/pictureviewer_setup.h" +#include +#include #include diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 01ec9cfb6..bc05e028c 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -35,13 +35,13 @@ #include #include -#include "gui/miscsettings_menu.h" -#include "gui/cec_setup.h" -#include "gui/filebrowser.h" -#include "gui/keybind_setup.h" -#include "gui/plugins.h" -#include "gui/sleeptimer.h" -#include "gui/zapit_setup.h" +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 888d91915..84e4e72b5 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -32,7 +32,6 @@ #include #include -#include "gui/widget/menue.h" //#define CPU_FREQ diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 6c42ab6d4..8b43f99f5 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -36,7 +36,7 @@ #include #include #include -#include "gui/scan_setup.h" +#include #include #include #include diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 219d90c2f..6f14c3d2c 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -47,27 +47,29 @@ #include #endif +#include + #include #include #include "moviebrowser.h" #include "filebrowser.h" -#include "widget/hintbox.h" -#include "widget/helpbox.h" -#include "widget/messagebox.h" -#include "widget/stringinput_ext.h" +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include "neutrino.h" +#include #include // for statfs #include #include #include -#include -#include #include #include -#include #include extern CPictureViewer * g_PicViewer; @@ -3946,7 +3948,7 @@ static off64_t cut_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) char spart[255]; char dpart[255]; char npart[255]; - unsigned char * buf; + unsigned char psi[PSI_SIZE]; int r, i; off64_t sdone, spos; @@ -3963,9 +3965,9 @@ static off64_t cut_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) time_t tt1; off64_t bpos, bskip; - buf = (unsigned char *) malloc(BUF_SIZE); + unsigned char * buf = new unsigned char[BUF_SIZE]; if(buf == 0) { - perror("malloc"); + perror("new"); return 0; } @@ -4017,7 +4019,10 @@ printf("cut: end bookmark %d at %lld\n", bcount, books[bcount].pos); bcount++; } printf("\n"); - if(!bcount) return 0; + if(!bcount){ + delete [] buf; + return 0; + } qsort(books, bcount, sizeof(struct mybook), compare_book); for(i = 0; i < bcount; i++) { if(books[i].ok) { @@ -4049,6 +4054,7 @@ printf("\n********* new file %s expected size %lld, start time %s", dpart, newsi dstfd = open (dpart, O_CREAT|O_WRONLY|O_TRUNC| O_LARGEFILE, 0644); if(dstfd < 0) { perror(dpart); + delete [] buf; return 0; } part = 0; @@ -4177,7 +4183,7 @@ printf("********* total written %lld tooks %ld secs end time %s", spos, tt1-tt, lseek64 (dstfd, 0, SEEK_SET); ret_err: close(dstfd); - free(buf); + delete [] buf; if(was_cancel) g_RCInput->postMsg(CRCInput::RC_home, 0); return retval; @@ -4193,7 +4199,6 @@ static off64_t copy_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi char spart[255]; char dpart[255]; char npart[255]; - unsigned char * buf; unsigned char psi[PSI_SIZE]; int r, i; off64_t sdone, spos = 0, btotal = 0; @@ -4207,9 +4212,9 @@ static off64_t copy_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi bool was_cancel = false; int retval = 0; - buf = (unsigned char *) malloc(BUF_SIZE); + unsigned char * buf = new unsigned char[BUF_SIZE]; if(buf == 0) { - perror("malloc"); + perror("new"); return 0; } @@ -4245,8 +4250,10 @@ printf("copy: jump bookmark %d at %lld len %lld\n", bcount, books[bcount].pos, b bcount++; } } - if(!bcount) return 0; - + if(!bcount){ + delete [] buf; + return 0; + } tt = time(0); printf("********* %d boormarks, to %s file(s), expected size to copy %lld, start time %s", bcount, onefile ? "one" : "many", newsize, ctime (&tt)); snprintf(npart, sizeof(npart), "%s", name); @@ -4387,7 +4394,7 @@ printf("copy: ********* %s: total written %lld took %ld secs\n", dpart, spos, tt } retval = 1; ret_err: - free(buf); + delete [] buf; if(was_cancel) g_RCInput->postMsg(CRCInput::RC_home, 0); return retval; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 1f1bcf637..a18f19fe3 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -73,13 +73,13 @@ #include #include -#include "gui/widget/listframe.h" -#include "gui/widget/menue.h" -#include "gui/widget/textbox.h" -#include "gui/movieinfo.h" -#include "driver/file.h" +#include +#include +#include +#include +#include #include -#include "driver/pictureviewer/pictureviewer.h" +#include #define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items) #define MOVIEBROWSER_SETTINGS_FILE CONFIGDIR "/moviebrowser.conf" diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index e5c4f0912..004a573bc 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -46,6 +46,8 @@ #include #endif +#include + #include #include #include @@ -608,7 +610,7 @@ int find_next_char(char to_find, char *text, int start_pos, int end_pos) _pos_ += sizeof(_tag_) ;\ int pos_prev = _pos_;\ while(_pos_ < bytes && _text_[_pos_] != '<' ) pos++;\ - _dest_ = atoll(&_text_[pos_prev]);\ + _dest_ = strtoull(&_text_[pos_prev], NULL, 10); /*atoll(&_text_[pos_prev]);*/\ continue;\ } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 373e2e031..d2b299c5b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -32,21 +32,20 @@ #include #include -#include #include -#include #include #include #include #include +#include +#include #include -#include #include #include #include -#include "libtuxtxt/teletext.h" +#include #include #include #include @@ -177,7 +176,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) startposition = 0; puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT "."); - if (system(MOVIEPLAYER_START_SCRIPT) != 0) + if (my_system(MOVIEPLAYER_START_SCRIPT) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -215,7 +214,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager->flush(); puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT "."); - if (system(MOVIEPLAYER_END_SCRIPT) != 0) + if (my_system(MOVIEPLAYER_END_SCRIPT) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); @@ -302,7 +301,7 @@ bool CMoviePlayerGui::SelectFile() printf("CMoviePlayerGui::SelectFile: isBookmark %d timeshift %d isMovieBrowser %d\n", isBookmark, timeshift, isMovieBrowser); if (has_hdd) - system("(rm /hdd/.wakeup; touch /hdd/.wakeup; sync) > /dev/null 2> /dev/null &"); + wakeup_hdd(g_settings.network_nfs_recordingdir); if (timeshift) { t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -422,8 +421,11 @@ void CMoviePlayerGui::PlayFile(void) printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); - if(p_movie_info != NULL) + if(p_movie_info != NULL) { duration = p_movie_info->length * 60 * 1000; + int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); + CZapit::getInstance()->SetVolumePercent(percent); + } file_prozent = 0; if(!playback->Start((char *) full_name.c_str(), vpid, vtype, currentapid, currentac3, duration)) { @@ -787,6 +789,21 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) APIDSelector.addItem(item, defpid); } + if (p_movie_info) { + APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); + + CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); + CVolume::getInstance()->SetCurrentPid(currentapid); + int percent[numpida]; + for (uint i=0; i < numpida; i++) { + percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); + 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)); + } + } + APIDSelector.exec(NULL, ""); delete selector; printf("CMoviePlayerGui::selectAudioPid: selected %d (%x) current %x\n", select, (select >= 0) ? apids[select] : -1, currentapid); @@ -979,13 +996,13 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int position) #define BOOKMARK_START_MENU_MAX_ITEMS 6 CSelectedMenu cSelectedMenuBookStart[BOOKMARK_START_MENU_MAX_ITEMS]; - CMenuWidget bookStartMenu(LOCALE_MOVIEBROWSER_BOOK_NEW, NEUTRINO_ICON_STREAMING); + CMenuWidget bookStartMenu(LOCALE_MOVIEBROWSER_BOOK_ADD, NEUTRINO_ICON_STREAMING); bookStartMenu.addIntroItems(); #if 0 // not supported, TODO bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEPLAYER_HEAD, !isMovieBrowser, NULL, &cSelectedMenuBookStart[0])); bookStartMenu.addItem(GenericMenuSeparatorLine); #endif - bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, isMovieBrowser, NULL, &cSelectedMenuBookStart[1])); + bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_NEW, isMovieBrowser, NULL, &cSelectedMenuBookStart[1])); bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_TYPE_FORWARD, isMovieBrowser, NULL, &cSelectedMenuBookStart[2])); bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_TYPE_BACKWARD, isMovieBrowser, NULL, &cSelectedMenuBookStart[3])); bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIESTART, isMovieBrowser, NULL, &cSelectedMenuBookStart[4])); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 2afd1a8b6..1ede8b215 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -34,12 +34,12 @@ #include #include -#include "driver/framebuffer.h" -#include "gui/filebrowser.h" -#include "gui/bookmarkmanager.h" -#include "gui/widget/menue.h" -#include "gui/moviebrowser.h" -#include "gui/movieinfo.h" +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index 6585c919c..450c49953 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -28,8 +28,8 @@ #include #include -#include "gui/network_service.h" -#include "mymenu.h" +#include "network_service.h" +#include #include diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index 97e5c879b..f3f6083e2 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -34,9 +34,9 @@ #include -#include "gui/network_setup.h" -#include "gui/proxyserver_setup.h" -#include "gui/nfs.h" +#include "network_setup.h" +#include +#include #include #include diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f00c98c38..610642622 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -33,6 +33,10 @@ #include #endif +#include +#include +#include +#include #include "osd_setup.h" #include "themes.h" @@ -40,11 +44,6 @@ #include "osdlang_setup.h" #include "filebrowser.h" -#include -#include -#include -#include - #include #include #include @@ -53,6 +52,7 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; @@ -434,7 +434,7 @@ int COsdSetup::showOsdSetup() //screenshot CMenuWidget osd_menu_screenshot(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT); - showOsdScreenshottSetup(&osd_menu_screenshot); + showOsdScreenShotSetup(&osd_menu_screenshot); mf = new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, &osd_menu_screenshot, NULL, CRCInput::RC_3); mf->setHint("", LOCALE_MENU_HINT_SCREENSHOT_SETUP); osd_menu->addItem(mf); @@ -762,7 +762,16 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(mc); // tuner icon - mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, &g_settings.infobar_show_tuner, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + bool mc_active = false; + int show_tuner_icon = 0; + // show possible option if we in single box mode, but don't touch the real settings + int *p_show_tuner_icon = &show_tuner_icon; + if (CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_SINGLE){ + mc_active = true; + // use the real value of g_settings.infobar_show_tuner + p_show_tuner_icon = &g_settings.infobar_show_tuner; + } + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, p_show_tuner_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, mc_active); mc->setHint("", LOCALE_MENU_HINT_INFOBAR_TUNER); menu_infobar->addItem(mc); @@ -923,7 +932,7 @@ const CMenuOptionChooser::keyval SCREENSHOT_OPTIONS[SCREENSHOT_OPTION_COUNT] = { 1, LOCALE_SCREENSHOT_OSD } }; -void COsdSetup::showOsdScreenshottSetup(CMenuWidget *menu_screenshot) +void COsdSetup::showOsdScreenShotSetup(CMenuWidget *menu_screenshot) { menu_screenshot->addIntroItems(LOCALE_SCREENSHOT_MENU); if((uint)g_settings.key_screenshot == CRCInput::RC_nokey) diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 7690f41c9..65429d9dc 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -56,7 +56,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver void showOsdTimeoutSetup(CMenuWidget *menu_timeout); void showOsdInfobarSetup(CMenuWidget *menu_infobar); void showOsdChanlistSetup(CMenuWidget *menu_chanlist); - void showOsdScreenshottSetup(CMenuWidget *menu_screenshot); + void showOsdScreenShotSetup(CMenuWidget *menu_screenshot); void AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry); diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index 5e07e270c..7aec3d37d 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -50,6 +50,7 @@ #include #include +#include @@ -240,8 +241,6 @@ bool COsdLangSetup::changeNotify(const neutrino_locale_t, void *) return true; } -void sectionsd_set_languages(const std::vector& newLanguages); - bool CLangSelectNotifier::changeNotify(const neutrino_locale_t, void *) { std::vector v_languages; @@ -267,8 +266,7 @@ bool CLangSelectNotifier::changeNotify(const neutrino_locale_t, void *) } } } - //if(found) - sectionsd_set_languages(v_languages); + CEitManager::getInstance()->setLanguages(v_languages); return false; } diff --git a/src/gui/parentallock_setup.cpp b/src/gui/parentallock_setup.cpp index 8a7d867a1..364dd9423 100644 --- a/src/gui/parentallock_setup.cpp +++ b/src/gui/parentallock_setup.cpp @@ -34,7 +34,7 @@ #endif -#include "gui/parentallock_setup.h" +#include "parentallock_setup.h" #include #include diff --git a/src/gui/personalize.h b/src/gui/personalize.h index 3c9c8a242..c9c7b4c2e 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -52,8 +52,8 @@ #define __personalize__ #include -#include "gui/plugins.h" -#include "gui/user_menue_setup.h" +#include +#include #include "widget/stringinput.h" #include "widget/stringinput_ext.h" #include diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index dda45557e..2a72c7728 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -33,10 +33,10 @@ #define __pictureviewergui__ -#include "driver/framebuffer.h" -#include "driver/pictureviewer/pictureviewer.h" -#include "gui/widget/menue.h" -#include "gui/filebrowser.h" +#include +#include +#include +#include #include diff --git a/src/gui/pictureviewer_setup.cpp b/src/gui/pictureviewer_setup.cpp index 601638c6b..6dd9be459 100644 --- a/src/gui/pictureviewer_setup.cpp +++ b/src/gui/pictureviewer_setup.cpp @@ -33,7 +33,7 @@ #include #endif -#include "gui/pictureviewer_setup.h" +#include "pictureviewer_setup.h" #include #include @@ -43,8 +43,8 @@ #include #include -#include "gui/pictureviewer.h" -#include "gui/filebrowser.h" +#include +#include #include diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index de8b7fbb0..80836e7a1 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -47,10 +47,16 @@ #include #include #include +#include +#include +#include +#include #include #include +#include + #include #include "plugins.h" @@ -91,18 +97,6 @@ int CPlugins::find_plugin(const std::string & filename) return -1; } -bool CPlugins::pluginfile_exists(const std::string & filename) -{ - struct stat stat_buf; - if(::stat(filename.c_str(), &stat_buf) == 0) - { - return true; - } else - { - return false; - } -} - void CPlugins::scanDir(const char *dir) { struct dirent **namelist; @@ -319,13 +313,14 @@ void CPlugins::startScriptPlugin(int number) { const char *script = plugin_list[number].pluginfile.c_str(); printf("[CPlugins] executing script %s\n",script); - if (!pluginfile_exists(plugin_list[number].pluginfile)) + if (!file_exists(script)) { printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n", script, plugin_list[number].cfgfile.c_str()); return; } - FILE *f = popen(script,"r"); + pid_t pid = 0; + FILE *f = my_popen(pid,script,"r"); if (f != NULL) { char *output=NULL; @@ -336,6 +331,9 @@ void CPlugins::startScriptPlugin(int number) scriptOutput += output; } pclose(f); + int s; + while (waitpid(pid,&s,WNOHANG)>0); + kill(pid,SIGTERM); if(output) free(output); } @@ -345,7 +343,6 @@ void CPlugins::startScriptPlugin(int number) } } -int mysystem(const char * cmd,const char * arg1,const char * arg2); void CPlugins::startPlugin(int number,int /*param*/) { // always delete old output @@ -371,7 +368,7 @@ void CPlugins::startPlugin(int number,int /*param*/) startScriptPlugin(number); return; } - if (!pluginfile_exists(plugin_list[number].pluginfile)) + if (!file_exists(plugin_list[number].pluginfile.c_str())) { printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n", plugin_list[number].pluginfile.c_str(), plugin_list[number].cfgfile.c_str()); @@ -592,7 +589,7 @@ void CPlugins::startPlugin(int number,int /*param*/) g_RCInput->stopInput(); //frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t)); printf("Starting %s\n", plugin_list[number].pluginfile.c_str()); - mysystem(plugin_list[number].pluginfile.c_str(), NULL, NULL); + my_system(plugin_list[number].pluginfile.c_str(), NULL, NULL); //frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t)); frameBuffer->paintBackground(); g_RCInput->restartInput(); diff --git a/src/gui/plugins.h b/src/gui/plugins.h index 9fab562b2..f37cc0704 100644 --- a/src/gui/plugins.h +++ b/src/gui/plugins.h @@ -97,7 +97,6 @@ class CPlugins void scanDir(const char *dir); bool plugin_exists(const std::string & filename); int find_plugin(const std::string & filename); - bool pluginfile_exists(const std::string & filename); CPlugins::p_type_t getPluginType(int type); public: CPlugins(); diff --git a/src/gui/proxyserver_setup.cpp b/src/gui/proxyserver_setup.cpp index 38c8990b3..b4600e7f0 100644 --- a/src/gui/proxyserver_setup.cpp +++ b/src/gui/proxyserver_setup.cpp @@ -32,7 +32,7 @@ #include #endif -#include "gui/proxyserver_setup.h" +#include "proxyserver_setup.h" #include #include diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index f9ba63afb..aced80cda 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -39,8 +39,8 @@ #include #include -#include "gui/record_setup.h" -#include "gui/filebrowser.h" +#include "record_setup.h" +#include #include #include @@ -51,7 +51,7 @@ #include #include - +#include CRecordSetup::CRecordSetup() { diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 75324cfd1..e11f0c099 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -38,7 +38,7 @@ #include #include -#include "gui/scan_setup.h" +#include #include #include @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -248,7 +249,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { g_RCInput->close_click(); - if (system(NEUTRINO_SCAN_START_SCRIPT) != 0) + if (my_system(NEUTRINO_SCAN_START_SCRIPT) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -310,7 +311,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_Zapit->stopScan(); if(!manual) { - if (system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) + if (my_system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index e92b3211e..fbf007e41 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -38,13 +38,13 @@ #include #include -#include "gui/scan.h" -#include "gui/scan_setup.h" -#include "gui/motorcontrol.h" -#include "gui/bedit/bouqueteditor_bouquets.h" +#include +#include +#include +#include -#include "gui/widget/hintbox.h" -#include "gui/widget/stringinput.h" +#include +#include #include #include @@ -53,7 +53,6 @@ #include #include -#include #include #include #include @@ -585,10 +584,9 @@ int CScanSetup::showFrontendSetup(int number) nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED); setupMenu->addItem(nc); -#if 0 mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V); setupMenu->addItem(mc); -#endif mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL); diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index c004b564d..fd51c7def 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -37,7 +37,7 @@ #include #include -#include "gui/widget/icons.h" +#include #include #include diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index e1ac9e752..724fac6d7 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -34,12 +34,10 @@ #include #include -#include "gui/settings_manager.h" - -#include "gui/filebrowser.h" - -#include "gui/widget/messagebox.h" -#include "gui/widget/stringinput.h" +#include +#include +#include +#include #include #include diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 07396e261..d5e969656 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -93,6 +93,7 @@ CStreamInfo2::CStreamInfo2 () rate.min_short_average = 0; box_h = 0; box_h2 = 0; + dmxbuf = NULL; } CStreamInfo2::~CStreamInfo2 () @@ -776,8 +777,6 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos) /* * some definition */ -#define TS_LEN 188 -#define TS_BUF_SIZE (TS_LEN * 2048) /* fix dmx buffer size */ static unsigned long timeval_to_ms (const struct timeval *tv) { @@ -789,7 +788,6 @@ long delta_time_ms (struct timeval *tv, struct timeval *last_tv) return timeval_to_ms (tv) - timeval_to_ms (last_tv); } -uint64_t b_total; static cDemux * dmx; int CStreamInfo2::ts_setup () @@ -804,11 +802,22 @@ int CStreamInfo2::ts_setup () if( !g_RemoteControl->current_PIDs.APIDs.empty() ) apid = g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid; + short ret = -1; if(vpid == 0 && apid == 0) - return -1; + return ret; - dmx = new cDemux(0);//FIXME test + dmx = new cDemux(0); + if(!dmx) + return ret; +#define TS_LEN 188 +#define TS_BUF_SIZE (TS_LEN * 2048) /* fix dmx buffer size */ + dmxbuf = new unsigned char[TS_BUF_SIZE]; + if(!dmxbuf){ + delete dmx; + dmx = NULL; + return ret; + } dmx->Open(DMX_TP_CHANNEL, NULL, 3 * 3008 * 62); if(vpid > 0) { @@ -823,8 +832,8 @@ int CStreamInfo2::ts_setup () gettimeofday (&first_tv, NULL); last_tv.tv_sec = first_tv.tv_sec; last_tv.tv_usec = first_tv.tv_usec; - b_total = 0; - return 0; + ret = b_total = 0; + return ret; } int CStreamInfo2::update_rate () @@ -832,8 +841,6 @@ int CStreamInfo2::update_rate () if(!dmx) return 0; - - unsigned char buf[TS_BUF_SIZE] = {0}; long b = 0; int ret = 0; @@ -841,7 +848,7 @@ int CStreamInfo2::update_rate () int timeout = 100; - b_len = dmx->Read(buf, sizeof (buf), timeout); + b_len = dmx->Read(dmxbuf, TS_BUF_SIZE, timeout); //printf("ts: read %d\n", b_len); b = b_len; @@ -879,6 +886,9 @@ int CStreamInfo2::ts_close () if(dmx) delete dmx; dmx = NULL; + if(dmxbuf) + delete [] dmxbuf; + dmxbuf = NULL; return 0; } diff --git a/src/gui/streaminfo2.h b/src/gui/streaminfo2.h index dd6b553d2..e24c48ca4 100644 --- a/src/gui/streaminfo2.h +++ b/src/gui/streaminfo2.h @@ -84,7 +84,7 @@ class CStreamInfo2 : public CMenuTarget uint64_t bit_s; uint64_t abit_s; uint64_t b_total; - + unsigned char *dmxbuf; int update_rate(); int ts_setup(); int ts_close(); diff --git a/src/gui/subchannel_select.cpp b/src/gui/subchannel_select.cpp index c059e8344..86b0a6a1c 100644 --- a/src/gui/subchannel_select.cpp +++ b/src/gui/subchannel_select.cpp @@ -38,7 +38,7 @@ #include #include -#include "gui/subchannel_select.h" +#include "subchannel_select.h" #include extern CRemoteControl * g_RemoteControl; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index b46f22dd8..bb6e3aae7 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -30,7 +30,7 @@ #include #endif -#include "gui/test_menu.h" +#include "test_menu.h" #include #include @@ -45,9 +45,9 @@ #include #include -#include "gui/widget/hintbox.h" -#include "gui/scan.h" -#include "gui/scan_setup.h" +#include +#include +#include #include #include #include diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index 3e3345bbb..0d80900c2 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -29,8 +29,7 @@ #include #include #include -#include -#include "gui/infoclock.h" +#include //static CProgressBar *timescale = 0; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 45803538a..f5835073f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -51,11 +51,9 @@ #include #include - #include #include #include -#include #include #include #include @@ -68,6 +66,9 @@ #include #include +#include + +#include extern CBouquetManager *g_bouquetManager; @@ -648,7 +649,6 @@ void CTimerList::hide() } } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); void CTimerList::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight*2; @@ -744,8 +744,7 @@ void CTimerList::paintItem(int pos) if (timer.epgID!=0) { CEPGData epgdata; - //if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) - if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { zAddData += " : "; zAddData += epgdata.title; @@ -1212,52 +1211,55 @@ int CTimerList::newTimer() bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) { - CTimerdClient Timer; - CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime); - //printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime); + if (CFEManager::getInstance()->getMode() == CFEManager::FE_MODE_SINGLE){ + CTimerdClient Timer; + CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime); + //printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime); - std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); - timerbuf += "\n"; - for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); - it != overlappingTimers.end(); ++it) - { - timerbuf += CTimerList::convertTimerType2String(it->eventType); - timerbuf += " ("; - timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8 - if (it->epgID != 0) - { - CEPGData epgdata; - //if (g_Sectionsd->getEPGid(it->epgID, it->epg_starttime, &epgdata)) - if (sectionsd_getEPGid(it->epgID, it->epg_starttime, &epgdata)) - { - timerbuf += ":"; - timerbuf += epgdata.title; - } - else if (strlen(it->epgTitle)!=0) - { - timerbuf += ":"; - timerbuf += it->epgTitle; - } - } - timerbuf += ")"; - - timerbuf += ":\n"; - char at[25] = {0}; - struct tm *annTime = localtime(&(it->announceTime)); - strftime(at,20,"%d.%m. %H:%M",annTime); - timerbuf += at; - timerbuf += " - "; - - char st[25] = {0}; - struct tm *sTime = localtime(&(it->stopTime)); - strftime(st,20,"%d.%m. %H:%M",sTime); - timerbuf += st; + std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); timerbuf += "\n"; - //printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime); - } - //printf("message:\n%s\n",timerbuf.c_str()); - // todo: localize message - //g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE); + for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); + it != overlappingTimers.end(); ++it) + { + timerbuf += CTimerList::convertTimerType2String(it->eventType); + timerbuf += " ("; + timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8 + if (it->epgID != 0) + { + CEPGData epgdata; + if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata)) + { + timerbuf += ":"; + timerbuf += epgdata.title; + } + else if (strlen(it->epgTitle)!=0) + { + timerbuf += ":"; + timerbuf += it->epgTitle; + } + } + timerbuf += ")"; - return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + timerbuf += ":\n"; + char at[25] = {0}; + struct tm *annTime = localtime(&(it->announceTime)); + strftime(at,20,"%d.%m. %H:%M",annTime); + timerbuf += at; + timerbuf += " - "; + + char st[25] = {0}; + struct tm *sTime = localtime(&(it->stopTime)); + strftime(st,20,"%d.%m. %H:%M",sTime); + timerbuf += st; + timerbuf += "\n"; + //printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime); + } + //printf("message:\n%s\n",timerbuf.c_str()); + // todo: localize message + //g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE); + + return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + } + else + return true; } diff --git a/src/gui/update.cpp b/src/gui/update.cpp index e6afd19ba..32551ec9f 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -59,7 +59,7 @@ #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif diff --git a/src/gui/update_menue.h b/src/gui/update_menue.h index 683bdae0e..8948a49f6 100644 --- a/src/gui/update_menue.h +++ b/src/gui/update_menue.h @@ -33,7 +33,7 @@ #define __software_update__ #include -#include "gui/update.h" +#include #include class CSoftwareUpdate : public CMenuTarget diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp index c6a432bd7..07de21474 100644 --- a/src/gui/update_settings.cpp +++ b/src/gui/update_settings.cpp @@ -37,7 +37,7 @@ #include #include #include "update_settings.h" -#include "gui/filebrowser.h" +#include "filebrowser.h" #include #include #include diff --git a/src/gui/update_settings.h b/src/gui/update_settings.h index 1c9b44198..c58676774 100644 --- a/src/gui/update_settings.h +++ b/src/gui/update_settings.h @@ -34,7 +34,7 @@ #include -#include "gui/update.h" +#include "update.h" // #define USE_SMS_INPUT diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 03b6cc7b8..c4495d5fc 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -32,11 +32,11 @@ #ifndef __upnpplayergui__ #define __upnpplayergui__ -#include "driver/framebuffer.h" -#include "driver/audiofile.h" -#include "driver/pictureviewer/pictureviewer.h" -#include "gui/filebrowser.h" -#include "gui/widget/menue.h" +#include +#include +#include +#include +#include #include #include diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f36e5f40d..2aa65eed7 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -41,20 +41,20 @@ #include #endif -#include "gui/user_menue.h" -#include "gui/user_menue_setup.h" -#include "gui/subchannel_select.h" -#include "gui/favorites.h" -#include "gui/audio_select.h" -#include "gui/streaminfo2.h" -#include "gui/epgplus.h" -#include "gui/movieplayer.h" -#include "gui/timerlist.h" -#include "gui/plugins.h" -#include "gui/imageinfo.h" -#include "gui/dboxinfo.h" -#include "gui/cam_menu.h" -#include "gui/pluginlist.h" +#include "user_menue.h" +#include "user_menue_setup.h" +#include "subchannel_select.h" +#include "favorites.h" +#include "audio_select.h" +#include "streaminfo2.h" +#include "epgplus.h" +#include "movieplayer.h" +#include "timerlist.h" +#include "plugins.h" +#include "imageinfo.h" +#include "dboxinfo.h" +#include "cam_menu.h" +#include "pluginlist.h" #include #include @@ -82,12 +82,14 @@ CUserMenu::~CUserMenu() } +#if 0 #define MAINMENU_RECORDING_OPTION_COUNT 2 const CMenuOptionChooser::keyval MAINMENU_RECORDING_OPTIONS[MAINMENU_RECORDING_OPTION_COUNT] = { { 0, LOCALE_MAINMENU_RECORDING_START }, { 1, LOCALE_MAINMENU_RECORDING_STOP } }; +#endif // USERMENU bool CUserMenu::showUserMenu(int button) @@ -461,6 +463,7 @@ bool CUserMenu::showUserMenu(int button) **************************************************************************************/ bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void * Data) { +#if 0 bool res = !CRecordManager::getInstance()->RecordingStatus() ? false:true; if ((ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_RECORDING_START)) || (ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_RECORDING))) @@ -471,9 +474,11 @@ bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void * Data) res = false; else res = true; - } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_PAUSESECTIONSD)) { + } else +#endif + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_PAUSESECTIONSD)) { g_Sectionsd->setPauseScanning((*((int *)Data)) == 0); } - return res; + return false; } diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 85e510544..b1991d760 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -35,7 +35,7 @@ #endif -#include "gui/user_menue_setup.h" +#include "user_menue_setup.h" #include #include diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 2373eae4d..30f62d1ab 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -34,7 +34,7 @@ #endif -#include "gui/vfd_setup.h" +#include "vfd_setup.h" #include #include diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 51f5f9763..f59e02752 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -41,8 +41,8 @@ #include #include -#include "gui/widget/hintbox.h" -#include "gui/widget/messagebox.h" +#include +#include #include diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 58f319069..075155a9d 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -44,7 +44,7 @@ #include #include -#include "gui/widget/icons.h" +#include #define VALUE_R 0 diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index a124d993a..8a9678ede 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -49,7 +49,9 @@ #include #endif -#include "stdlib.h" +#include + +#include #include "listframe.h" #include diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index bbabc1b59..0f5a40195 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -44,8 +44,8 @@ Nov 2005 Günther initial implementation ****************************************************************************/ -#if !defined(LISTFRAME_H_) -#define LISTFRAME_H_ +#ifndef __LISTFRAME_H__ +#define __LISTFRAME_H__ #ifdef HAVE_CONFIG_H #include diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index b973b7eb0..23af427ce 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -470,6 +469,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) neutrino_msg_t msg; neutrino_msg_data_t data; bool bAllowRepeatLR = false; + CVFD::MODES oldLcdMode = CVFD::getInstance()->getMode(); int pos = 0; exit_pressed = false; @@ -734,7 +734,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) fader.Stop(); if(!parent) - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + if(oldLcdMode != CVFD::getInstance()->getMode()) + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); for (unsigned int count = 0; count < items.size(); count++) { diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 704d7a77e..032b4877e 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -48,6 +48,8 @@ #include #endif +#include + #include "msgbox.h" #include diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 85905a4f0..ead68cda1 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -54,7 +54,6 @@ #include #include "textbox.h" -#include #include class CMsgBox diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index 0da2a07f2..0a5a5aea9 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -37,7 +37,6 @@ #include #include -#include #include diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index bba0b0d63..3bab0f7ce 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -55,10 +55,11 @@ #include #endif +#include + #include "textbox.h" #include -#define TEXT_BORDER_WIDTH 8 #define SCROLL_FRAME_WIDTH 10 #define SCROLL_MARKER_BORDER 2 @@ -163,6 +164,7 @@ void CTextBox::initVar(void) m_nLinesPerPage = 0; m_nCurrentLine = 0; m_nCurrentPage = 0; + text_border_width = 8; m_cFrame.iX = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - MIN_WINDOW_WIDTH) >>1); m_cFrame.iWidth = MIN_WINDOW_WIDTH; @@ -172,16 +174,37 @@ void CTextBox::initVar(void) m_nMaxHeight = MAX_WINDOW_HEIGHT; m_nMaxWidth = MAX_WINDOW_WIDTH; - m_textBackgroundColor = COL_MENUCONTENT_PLUS_0; - + m_textBackgroundColor = COL_MENUCONTENT_PLUS_0; + m_textColor = COL_MENUCONTENT; + m_nPaintBackground = true; + m_nBgRadius = 0; + m_nBgRadiusType = CORNER_ALL; + m_cLineArray.clear(); } +void CTextBox::setTextFont(Font* font_text) +{ + if ((m_pcFontText != font_text) && (font_text != NULL)) { + m_pcFontText = font_text; + m_nFontTextHeight = m_pcFontText->getHeight(); + initFramesRel(); + refreshTextLineArray(); + } +} + +void CTextBox::setTextBorderWidth(int border) +{ + text_border_width = border; + initFramesRel(); + refreshTextLineArray(); +} + void CTextBox::reSizeMainFrameWidth(int textWidth) { //TRACE("[CTextBox]->ReSizeMainFrameWidth: %d, current: %d\r\n",textWidth,m_cFrameTextRel.iWidth); - int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*TEXT_BORDER_WIDTH; + int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*text_border_width; if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if( iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; @@ -196,8 +219,7 @@ void CTextBox::reSizeMainFrameHeight(int textHeight) { TRACE("[CTextBox]->ReSizeMainFrameHeight: %d, current: %d\r\n",textHeight,m_cFrameTextRel.iHeight); - int iNewWindowHeight = textHeight - + 2*TEXT_BORDER_WIDTH; + int iNewWindowHeight = textHeight + 2*text_border_width; if( iNewWindowHeight > m_nMaxHeight) iNewWindowHeight = m_nMaxHeight; if( iNewWindowHeight < MIN_WINDOW_HEIGHT) iNewWindowHeight = MIN_WINDOW_HEIGHT; @@ -233,7 +255,7 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; - m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontTextHeight); + m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_border_width)) / m_nFontTextHeight); #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n", @@ -278,15 +300,11 @@ void CTextBox::refreshTextLineArray(void) m_nNrOfLines = 0; if( m_nMode & AUTO_WIDTH) - { /* In case of autowidth, we calculate the max allowed width of the textbox */ - lineBreakWidth = MAX_WINDOW_WIDTH - m_cFrameScrollRel.iWidth - 2*TEXT_BORDER_WIDTH; - } + lineBreakWidth = MAX_WINDOW_WIDTH - m_cFrameScrollRel.iWidth - 2*text_border_width; else - { /* If not autowidth, we just take the actuall textframe width */ - lineBreakWidth = m_cFrameTextRel.iWidth - 2*TEXT_BORDER_WIDTH; - } + lineBreakWidth = m_cFrameTextRel.iWidth - 2*text_border_width; if(max_width) lineBreakWidth = max_width; //printf("TextBox: lineBreakWidth %d\n", lineBreakWidth); @@ -297,13 +315,9 @@ void CTextBox::refreshTextLineArray(void) while(loop) { if(m_nMode & NO_AUTO_LINEBREAK) - { pos = m_cText.find_first_of("\n",pos_prev); - } else - { - pos = m_cText.find_first_of("\n-. ",pos_prev); - } + pos = m_cText.find_first_of("\n/-. ",pos_prev); //TRACE_1(" pos: %d pos_prev: %d\r\n",pos,pos_prev); @@ -369,7 +383,7 @@ void CTextBox::refreshTextLineArray(void) reSizeMainFrameHeight(m_nNrOfLines * m_nFontTextHeight); } - m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*TEXT_BORDER_WIDTH)) / m_nFontTextHeight); + m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_border_width)) / m_nFontTextHeight); m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; if(m_nCurrentPage >= m_nNrOfPages) @@ -427,26 +441,28 @@ void CTextBox::refreshText(void) if( frameBuffer == NULL) return; //TRACE(" CTextBox::refreshText: %d,%s\r\n",m_nCurrentLine,m_cLineArray[m_nCurrentLine].c_str()); //Paint Text Background - frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, m_cFrameTextRel.iY+m_cFrame.iY, - m_cFrameTextRel.iWidth, m_cFrameTextRel.iHeight, m_textBackgroundColor); - + if (m_nPaintBackground) + frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, /*m_cFrameTextRel.iY+*/m_cFrame.iY, + m_cFrameTextRel.iWidth, m_cFrameTextRel.iHeight, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + if( m_nNrOfLines <= 0) return; - int y = m_cFrameTextRel.iY + TEXT_BORDER_WIDTH; + int y = m_cFrameTextRel.iY + text_border_width; int i; int x_center = 0; +// y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width; + y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width; for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++) { - y += m_nFontTextHeight; - + + //calculate centered xpos if( m_nMode & CENTER ) - { x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1; - } - m_pcFontText->RenderString(m_cFrameTextRel.iX + TEXT_BORDER_WIDTH + x_center+m_cFrame.iX, + m_pcFontText->RenderString(m_cFrameTextRel.iX + text_border_width + x_center+m_cFrame.iX, y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(), - COL_MENUCONTENT, 0, true); // UTF-8 + m_textColor, 0, true); // UTF-8 + y += m_nFontTextHeight; } } diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index b639b75b9..a308d05f9 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -59,8 +59,9 @@ #include #include -#include #include +#include +#include #define TRACE printf #define TRACE_1 printf @@ -117,12 +118,18 @@ class CTextBox int m_nCurrentLine; int m_nCurrentPage; + int m_nBgRadius; + int m_nBgRadiusType; + bool m_nPaintBackground; + Font* m_pcFontText; int m_nFontTextHeight; CFBWindow::color_t m_textBackgroundColor; + fb_pixel_t m_textColor; CFrameBuffer * frameBuffer; int max_width; + int text_border_width; public: /* Constructor */ CTextBox(); @@ -138,8 +145,13 @@ class CTextBox /* Functions */ void refresh(void); void scrollPageDown(const int pages); - void scrollPageUp(const int pages); + void scrollPageUp(const int pages); + void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;}; bool setText(const std::string* newText, int _max_width = 0); + void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;}; + void setBackGroundRadius(const int radius, const int type){m_nBgRadius = radius; m_nBgRadiusType = type;}; + void setTextBorderWidth(int border); + void setTextFont(Font* font_text); inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; inline CBox getWindowsPos(void) {return(m_cFrame);}; diff --git a/src/gui/zapit_setup.cpp b/src/gui/zapit_setup.cpp index 12bb06ec4..f8e18168c 100644 --- a/src/gui/zapit_setup.cpp +++ b/src/gui/zapit_setup.cpp @@ -27,7 +27,7 @@ #endif -#include "gui/zapit_setup.h" +#include "zapit_setup.h" #include #include diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 63e6c5b25..369f89771 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -39,7 +39,6 @@ #include #include -#include #include "global.h" #include "neutrino.h" @@ -75,7 +74,6 @@ #include "gui/rc_lock.h" #include "gui/scan_setup.h" #include "gui/start_wizard.h" -#include "gui/timerlist.h" #include "gui/videosettings.h" #include "gui/widget/hintbox.h" @@ -98,6 +96,7 @@ #include #include #include +#include #include @@ -107,12 +106,11 @@ #include #include -#include #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include int old_b_id = -1; @@ -140,12 +138,6 @@ void * nhttpd_main_thread(void *data); static pthread_t nhttpd_thread ; //#define DISABLE_SECTIONSD -extern int sectionsd_stop; -#ifndef DISABLE_SECTIONSD -//static pthread_t sections_thread; -#endif -void * sectionsd_main_thread(void *data); -extern bool timeset; // sectionsd extern cVideo * videoDecoder; extern cDemux *videoDemux; @@ -1575,9 +1567,6 @@ void CNeutrinoApp::SetupTiming() } -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -bool sectionsd_isReady(void); - #define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000) #define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000) @@ -1748,7 +1737,7 @@ void wake_up( bool &wakeup) if(!wakeup){ const char *neutrino_leave_deepstandby_script = CONFIGDIR "/deepstandby.off"; printf("[%s] executing %s\n",__FILE__ ,neutrino_leave_deepstandby_script); - if (system(neutrino_leave_deepstandby_script) != 0) + if (my_system(neutrino_leave_deepstandby_script) != 0) perror( neutrino_leave_deepstandby_script ); } #endif @@ -1798,13 +1787,14 @@ TIMER_START(); ZapStart_arg.uselastchannel = g_settings.uselastchannel; ZapStart_arg.video_mode = g_settings.video_Mode; ZapStart_arg.ci_clock = g_settings.ci_clock; + ZapStart_arg.volume = g_settings.current_volume; /* create decoders, read channels */ CZapit::getInstance()->Start(&ZapStart_arg); // init audio settings audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); - audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); + //audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); audioDecoder->SetHdmiDD((HDMI_ENCODED_MODE)g_settings.hdmi_dd); audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false); audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false); @@ -2668,8 +2658,7 @@ _repeat: if(timer.epgID!=0) { CEPGData epgdata; zAddData += " :\n"; - //if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) - if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { + if (CEitManager::getInstance()->getEPGid(timer.epgID, timer.epg_starttime, &epgdata)) { zAddData += epgdata.title; } else if(strlen(timer.epgTitle)!=0) { @@ -2688,7 +2677,8 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - system(NEUTRINO_RECORDING_TIMER_SCRIPT); + my_system(NEUTRINO_RECORDING_TIMER_SCRIPT); + if (g_settings.recording_type == RECORDING_FILE) { char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -2702,7 +2692,7 @@ _repeat: } } if(has_hdd) { - system("(rm /media/sda1/.wakeup; touch /media/sda1/.wakeup; sync) > /dev/null 2> /dev/null &"); // wakeup hdd + wakeup_hdd(g_settings.network_nfs_recordingdir); } } if( g_settings.recording_zap_on_announce ) { @@ -2728,7 +2718,7 @@ _repeat: if(data) { skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME if(skipShutdownTimer) { printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); skipShutdownTimer = false; @@ -2774,7 +2764,7 @@ _repeat: } else if( msg == NeutrinoMessages::ANNOUNCE_SHUTDOWN) { if( mode != mode_scart ) - skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); + skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); } else if( msg == NeutrinoMessages::SHUTDOWN ) { if(!skipShutdownTimer) { @@ -2948,14 +2938,14 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) if(retcode) { const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on"; printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script); - if (system(neutrino_enter_deepstandby_script) != 0) + if (my_system(neutrino_enter_deepstandby_script) != 0) perror(neutrino_enter_deepstandby_script ); printf("entering off state\n"); mode = mode_off; //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN)); - system("/etc/init.d/rcK"); + my_system("/etc/init.d/rcK"); system("/bin/sync"); system("/bin/umount -a"); sleep(1); @@ -3073,16 +3063,16 @@ void CNeutrinoApp::saveEpg(bool cvfd_mode) { struct stat my_stat; if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0){ - const char *save_txt = "Saving EPG"; - printf("%s to %s....\n",save_txt, g_settings.epg_dir.c_str()); - neutrino_msg_t msg; - neutrino_msg_data_t data; + printf("[neutrino] Saving EPG to %s...\n", g_settings.epg_dir.c_str()); CVFD::getInstance()->Clear(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - CVFD::getInstance ()->ShowText(save_txt); + CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_EPG_SAVING)); g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str()); + + neutrino_msg_t msg; + neutrino_msg_data_t data; while( true ) { g_RCInput->getMsg(&msg, &data, 1200); // 120 secs.. if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) { @@ -3090,7 +3080,8 @@ 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) + handleMsg(msg, data); } } } @@ -3180,7 +3171,7 @@ void CNeutrinoApp::scartMode( bool bOnOff ) void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) { - static bool wasshift = false; + //static bool wasshift = false; INFO("%s", bOnOff ? "ON" : "OFF" ); if( bOnOff ) { @@ -3195,10 +3186,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) frameBuffer->useBackground(false); frameBuffer->paintBackground(); - CVFD::getInstance()->Clear(); - CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); - - wasshift = CRecordManager::getInstance()->StopAutoRecord(); + /* wasshift = */ CRecordManager::getInstance()->StopAutoRecord(); if(!CRecordManager::getInstance()->RecordingStatus()) { g_Zapit->setStandby(true); @@ -3218,6 +3206,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } } + CVFD::getInstance()->Clear(); + CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); + if(g_settings.mode_clock) { InfoClock->StopClock(); } @@ -3226,7 +3217,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); - if (system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) + if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3270,7 +3261,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) + if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); @@ -3307,11 +3298,15 @@ 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(); } } @@ -3549,7 +3544,6 @@ bool CNeutrinoApp::changeNotify(const neutrino_locale_t OptionName, void * /*dat void stop_daemons(bool stopall) { streamts_stop = 1; - sectionsd_stop = 1; dvbsub_close(); tuxtxt_stop(); tuxtxt_close(); @@ -3567,7 +3561,6 @@ void stop_daemons(bool stopall) } #ifndef DISABLE_SECTIONSD printf("sectionsd shutdown\n"); - //pthread_join(sections_thread, NULL); CEitManager::getInstance()->Stop(); printf("sectionsd shutdown done\n"); #endif diff --git a/src/neutrino.h b/src/neutrino.h index 97b483a7c..3ff32bf3e 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -36,16 +36,15 @@ #include #include -#include -#include -#include -#include -#include -#include /* CChannelList */ -#include -#include /* st_rmsg */ -#include -#include +#include "driver/framebuffer.h" +#include "system/setting_helpers.h" +#include "system/configure_network.h" +#include "daemonc/remotecontrol.h" /* st_rmsg */ +#include "gui/channellist.h" /* CChannelList */ +#include "gui/personalize.h" +#include "gui/rc_lock.h" +#include "gui/user_menue.h" +#include "gui/timerlist.h" #include diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 3e8ddce2c..d4f5b98ee 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -48,7 +48,7 @@ #include "gui/bouquetlist.h" #include "gui/cam_menu.h" #include "gui/dboxinfo.h" -#include +#include "gui/epgplus.h" #include "gui/favorites.h" #include "gui/hdd_menu.h" #include "gui/imageinfo.h" @@ -59,7 +59,7 @@ #include "gui/miscsettings_menu.h" #include "gui/motorcontrol.h" #include "gui/movieplayer.h" -#include +#include "gui/network_setup.h" #include "gui/osd_setup.h" #include "gui/osdlang_setup.h" #include "gui/parentallock_setup.h" @@ -70,11 +70,11 @@ #include "gui/settings_manager.h" #include "gui/sleeptimer.h" #include "gui/update_menue.h" -#include +#include "gui/streaminfo2.h" #include "gui/test_menu.h" #include "gui/update.h" #include "gui/vfd_setup.h" -#include +#include "driver/record.h" extern CPlugins * g_PluginList; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index e53469824..d737dbf0a 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -45,13 +46,6 @@ #include "neutrinoapi.h" #include "controlapi.h" -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); - extern CPlugins *g_PluginList;//for relodplugins extern CBouquetManager *g_bouquetManager; #define EVENTDEV "/dev/input/input0" @@ -899,7 +893,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann if (event) { if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; - sectionsd_getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); timestr = timeString(event->startTime); firstEPG += hh->outPair("startTime", timestr, true); @@ -1198,7 +1192,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) { std::string result = ""; std::string channelData = ""; - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false); @@ -1232,7 +1226,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ if (!(hh->ParamList["details"].empty())) { CShortEPGData epg; - if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { prog += hh->outPair("info1", hh->outValue(epg.info1), true); prog += hh->outPair("info2", hh->outValue(epg.info2), true); } @@ -1389,7 +1383,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { uint64_t epgid; sscanf(hh->ParamList["eventid"].c_str(), "%llu", &epgid); CShortEPGData epg; - if (sectionsd_getEPGidShort(epgid, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) { hh->WriteLn(epg.title); hh->WriteLn(epg.info1); hh->WriteLn(epg.info2); @@ -1402,7 +1396,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { sscanf(hh->ParamList["fskid"].c_str(), "%llu", &epgid); sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; - if (sectionsd_getEPGid(epgid, starttime, &longepg)) { + if (CEitManager::getInstance()->getEPGid(epgid, starttime, &longepg)) { hh->printf("%u\n", longepg.fsk); return; } @@ -1413,11 +1407,11 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (!(hh->ParamList["id"].empty())) { t_channel_id channel_id; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) { CShortEPGData epg; - if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) { + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration); hh->printf("%s\n", epg.title.c_str()); hh->printf("%s\n", epg.info1.c_str()); @@ -1508,8 +1502,8 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) { for(unsigned int i=0; i< desc.size(); i++) { @@ -1583,7 +1577,7 @@ void CControlAPI::LCDAction(CyhookHandler *hh) void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { int pos = 0; - sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++) @@ -1648,8 +1642,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -1896,7 +1890,7 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) std::string title = timer->epgTitle; if(timer->epgID!=0) { CEPGData epgdata; - if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) title = epgdata.title; } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index ddef565df..2ca05cfd4 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -39,6 +39,7 @@ #include #include #include +#include extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; @@ -54,8 +55,6 @@ extern CZapitClient::SatelliteList satList; // nhttpd #include "neutrinoapi.h" -void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = true, t_channel_id *chidlist = NULL, int clen = 0); - //============================================================================= // No Class Helpers //============================================================================= @@ -259,7 +258,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { - sectionsd_getChannelEvents(eList); + CEitManager::getInstance()->getChannelEvents(eList); CChannelEventList::iterator eventIterator; ChannelListEvents.clear(); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index a7b5d0653..a4ba3bce3 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -29,16 +29,12 @@ #include #include #include +#include #include #include extern CBouquetManager *g_bouquetManager; -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); //============================================================================= // Constructor & Destructor & Initialization //============================================================================= @@ -291,7 +287,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, st sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); std::string _sid = std::string(id); sel = (_sid == achannel_id) ? "selected=\"selected\"" : ""; - sectionsd_getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg); + CEitManager::getInstance()->getActualEPGServiceKey(channel->channel_id, &epg); sprintf(buf,"\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str()); yresult += buf; } @@ -396,7 +392,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) { CSectionsdClient::NVODTimesList nvod_list; - if (sectionsd_getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) + if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id, nvod_list)) { CZapitClient::subServiceList subServiceList; @@ -413,7 +409,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: t_channel_id channel_id = CREATE_CHANNEL_ID(cmd.service_id, cmd.original_network_id, cmd.transport_stream_id); timestr = timeString(ni->zeit.startzeit); // FIXME: time is wrong (at least on little endian)! - sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!! + CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epg); // FIXME: der scheissendreck geht nit!!! yresult += string_printf("\n ", classname); yresult += string_printf("%s ", classname, timestr.c_str()); yresult += string_printf("%sChannelListEvents[channel->channel_id])) { bool has_current_next = true; - sectionsd_getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); timestr = timeString(event->startTime); yresult += string_printf("",classname); @@ -547,8 +543,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -811,7 +807,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string if(timer->epgID!=0) { CEPGData epgdata; - if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) + if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata)) sAddData+="
" + epgdata.title; else sAddData+=std::string("
")+timer->epgTitle; diff --git a/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm b/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm index 9ef89d701..d2ebb7421 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm @@ -11,7 +11,7 @@ diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 3fb27ca2d..7f48c980d 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -57,6 +57,9 @@ button,input[type="button"],input[type="submit"]/*,input[type="file"],input[type border: 1px solid #888888; background-color: transparent; border-radius: 3px; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; } button:hover,input[type="button"]:hover,input[type="submit"]:hover/*,input[type="file"]:hover*/ { position:relative; @@ -114,6 +117,9 @@ tr { font-size: 100.01%; border: 1px solid #a0a0a0; border-radius: 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; } .y_menu_prim_box_head { margin: 0; @@ -121,6 +127,11 @@ tr { text-align: center; background: #ffffff; border-radius: 4px 4px 0 0; + + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; } .y_menu_prim_box_head_h2 { margin: 0; @@ -131,6 +142,11 @@ tr { padding: 0 20px 5px; background-color: #ffffff; border-radius: 0 0 4px 4px; + + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .y_menu_item { margin: 0; @@ -173,12 +189,20 @@ tr { font-size: 100.01%; border: 1px solid #a0a0a0; border-radius: 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; } .y_menu_sec_box_head { margin: 0; padding: 0; background: #ff6600; border-radius: 4px 4px 0 0; + + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; } .y_menu_sec_box_head h2 { margin: 0; @@ -194,6 +218,11 @@ tr { padding: 5px 0 10px; background-color: #ffffff; border-radius: 0 0 4px 4px; + + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .y_menu_sec { display: block; @@ -254,6 +283,9 @@ tr { font-size: 100.01%; border: 1px solid #a0a0a0; border-radius: 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; } .work_box_head { margin: 0; @@ -261,6 +293,11 @@ tr { text-align: center; background-color: #2188e0; border-radius: 4px 4px 0 0; + + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; } .work_box_head h2,.work_box_head_h2 { margin: 0; @@ -276,6 +313,11 @@ tr { padding: 5px 30px 10px 30px; background-color: #ffffff; border-radius: 0 0 4px 4px; + + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .work_box_help { float:right; @@ -336,6 +378,9 @@ tr { z-index : 500; border: 1px solid #a0a0a0; border-radius: 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; } .y_wait_box_visible { margin: 0; @@ -347,12 +392,20 @@ tr { z-index : 500; border: 1px solid #a0a0a0; border-radius: 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; } .y_wait_box_head { margin: 0; padding: 0; background: #ff6600; border-radius: 4px 4px 0 0; + + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; } .y_wait_box_head h2 { margin: 0; @@ -367,6 +420,11 @@ tr { padding: 5px 15px 20px; background-color: #ffffff; border-radius: 0 0 4px 4px; + + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .y_wait_box_main { color: #666666; @@ -540,9 +598,11 @@ tr { height: 100%; font-size:8pt; z-index:10; - -moz-opacity: 0.2; opacity:.20; - filter: alpha(opacity=20); + + -webkit-opacity: 0.2; + -moz-opacity: 0.2; + filter: alpha(opacity=20); } .ep_bouquet_zap { border-right : #BBBBBB solid 1px; @@ -554,9 +614,11 @@ tr { height: 100%; font-size:8pt; z-index:10; - -moz-opacity: 0.2; opacity:.20; - filter: alpha(opacity=20); + + -webkit-opacity: 0.2; + -moz-opacity: 0.2; + filter: alpha(opacity=20); } .ep_bouquet_item:hover { background-color : #DDDDDD; diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index c5fea8aff..770a0d8f8 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.29 -date=12.08.2012 +version=2.8.0.30 +date=18.08.2012 type=Release info=Port Coolstream diff --git a/src/system/Makefile.am b/src/system/Makefile.am index 32b13667e..1e42f4a63 100644 --- a/src/system/Makefile.am +++ b/src/system/Makefile.am @@ -24,7 +24,14 @@ endif noinst_LIBRARIES = libneutrino_system.a libneutrino_system_a_SOURCES = \ - localize.cpp setting_helpers.cpp debug.cpp \ - ping.c flashtool.cpp httptool.cpp \ - settings.cpp lastchannel.cpp \ - configure_network.cpp fsmounter.cpp + configure_network.cpp \ + debug.cpp \ + flashtool.cpp \ + fsmounter.cpp \ + httptool.cpp \ + lastchannel.cpp \ + localize.cpp \ + helpers.cpp \ + ping.c \ + settings.cpp \ + setting_helpers.cpp diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index 06f144b38..7ba9342ec 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -25,8 +25,8 @@ #include #include #include "configure_network.h" -#include "libnet.h" /* netGetNameserver, netSetNameserver */ -#include "network_interfaces.h" /* getInetAttributes, setInetAttributes */ +#include /* netGetNameserver, netSetNameserver */ +#include /* getInetAttributes, setInetAttributes */ #include /* system */ #include #include @@ -216,32 +216,6 @@ void CNetworkConfig::commitConfig(void) } } -int mysystem(const char * cmd, const char * arg1, const char * arg2) -{ - int i; - pid_t pid; - int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); - switch (pid = vfork()) - { - case -1: /* can't fork */ - perror("vfork"); - return -1; - - case 0: /* child process */ - for(i = 3; i < maxfd; i++) - close(i); - if(execlp(cmd, cmd, arg1, arg2, NULL)) - { - perror("exec"); - } - exit(0); - default: /* parent returns to calling process */ - break; - } - waitpid(pid, 0, 0); - return 0; -} - void CNetworkConfig::startNetwork(void) { std::string cmd = "/sbin/ifup " + ifname; diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp new file mode 100644 index 000000000..f5f1cdb96 --- /dev/null +++ b/src/system/helpers.cpp @@ -0,0 +1,236 @@ +/* + Neutrino-HD + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include /* or */ +#include +#include +#include + +#include + +bool file_exists(const char *filename) +{ + struct stat stat_buf; + if(::stat(filename, &stat_buf) == 0) + { + return true; + } else + { + return false; + } +} + +void wakeup_hdd(const char *hdd_dir) +{ + if(!check_dir(hdd_dir)){ + std::string wakeup_file = hdd_dir; + wakeup_file += "/.wakeup"; + remove(wakeup_file.c_str()); + creat(wakeup_file.c_str(),S_IREAD|S_IWRITE); + sync(); + } +} +//use for script with full path +int my_system(const char * cmd) +{ + if (!file_exists(cmd)) + return -1; + + return my_system(cmd, NULL); +} + +int my_system(const char * cmd, const char * arg1, const char * arg2, const char * arg3, const char * arg4, const char * arg5, const char * arg6) +{ + int i=0 ,ret=0, childExit=0; + pid_t pid; + int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); + switch (pid = vfork()) + { + case -1: /* can't vfork */ + perror("vfork"); + return -1; + case 0: /* child process */ + for(i = 3; i < maxfd; i++) + close(i); + if(execlp(cmd, cmd, arg1, arg2, arg3, arg4, arg5, arg6, NULL)) + { + std::string txt = "ERROR: my_system \"" + (std::string) cmd + "\""; + perror(txt.c_str()); + ret = -1; + } + _exit (0); // terminate c h i l d proces s only + default: /* parent returns to calling process */ + break; + } + waitpid(pid, &childExit, 0); + if(childExit != 0) + ret = childExit; + return ret; +} + +FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) +{ + int pfd[2] ={-1,-1}; + FILE *fp = NULL; + + /* only allow "r" or "w" */ + if ((type[0] != 'r' && type[0] != 'w') || type[1] != 0) { + errno = EINVAL; /* required by POSIX */ + return(NULL); + } + + if (pipe(pfd) < 0) + return(NULL); /* errno set by pipe() */ + + if ((pid = vfork()) < 0) { + return(NULL); /* errno set by vfork() */ + } else if (pid == 0) { /* child */ + if (*type == 'r') { + close(pfd[0]); + if (pfd[1] != STDOUT_FILENO) { + dup2(pfd[1], STDOUT_FILENO); + close(pfd[1]); + } + } else { + close(pfd[1]); + if (pfd[0] != STDIN_FILENO) { + dup2(pfd[0], STDIN_FILENO); + close(pfd[0]); + } + } + execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); + exit(0); + } + + /* parent continues... */ + if (*type == 'r') { + close(pfd[1]); + if ((fp = fdopen(pfd[0], type)) == NULL) + return(NULL); + } else { + close(pfd[0]); + if ((fp = fdopen(pfd[1], type)) == NULL) + return(NULL); + } + return(fp); +} + +int safe_mkdir(char * path) +{ + struct statfs s; + int ret = 0; + if(!strncmp(path, "/hdd", 4)) { + ret = statfs("/hdd", &s); + if((ret != 0) || (s.f_type == 0x72b6)) + ret = -1; + else + mkdir(path, 0755); + } else + mkdir(path, 0755); + return ret; +} + +/* function used to check is this dir writable, i.e. not flash, for record etc */ +int check_dir(const char * dir) +{ + /* default to return, if statfs fail */ + int ret = -1; + struct statfs s; + if (::statfs(dir, &s) == 0) { + switch (s.f_type) /* f_type is long */ + { + case 0xEF53L: /*EXT2 & EXT3*/ + case 0x6969L: /*NFS*/ + case 0xFF534D42L: /*CIFS*/ + case 0x517BL: /*SMB*/ + case 0x52654973L: /*REISERFS*/ + case 0x65735546L: /*fuse for ntfs*/ + case 0x58465342L: /*xfs*/ + case 0x4d44L: /*msdos*/ + case 0x0187: /* AUTOFS_SUPER_MAGIC */ + case 0x858458f6L: /*ramfs*/ +#if 0 + case 0x72b6L: /*jffs2*/ +#endif + ret = 0; + break; //ok + default: + fprintf(stderr, "%s Unknow File system type: %i\n" ,dir ,s.f_type); + break; // error + } + } + return ret; +} + +int get_fs_usage(const char * dir) +{ + int ret = 0; + long blocks_used; + struct statfs s; + + if (::statfs(dir, &s) == 0 && s.f_blocks) { + blocks_used = s.f_blocks - s.f_bfree; + ret = (blocks_used * 100ULL) / s.f_blocks; + } + return ret; +} + +bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree) +{ + unsigned long cached = 0, buffers = 0; + kbtotal = kbfree = 0; + + FILE * f = fopen("/proc/meminfo", "r"); + if (!f) + return false; + + char buffer[256]; + while (fgets(buffer, 255, f)) { + if (!strncmp(buffer, "Mem", 3)) { + if (!strncmp(buffer+3, "Total", 5)) + kbtotal = strtoul(buffer+9, NULL, 10); + else if (!strncmp(buffer+3, "Free", 4)) + kbfree = strtoul(buffer+8, NULL, 10); + } + else if (!strncmp(buffer, "Buffers", 7)) { + buffers = strtoul(buffer+8, NULL, 10); + } + else if (!strncmp(buffer, "Cached", 6)) { + cached = strtoul(buffer+7, NULL, 10); + break; + } + } + fclose(f); + kbfree = kbfree + cached + buffers; + printf("mem: total %ld cached %ld free %ld\n", kbtotal, cached, kbfree); + return true; +} diff --git a/src/system/helpers.h b/src/system/helpers.h new file mode 100644 index 000000000..7707cce05 --- /dev/null +++ b/src/system/helpers.h @@ -0,0 +1,37 @@ + +#ifndef __system_helpers__ +#define __system_helpers__ + +/* + Neutrino-HD + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +int my_system(const char * cmd, const char * arg1, const char * arg2 = NULL, const char * arg3 = NULL, const char * arg4 = NULL, const char * arg5 = NULL, const char * arg6 = NULL); + +int my_system(const char * cmd); + +FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); +int safe_mkdir(char * path); +bool file_exists(const char *filename); +void wakeup_hdd(const char *hdd_dir); +int check_dir(const char * dir); +int get_fs_usage(const char * dir); +bool get_mem_usage(unsigned long &total, unsigned long &free); + +#endif diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index de17a1c0c..20bd5fba7 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -24,7 +24,7 @@ #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif diff --git a/src/system/locals.h b/src/system/locals.h index 2924e2be1..272c29188 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -152,6 +152,7 @@ typedef enum LOCALE_AUDIOMENU_PREF_SUBS_HEAD, LOCALE_AUDIOMENU_SPDIF_DD, LOCALE_AUDIOMENU_STEREO, + LOCALE_AUDIOMENU_VOLUME_ADJUST, LOCALE_AUDIOMENU_VOLUME_STEP, LOCALE_AUDIOPLAYER_ADD, LOCALE_AUDIOPLAYER_ADD_IC, @@ -318,6 +319,7 @@ typedef enum LOCALE_DATE_THU, LOCALE_DATE_TUE, LOCALE_DATE_WED, + LOCALE_EPG_SAVING, LOCALE_EPGEXTENDED_ACTORS, LOCALE_EPGEXTENDED_DIRECTOR, LOCALE_EPGEXTENDED_GUESTS, @@ -1002,6 +1004,7 @@ typedef enum LOCALE_MENU_HINT_SCAN_LONGITUDE, LOCALE_MENU_HINT_SCAN_MANUAL, LOCALE_MENU_HINT_SCAN_MOD, + LOCALE_MENU_HINT_SCAN_MOTOR_18V, LOCALE_MENU_HINT_SCAN_MOTOR_SPEED, LOCALE_MENU_HINT_SCAN_MOTORPOS, LOCALE_MENU_HINT_SCAN_NID, @@ -1185,6 +1188,7 @@ typedef enum LOCALE_MOTORCONTROL_TIMED_MODE, LOCALE_MOTORCONTROL_USER_MENU, LOCALE_MOTORCONTROL_WEST_LIMIT, + LOCALE_MOVIEBROWSER_BOOK_ADD, LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, LOCALE_MOVIEBROWSER_BOOK_HEAD, LOCALE_MOVIEBROWSER_BOOK_LASTMOVIESTOP, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0b444b03a..2879066a0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -152,6 +152,7 @@ const char * locale_real_names[] = "audiomenu.pref_subs_head", "audiomenu.spdif_dd", "audiomenu.stereo", + "audiomenu.volume_adjust", "audiomenu.volume_step", "audioplayer.add", "audioplayer.add_ic", @@ -318,6 +319,7 @@ const char * locale_real_names[] = "date.Thu", "date.Tue", "date.Wed", + "epg.saving", "epgextended.actors", "epgextended.director", "epgextended.guests", @@ -1002,6 +1004,7 @@ const char * locale_real_names[] = "menu.hint_scan_longitude", "menu.hint_scan_manual", "menu.hint_scan_mod", + "menu.hint_scan_motor_18v", "menu.hint_scan_motor_speed", "menu.hint_scan_motorpos", "menu.hint_scan_nid", @@ -1185,6 +1188,7 @@ const char * locale_real_names[] = "motorcontrol.timed_mode", "motorcontrol.user_menu", "motorcontrol.west_limit", + "moviebrowser.book_add", "moviebrowser.book_clear_all", "moviebrowser.book_head", "moviebrowser.book_lastmoviestop", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index ac601a102..677b696f9 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -33,7 +33,6 @@ #include "configure_network.h" #include #include -#include #include #include #include @@ -44,12 +43,9 @@ #include #include #include -#include #include #include #include -#include -#include #if HAVE_COOL_HARDWARE #include @@ -76,8 +72,8 @@ #include #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include #include @@ -566,44 +562,3 @@ bool CAutoModeNotifier::changeNotify(const neutrino_locale_t /*OptionName*/, voi videoDecoder->SetAutoModes(modes); return false; } - -int safe_mkdir(char * path) -{ - struct statfs s; - int ret = 0; - if(!strncmp(path, "/hdd", 4)) { - ret = statfs("/hdd", &s); - if((ret != 0) || (s.f_type == 0x72b6)) - ret = -1; - else - mkdir(path, 0755); - } else - mkdir(path, 0755); - return ret; -} - -int check_dir(const char * newdir) -{ - - struct statfs s; - if (::statfs(newdir, &s) == 0) { - switch (s.f_type) /* f_type is long */ - { - case 0xEF53L: /*EXT2 & EXT3*/ - case 0x6969L: /*NFS*/ - case 0xFF534D42L: /*CIFS*/ - case 0x517BL: /*SMB*/ - case 0x52654973L: /*REISERFS*/ - case 0x65735546L: /*fuse for ntfs*/ - case 0x58465342L: /*xfs*/ - case 0x4d44L: /*msdos*/ - case 0x0187: /* AUTOFS_SUPER_MAGIC */ - case 0x858458f6: /*ramfs*/ - return 0;//ok - default: - fprintf( stderr,"%s Unknow File system type: %i\n",newdir ,s.f_type); - break; - } - } - return 1; // error -} diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index 149a5e082..a8eda16bc 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -144,9 +144,6 @@ class COnekeyPluginChangeExec : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); }; -int safe_mkdir(char * path); -int check_dir(const char * newdir); - class CTZChangeNotifier : public CChangeObserver { public: diff --git a/src/timerd/Makefile.am b/src/timerd/Makefile.am index b446dd7d4..76c1954c4 100644 --- a/src/timerd/Makefile.am +++ b/src/timerd/Makefile.am @@ -3,6 +3,7 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ + -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/lib/libconfigfile \ diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 9a34d4f89..ef84e1526 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,6 @@ time_t timer_minutes; bool timer_is_rec; static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); - //------------------------------------------------------------ CTimerManager::CTimerManager() { @@ -1113,7 +1111,7 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, recordingDir = recDir; epgTitle=""; CShortEPGData epgdata; - if (sectionsd_getEPGidShort(epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) epgTitle=epgdata.title; } @@ -1222,7 +1220,7 @@ void CTimerEvent_Record::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); // we check for a time in the middle of the recording time_t check_time=alarmTime/2 + stopTime/2; for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) @@ -1237,7 +1235,7 @@ void CTimerEvent_Record::getEpgId() if(eventInfo.epgID != 0) { CShortEPGData epgdata; - if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(eventInfo.epgID, &epgdata)) epgTitle=epgdata.title; } } @@ -1270,7 +1268,7 @@ void CTimerEvent_Zapto::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - sectionsd_getEventsServiceKey(eventInfo.channel_id &0xFFFFFFFFFFFFULL, evtlist); + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); // we check for a time 5 min after zap time_t check_time=alarmTime + 300; for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) @@ -1285,7 +1283,7 @@ void CTimerEvent_Zapto::getEpgId() if(eventInfo.epgID != 0) { CShortEPGData epgdata; - if (sectionsd_getEPGidShort(eventInfo.epgID, &epgdata)) + if (CEitManager::getInstance()->getEPGidShort(eventInfo.epgID, &epgdata)) epgTitle=epgdata.title; } } diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 880ddcae0..2c77eb030 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -21,11 +21,21 @@ #define PAL 0 #define NTSC 1 #define AUDIO_CONFIG_FILE "/var/tuxbox/config/zapit/audio.conf" +#define VOLUME_CONFIG_FILE "/var/tuxbox/config/zapit/volume.conf" typedef std::map audio_map_t; typedef audio_map_t::iterator audio_map_iterator_t; typedef std::map sdt_tp_map_t; +typedef std::pair pid_pair_t; +typedef std::pair volume_pair_t; +typedef std::multimap volume_map_t; +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 + /* complete zapit start thread-parameters in a struct */ typedef struct ZAPIT_start_arg { @@ -33,6 +43,7 @@ typedef struct ZAPIT_start_arg t_channel_id startchannelradio_id; int uselastchannel; int video_mode; + int volume; int ci_clock; } Z_start_arg; @@ -89,6 +100,7 @@ class CZapit : public OpenThreads::Thread RECORD_MODE = 0x04 }; + OpenThreads::Mutex mutex; bool started; bool event_mode; bool firstzap; @@ -99,10 +111,12 @@ class CZapit : public OpenThreads::Thread int def_audio_mode; int aspectratio; int mode43; +#if 0 unsigned int volume_left; unsigned int volume_right; - unsigned int def_volume_left; - unsigned int def_volume_right; +#endif + int current_volume; + int volume_percent; int currentMode; bool playbackStopForced; @@ -121,6 +135,7 @@ class CZapit : public OpenThreads::Thread CFrontend * live_fe; audio_map_t audio_map; + volume_map_t vol_map; //bool current_is_nvod; //bool standby; t_channel_id lastChannelRadio; @@ -130,6 +145,7 @@ class CZapit : public OpenThreads::Thread //void LoadAudioMap(); void SaveAudioMap(); + void SaveVolumeMap(); void SaveSettings(bool write_conf); //void SaveChannelPids(CZapitChannel* channel); void RestoreChannelPids(CZapitChannel* channel); @@ -171,6 +187,7 @@ class CZapit : public OpenThreads::Thread Zapit_config config; CZapitSdtMonitor SdtMonitor; void LoadAudioMap(); + void LoadVolumeMap(); void SaveChannelPids(CZapitChannel* channel); virtual void ConfigFrontend(); bool StopPlayBack(bool send_pmt); @@ -224,5 +241,11 @@ class CZapit : public OpenThreads::Thread void SetCurrentChannelID(const t_channel_id channel_id) { live_channel_id = channel_id; }; void SetLiveFrontend(CFrontend * fe) { if(fe) live_fe = fe; } CFrontend * GetLiveFrontend() { return live_fe; }; + + int GetPidVolume(t_channel_id channel_id, int pid, bool ac3 = false); + void SetPidVolume(t_channel_id channel_id, int pid, int percent); + void SetVolume(int vol); + int GetVolume() { return current_volume; }; + int SetVolumePercent(int percent); }; #endif /* __zapit_h__ */ diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp index 301345ac5..47a680e65 100644 --- a/src/zapit/src/capmt.cpp +++ b/src/zapit/src/capmt.cpp @@ -1,9 +1,9 @@ /* - * $Id: cam.cpp,v 1.33 2004/04/04 20:20:45 obi Exp $ - * * (C) 2002 by Andreas Oberritter , * thegoodguy * + * Copyright (C) 2011-2012 CoolStream International Ltd + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -81,7 +81,7 @@ bool CCam::makeCaPmt(CZapitChannel * channel, uint8_t list, const CaIdVector &ca int len; unsigned char * buffer = channel->getRawPmt(len); - INFO("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list); + DBG("cam %x source %d camask %d list %02x buffer", (int) this, source_demux, camask, list); if(!buffer) return false; @@ -149,7 +149,7 @@ int CCam::makeMask(int demux, bool add) if(demuxes[i] > 0) mask |= 1 << i; } - INFO("demuxes %d:%d:%d old mask %d new mask %d", demuxes[0], demuxes[1], demuxes[2], camask, mask); + DBG("demuxes %d:%d:%d old mask %d new mask %d", demuxes[0], demuxes[1], demuxes[2], camask, mask); return mask; } @@ -188,7 +188,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start printf("CCamManager: channel %llx not found\n", channel_id); return false; } - INFO("channel %llx [%s] mode %d %s update %d", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", force_update); + //INFO("channel %llx [%s] mode %d %s update %d", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", force_update); mutex.lock(); cammap_iterator_t it = channel_map.find(channel_id); @@ -226,11 +226,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start if(cam->getSource() > 0) source = cam->getSource(); - INFO("source %d old mask %d new mask %d force update %s", source, oldmask, newmask, force_update ? "yes" : "no"); + INFO("channel %llx [%s] mode %d %s src %d mask %d -> %d update %d", channel_id, channel->getName().c_str(), + mode, start ? "START" : "STOP", source, oldmask, newmask, force_update); + //INFO("source %d old mask %d new mask %d force update %s", source, oldmask, newmask, force_update ? "yes" : "no"); if((oldmask != newmask) || force_update) { -#if 0 - cam->setCaPmt(channel, source, newmask, true); -#endif cam->setCaMask(newmask); cam->setSource(source); if(newmask == 0) { diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index f96df7683..159f1895f 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1171,7 +1171,7 @@ int CFrontend::setParameters(TP_params *TP, bool /*nowait*/) //printf("[fe%d] tuner to frequency %d (offset %d timeout %d)\n", fenumber, feparams->dvb_feparams.frequency, freq_offset, TIMEOUT_MAX_MS); //printf("[fe%d] tune to frequency %d (tuner %d offset %d timeout %d)\n", fenumber, freq, feparams->dvb_feparams.frequency, freq_offset, TIMEOUT_MAX_MS); printf("[fe%d] tune to %d %s %s %s %s srate %d (tuner %d offset %d timeout %d)\n", fenumber, freq, s, m, f, - TP->polarization ? "V/R" : "H/L", feparams->dvb_feparams.u.qpsk.symbol_rate, feparams->dvb_feparams.frequency, freq_offset, TIMEOUT_MAX_MS); + TP->polarization & 1 ? "V/R" : "H/L", feparams->dvb_feparams.u.qpsk.symbol_rate, feparams->dvb_feparams.frequency, freq_offset, TIMEOUT_MAX_MS); setFrontend(feparams); #if 0 diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 05f25989a..226b59f42 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -69,8 +69,8 @@ #endif #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include /* globals */ int sig_delay = 2; // seconds between signal check @@ -109,8 +109,7 @@ CZapit::CZapit() { started = false; pmt_update_fd = -1; - volume_left = 0, volume_right = 0; - def_volume_left = 0, def_volume_right = 0; + //volume_left = 0, volume_right = 0; audio_mode = 0; aspectratio=0; mode43=0; @@ -122,6 +121,8 @@ CZapit::CZapit() playing = false; list_changed = false; // flag to indicate, allchans was changed currentMode = 0; + current_volume = 100; + volume_percent = 0; } CZapit::~CZapit() @@ -240,6 +241,38 @@ void CZapit::SaveAudioMap() fclose(audio_config_file); } +void CZapit::LoadVolumeMap() +{ + vol_map.clear(); + FILE *volume_config_file = fopen(VOLUME_CONFIG_FILE, "r"); + if (!volume_config_file) { + perror(VOLUME_CONFIG_FILE); + return; + } + t_channel_id chan; + int apid = 0; + int volume = 0; + char s[1000]; + while (fgets(s, 1000, volume_config_file)) { + if (sscanf(s, "%llx %d %d", &chan, &apid, &volume) == 3) + vol_map.insert(volume_pair_t(chan, pid_pair_t(apid, volume))); + } + fclose(volume_config_file); +} + +void CZapit::SaveVolumeMap() +{ + FILE *volume_config_file = fopen(VOLUME_CONFIG_FILE, "w"); + if (!volume_config_file) { + perror(VOLUME_CONFIG_FILE); + return; + } + for (volume_map_iterator_t it = vol_map.begin(); it != vol_map.end(); ++it) + fprintf(volume_config_file, "%llx %d %d\n", (uint64_t) it->first, it->second.first, it->second.second); + + fdatasync(fileno(volume_config_file)); + fclose(volume_config_file); +} void CZapit::LoadSettings() { @@ -285,6 +318,7 @@ void CZapit::LoadSettings() /**/ LoadAudioMap(); + LoadVolumeMap(); } void CZapit::ConfigFrontend() @@ -324,10 +358,10 @@ void CZapit::SaveChannelPids(CZapitChannel* channel) if(channel == NULL) return; - printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel->getAudioPid(), dvbsub_getpid(), audio_mode, volume_right); + printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel->getAudioPid(), dvbsub_getpid(), audio_mode, current_volume); audio_map[channel->getChannelID()].apid = channel->getAudioPid(); audio_map[channel->getChannelID()].mode = audio_mode; - audio_map[channel->getChannelID()].volume = audioDecoder->getVolume(); + audio_map[channel->getChannelID()].volume = current_volume; audio_map[channel->getChannelID()].subpid = dvbsub_getpid(); tuxtx_subtitle_running(&audio_map[channel->getChannelID()].ttxpid, &audio_map[channel->getChannelID()].ttxpage, NULL); } @@ -344,19 +378,9 @@ void CZapit::RestoreChannelPids(CZapitChannel * channel) if (channel->getAudioChannel(i)->pid == pidmap->apid ) { DBG("***** Setting audio!\n"); channel->setAudioChannel(i); -#if 0 - if(we_playing && (channel->getAudioChannel(i)->audioChannelType != CZapitAudioChannel::MPEG)) - ChangeAudioPid(i); -#endif } } } -#if 0 // to restore saved volume per channel if needed. after first zap its done by neutrino - if(firstzap) { - audioDecoder->setVolume(audio_map_it->second.volume, audio_map_it->second.volume); - } -#endif - volume_left = volume_right = pidmap->volume; audio_mode = pidmap->mode; dvbsub_setpid(pidmap->subpid); @@ -374,12 +398,10 @@ void CZapit::RestoreChannelPids(CZapitChannel * channel) else tuxtx_set_pid(pidmap->ttxpid, pidmap->ttxpage, (char *) tmplang.c_str()); } else { - volume_left = volume_right = def_volume_left; audio_mode = def_audio_mode; tuxtx_set_pid(0, 0, (char *) channel->getTeletextLang()); } /* restore saved stereo / left / right channel mode */ - //audioDecoder->setVolume(volume_left, volume_right); audioDecoder->setChannel(audio_mode); } @@ -443,15 +465,13 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay bool failed = false; CZapitChannel* newchannel; - DBG("[zapit] zapto channel id %llx diseqcType %d\n", channel_id, diseqcType); - abort_zapit = 0; if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id, ¤t_is_nvod)) == NULL) { - DBG("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id); + INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id); return false; } - printf("[zapit] zap to %s (%llx tp %llx)\n", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); + INFO("[zapit] zap to %s (%llx tp %llx)", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel); if(fe == NULL) { @@ -552,6 +572,85 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id) return true; } +/* set channel/pid volume percent, using current channel_id and pid, if those params is 0 */ +void CZapit::SetPidVolume(t_channel_id channel_id, int pid, int percent) +{ + if (!channel_id) + channel_id = live_channel_id; + + if (!pid && (channel_id == live_channel_id) && current_channel) + pid = current_channel->getAudioPid(); + +INFO("############################### channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); + volume_map_range_t pids = vol_map.equal_range(channel_id); + for (volume_map_iterator_t it = pids.first; it != pids.second; ++it) { + if (it->second.first == pid) { + it->second.second = percent; + return; + } + } + vol_map.insert(volume_pair_t(channel_id, pid_pair_t(pid, percent))); +} + +/* return channel/pid volume percent, using current channel_id and pid, if those params is 0 */ +int CZapit::GetPidVolume(t_channel_id channel_id, int pid, bool ac3) +{ + int percent = -1; + + if (!channel_id) + channel_id = live_channel_id; + + if (!pid && (channel_id == live_channel_id) && current_channel) + pid = current_channel->getAudioPid(); + + volume_map_range_t pids = vol_map.equal_range(channel_id); + for (volume_map_iterator_t it = pids.first; it != pids.second; ++it) { + if (it->second.first == pid) { + percent = it->second.second; + break; + } + } + if (percent < 0) { + percent = ac3 ? VOLUME_PERCENT_AC3 : VOLUME_PERCENT_PCM; + if ((channel_id == live_channel_id) && current_channel) { + for (int i = 0; i < current_channel->getAudioChannelCount(); i++) { + if (pid == current_channel->getAudioPid(i)) { + percent = current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AC3 ? + VOLUME_PERCENT_AC3 : VOLUME_PERCENT_PCM; + break; + } + } + } + } + DBG("channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); + return percent; +} + +void CZapit::SetVolume(int vol) +{ + current_volume = vol; + if (current_volume < 0) + current_volume = 0; + if (current_volume > 100) + current_volume = 100; + + int value = (current_volume * volume_percent) / 100; + DBG("volume %d percent %d -> %d", current_volume, volume_percent, value); + audioDecoder->setVolume(value, value); + //volume_left = volume_right = current_volume; +} + +int CZapit::SetVolumePercent(int percent) +{ + int ret = volume_percent; + + if (volume_percent != percent) { + volume_percent = percent; + SetVolume(current_volume); + } + return ret; +} + void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioChannelType) { const char *audioStr = "UNKNOWN"; @@ -581,6 +680,10 @@ void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioC break; } + /* FIXME: bigger percent for AC3 only, what about AAC etc ? */ + int newpercent = GetPidVolume(0, 0, audioChannelType == CZapitAudioChannel::AC3); + SetVolumePercent(newpercent); + printf("[zapit] starting %s audio\n", audioStr); } @@ -1471,15 +1574,21 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) case CZapitMessages::CMD_SET_VOLUME: { CZapitMessages::commandVolume msgVolume; CBasicServer::receive_data(connfd, &msgVolume, sizeof(msgVolume)); +#if 0 audioDecoder->setVolume(msgVolume.left, msgVolume.right); volume_left = msgVolume.left; volume_right = msgVolume.right; +#endif + SetVolume(msgVolume.left); break; } case CZapitMessages::CMD_GET_VOLUME: { CZapitMessages::commandVolume msgVolume; +#if 0 msgVolume.left = volume_left; msgVolume.right = volume_right; +#endif + msgVolume.left = msgVolume.right = current_volume; CBasicServer::send_data(connfd, &msgVolume, sizeof(msgVolume)); break; } @@ -1808,6 +1917,9 @@ bool CZapit::StopPlayBack(bool send_pmt) else dvbsub_stop(); + /* reset volume percent to 100% i.e. for media playback, should be safe + * because StartPlayBack will use defaults or saved value */ + SetVolumePercent(100); return true; } @@ -1821,6 +1933,7 @@ void CZapit::enterStandby(void) SaveSettings(true); SaveAudioMap(); + SaveVolumeMap(); StopPlayBack(true); if(!(currentMode & RECORD_MODE)) { @@ -1912,6 +2025,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) live_fe = CFEManager::getInstance()->getFE(0); /* load configuration or set defaults if no configuration file exists */ video_mode = ZapStart_arg->video_mode; + current_volume = ZapStart_arg->volume; videoDemux = new cDemux(); videoDemux->Open(DMX_VIDEO_CHANNEL); @@ -2090,6 +2204,7 @@ void CZapit::run() SaveChannelPids(current_channel); SaveSettings(true); SaveAudioMap(); + SaveVolumeMap(); StopPlayBack(true); CFEManager::getInstance()->saveSettings(true);