From 721ba0b47f3c28cf1381785e0bfe582a9bfbb086 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 15 Aug 2012 09:47:59 +0400 Subject: [PATCH 01/78] Revert "neutrino.cpp:use yes in shutdown message as default" - it breaks inactivity standby This reverts commit af74eb4f7e1ba9b56a3ebe7a157295e7b8134754. --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 63e6c5b25..b822dac89 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2728,7 +2728,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 +2774,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) { From 7d723aa44f8127bb91cbafd65b80f2686dc23245 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:47:24 +0400 Subject: [PATCH 02/78] gui/movieinfo.cpp: fix channel id loading --- src/gui/movieinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index e5c4f0912..373bf5da4 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -608,7 +608,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;\ } From b7a9d81a500f5a76c8c3cac2bc2d339e4936b19e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:51:32 +0400 Subject: [PATCH 03/78] zapit/src/zapit.cpp: add support for adjusting volume per channel/pid --- src/zapit/include/zapit/zapit.h | 27 +++++- src/zapit/src/zapit.cpp | 149 ++++++++++++++++++++++++++++---- 2 files changed, 158 insertions(+), 18 deletions(-) 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/zapit.cpp b/src/zapit/src/zapit.cpp index a7ae43bfd..143ee9ef3 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -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); } @@ -552,6 +574,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; + } + } + } + } +INFO("############################### 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; +INFO("############ 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 +682,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 +1576,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 +1919,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 +1935,7 @@ void CZapit::enterStandby(void) SaveSettings(true); SaveAudioMap(); + SaveVolumeMap(); StopPlayBack(true); if(!(currentMode & RECORD_MODE)) { @@ -1912,6 +2027,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); @@ -2088,6 +2204,7 @@ void CZapit::run() SaveChannelPids(current_channel); SaveSettings(true); SaveAudioMap(); + SaveVolumeMap(); StopPlayBack(true); CFEManager::getInstance()->saveSettings(true); From a00a4ba99b3f3c8b6e05c7afad1f498297acb4c2 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:52:38 +0400 Subject: [PATCH 04/78] locals: add locale for volume percent adjustment --- data/locale/english.locale | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 3 files changed, 3 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index 10e8c4549..cf1b82a6b 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 diff --git a/src/system/locals.h b/src/system/locals.h index 2924e2be1..e8604244c 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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0b444b03a..e7418153a 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", From 7d0be6d58d8da9652d731fd294274756c651a6a8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:53:12 +0400 Subject: [PATCH 05/78] neutrino.cpp: pass initial volume to zapit at startup --- src/neutrino.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b822dac89..3ea3be5cf 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1798,13 +1798,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); From 49f67b02f43009a5fdbdeb3d4bfb834408b4b9ad Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:54:10 +0400 Subject: [PATCH 06/78] driver/volume.cpp: inherit from CChangeObserver; add changeNotify() for adjusting volume percent --- src/driver/volume.cpp | 24 +++++++++++++++++++++++- src/driver/volume.h | 10 ++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index a5534d80d..c0049d514 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #if HAVE_COOL_HARDWARE #include @@ -62,6 +63,8 @@ CVolume::CVolume() ShadowOffset = 4; mute_ay = 0; m_mode = CNeutrinoApp::getInstance()->getMode(); + channel_id = 0; + apid = 0; Init(); } @@ -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) @@ -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..fe10a2ea7 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -30,7 +30,7 @@ #define ROUNDED g_settings.rounded_corners ? vbar_h/2 : 0 -class CVolume +class CVolume : public CChangeObserver { private: void refreshVolumebar(int current_volume); @@ -47,6 +47,9 @@ class CVolume int rounded; int m_mode; bool paintShadow, paintDigits, MuteIconFrame; + /* volume adjustment variables */ + t_channel_id channel_id; + int apid; public: CVolume(); @@ -60,7 +63,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__ From b8f78e9c5d64b0a71d44a2333b9e676a08cc0ad1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:55:59 +0400 Subject: [PATCH 07/78] gui/audio_select.cpp: add PID volume adjusting --- src/gui/audio_select.cpp | 69 ++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index e75e74742..ab66db7b6 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CAudioSetupNotifier * audioSetupNotifier; @@ -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, ""); } From e621f644f811d8411d4a708ed1f1fece366e2314 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Aug 2012 15:56:17 +0400 Subject: [PATCH 08/78] gui/movieplayer.cpp: add PID volume adjusting --- src/gui/movieplayer.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 373e2e031..a542c066a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -422,8 +423,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 +791,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); From c8c932bdc9bc6efeb847a257c2e0cc6edb84d0e2 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Fri, 17 Aug 2012 00:22:10 +0200 Subject: [PATCH 09/78] * Update deutsch.locale --- data/locale/deutsch.locale | 1 + 1 file changed, 1 insertion(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d09ead308..9fe90755b 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 From c93b3cb4897cb200a160680516b712f94262c197 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 18 Aug 2012 15:26:07 +0200 Subject: [PATCH 10/78] - yweb: fix border-radius for old browsers --- src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm | 2 +- src/nhttpd/web/Y_Main.css | 70 +++++++++++++++++++++-- src/nhttpd/web/Y_Version.txt | 4 +- 3 files changed, 69 insertions(+), 7 deletions(-) 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 From ec7ed403a1e8aadebf97521c3e993c69fdcf00c1 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 19 Aug 2012 19:54:55 +0200 Subject: [PATCH 11/78] channellist.cpp: -fix clear background --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 06f6226e1..7a4d42231 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1574,7 +1574,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 != "") { From f3ac0b9fd92c6c06c3a33b4451e877bbc537aeed Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Jul 2012 22:31:24 +0200 Subject: [PATCH 12/78] *CVolume: move static g_volscale to volscale - Is only needed in this class, not global. - move scope of variable x_corr. (style) scope of the variable x_corr can be limited - move declaration of framebuffer into header file --- src/driver/volume.cpp | 22 +++++++++++----------- src/driver/volume.h | 6 +++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index c0049d514..35f75ea4e 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -44,14 +43,13 @@ #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; @@ -71,8 +69,7 @@ CVolume::CVolume() CVolume::~CVolume() { - if (g_volscale) - delete g_volscale; + delete volscale; } void CVolume::Init() @@ -82,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; @@ -108,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; @@ -143,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; @@ -152,6 +151,7 @@ void CVolume::Init() } x = sw - vbar_w - x_corr; break; + } case 1:// upper left break; case 2:// bottom left @@ -251,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); } @@ -357,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) diff --git a/src/driver/volume.h b/src/driver/volume.h index fe10a2ea7..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 : public CChangeObserver { private: + CFrameBuffer * frameBuffer; + CProgressBar *volscale; void refreshVolumebar(int current_volume); int x, y, sy, sw, sh; @@ -55,7 +59,7 @@ class CVolume : public CChangeObserver CVolume(); ~CVolume(); static CVolume* getInstance(); - + int spacer, mute_dx; void Init(); void AudioMute(int newValue, bool isEvent= false); From 260af3fb6535c3530d2ac11d319b736f48841299 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Jul 2012 22:56:32 +0200 Subject: [PATCH 13/78] *COsdSetup: change order of includes - typo fix in member name showOsdScreenshottSetup->showOsdScreenShotSetup --- src/gui/osd_setup.cpp | 13 ++++++------- src/gui/osd_setup.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f00c98c38..688c37c87 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 @@ -434,7 +433,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); @@ -923,7 +922,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); From d1f22aa20c7a71752f1bc043cca2e25afa304208 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Aug 2012 23:01:34 +0200 Subject: [PATCH 14/78] *includes: add global.h --- src/gui/moviebrowser.cpp | 2 ++ src/gui/movieinfo.cpp | 2 ++ src/gui/widget/listframe.cpp | 2 ++ src/gui/widget/listframe.h | 4 ++-- src/gui/widget/msgbox.cpp | 2 ++ src/gui/widget/textbox.cpp | 2 ++ src/gui/widget/textbox.h | 3 ++- 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 219d90c2f..243a870e2 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -47,6 +47,8 @@ #include #endif +#include + #include #include #include "moviebrowser.h" diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 373bf5da4..004a573bc 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -46,6 +46,8 @@ #include #endif +#include + #include #include #include diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index a124d993a..b5c79b107 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -49,6 +49,8 @@ #include #endif +#include + #include "stdlib.h" #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/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/textbox.cpp b/src/gui/widget/textbox.cpp index bba0b0d63..938633d2d 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -55,6 +55,8 @@ #include #endif +#include + #include "textbox.h" #include diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index b639b75b9..09338c6d2 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 From 39306221b1d75acb6e9d8bb506b3d5e433913672 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 16 Aug 2012 17:38:43 +0200 Subject: [PATCH 15/78] *CTextbox: Required functions for CCompoments - Add member to disable background box - Add setter for text an background color - Add setTextBorderWidth() & setTextFont() - Calculate y-position of text in refreshText() --- src/gui/widget/textbox.cpp | 72 +++++++++++++++++++++++--------------- src/gui/widget/textbox.h | 13 ++++++- 2 files changed, 55 insertions(+), 30 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 938633d2d..3bab0f7ce 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -60,7 +60,6 @@ #include "textbox.h" #include -#define TEXT_BORDER_WIDTH 8 #define SCROLL_FRAME_WIDTH 10 #define SCROLL_MARKER_BORDER 2 @@ -165,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; @@ -174,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; @@ -198,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; @@ -235,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", @@ -280,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); @@ -299,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); @@ -371,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) @@ -429,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 09338c6d2..a308d05f9 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -118,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(); @@ -139,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);}; From 9a889e1496fef789021b5443476c78d4d885cefc Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 21 Aug 2012 14:06:18 +0200 Subject: [PATCH 16/78] tuxtxt.h: remove unnecessary header --- lib/libtuxtxt/tuxtxt.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index a02125b81..fb639bb7d 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -32,10 +32,6 @@ #include -#ifndef NEW_CST_KERNEL -#include -#endif - #include #include From abed344501d93bc1437ec8bcb94f154fe2bdfbaf Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 22 Aug 2012 09:37:46 +0200 Subject: [PATCH 17/78] plugins.cpp: use popen2 with vfork for script plugins --- src/gui/plugins.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index de8b7fbb0..d04e0b9a5 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include #include #include @@ -313,6 +315,53 @@ void CPlugins::startPlugin(const char * const name) else printf("[CPlugins] could not find %s\n", name); +} + #include + +FILE* popen2( 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); } void CPlugins::startScriptPlugin(int number) @@ -325,7 +374,8 @@ void CPlugins::startScriptPlugin(int number) script, plugin_list[number].cfgfile.c_str()); return; } - FILE *f = popen(script,"r"); + pid_t pid = 0; + FILE *f = popen2(pid,script,"r"); if (f != NULL) { char *output=NULL; @@ -335,6 +385,7 @@ void CPlugins::startScriptPlugin(int number) { scriptOutput += output; } + kill(pid, SIGINT ); pclose(f); if(output) free(output); From a6d0331ed9d98aa6368bdd0dfacdd31e776acdf6 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 22 Aug 2012 09:39:08 +0200 Subject: [PATCH 18/78] plugins.cpp: use popen2 with vfork for script plugins --- src/gui/plugins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index d04e0b9a5..0cfb0287b 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -316,7 +317,6 @@ void CPlugins::startPlugin(const char * const name) printf("[CPlugins] could not find %s\n", name); } - #include FILE* popen2( pid_t& pid, const char *cmdstring, const char *type) { int pfd[2] ={-1,-1}; From d284f5fce5713d2abd8fca0cdb40a75979894b03 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 25 Aug 2012 15:00:32 +0200 Subject: [PATCH 19/78] - locales: very tiny typo --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 9fe90755b..8330c1220 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -867,7 +867,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 diff --git a/data/locale/english.locale b/data/locale/english.locale index cf1b82a6b..d774de83a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -867,7 +867,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 From fe0f7ad28e4ea464bec079376bfa5cfa4dfa1039 Mon Sep 17 00:00:00 2001 From: swing99 Date: Tue, 28 Aug 2012 17:17:17 +0200 Subject: [PATCH 20/78] - cables.xml: update Kabel Deutschland - Offensive 2012 --- data/cables.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/data/cables.xml b/data/cables.xml index b0b9f8965..619c3279a 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -1337,6 +1337,7 @@ + From b92660259c59af1daec4ee936fa59750d01fa4ac Mon Sep 17 00:00:00 2001 From: FlatTV Date: Thu, 30 Aug 2012 07:19:52 +0200 Subject: [PATCH 21/78] Add global helpers my_system() and my_popen() --- src/gui/plugins.cpp | 7 +- src/system/Makefile.am | 15 ++-- src/system/configure_network.cpp | 26 ------- src/system/helpers.cpp | 115 +++++++++++++++++++++++++++++++ src/system/helpers.h | 39 +++++++++++ 5 files changed, 169 insertions(+), 33 deletions(-) create mode 100644 src/system/helpers.cpp create mode 100644 src/system/helpers.h diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 0cfb0287b..8a0e1c7e9 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -54,6 +54,8 @@ #include #include +#include + #include #include "plugins.h" @@ -375,7 +377,7 @@ void CPlugins::startScriptPlugin(int number) return; } pid_t pid = 0; - FILE *f = popen2(pid,script,"r"); + FILE *f = my_popen(pid,script,"r"); if (f != NULL) { char *output=NULL; @@ -396,7 +398,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 @@ -643,7 +644,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/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..ead2b3227 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -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..410dd1294 --- /dev/null +++ b/src/system/helpers.cpp @@ -0,0 +1,115 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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 + +int my_system(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 vfork */ + 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; +} + +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); +} diff --git a/src/system/helpers.h b/src/system/helpers.h new file mode 100644 index 000000000..d041cdcae --- /dev/null +++ b/src/system/helpers.h @@ -0,0 +1,39 @@ + +#ifndef __system_helpers__ +#define __system_helpers__ + +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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); +FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); + +#endif From ae73a950ebf012d48216fa3be7b776b1bf417f1d Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 30 Aug 2012 09:30:14 +0200 Subject: [PATCH 22/78] - system/helpers.h|cpp: change header --- src/system/helpers.cpp | 13 +------------ src/system/helpers.h | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 410dd1294..4e3758ad4 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1,16 +1,5 @@ /* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Neutrino-HD License: GPL diff --git a/src/system/helpers.h b/src/system/helpers.h index d041cdcae..9fd335f3b 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -3,18 +3,7 @@ #define __system_helpers__ /* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Neutrino-HD License: GPL From ba051aaf41a6ba4e2abcab4e22979be82ade04b0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 11:31:05 +0400 Subject: [PATCH 23/78] gui/user_menue.cpp: comment unused code --- src/gui/user_menue.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f36e5f40d..e9c7c0c7b 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -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; } From fb68bff086df80e814fbd0c8f7758c16822b6458 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 11:32:29 +0400 Subject: [PATCH 24/78] eitd/sectionsd.cpp: move public functions to CEitManager class --- src/eitd/sectionsd.cpp | 136 +++++++++++++++++++---------------------- src/eitd/sectionsd.h | 18 +++--- 2 files changed, 75 insertions(+), 79 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 802ffacea..a30162cd5 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; @@ -2107,8 +2106,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 +2167,69 @@ 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; + eList.clear(); + serviceUniqueKey &= 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 + if(serviceUniqueKey == 0) + return; - 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; + // service Found + readLockEvents(); + int serviceIDfound = 0; - 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; - } + if (search_text.length()) + std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); - 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 + for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) + { + if ((*e)->get_channel_id() == serviceUniqueKey) { + 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 +2243,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); @@ -2434,7 +2435,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 +2460,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,7 +2504,7 @@ 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 uniqueServiceKey, CEPGData * epgdata) { bool ret = false; SIevent evt; @@ -2573,7 +2574,7 @@ bool channel_in_requested_list(t_channel_id * clist, t_channel_id chid, int len) } /* 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, const bool tv_mode, t_channel_id *chidlist, int clen) { clen = clen / sizeof(t_channel_id); @@ -2632,7 +2633,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 +2663,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,7 +2694,7 @@ 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 uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list) { bool ret = false; dprintf("Request of NVOD times for " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey); @@ -2732,17 +2733,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..45db009f4 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, const bool tv_mode = true, 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 From 27d47c52c064ffd5112408a86feef295d3824c72 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 11:32:54 +0400 Subject: [PATCH 25/78] timerd/Makefile.am: add include path --- src/timerd/Makefile.am | 1 + 1 file changed, 1 insertion(+) 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 \ From 6c9a949c692e990ad766df74b4d5955dfdeff169 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 11:38:46 +0400 Subject: [PATCH 26/78] cross-configure.cool.debug: change prefix --- cross-configure.cool.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-configure.cool.debug b/cross-configure.cool.debug index 6ce9ebed1..4ae70b853 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 From 74a761ef50aa1acc68c00bdd778b0a37f1f9396d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 11:40:02 +0400 Subject: [PATCH 27/78] use CEitManager to get EIT data --- src/daemonc/remotecontrol.cpp | 17 +++------- src/driver/record.cpp | 16 ++++----- src/driver/screenshot.cpp | 7 ++-- src/gui/channellist.cpp | 12 +++---- src/gui/epgplus.cpp | 10 +++--- src/gui/epgview.cpp | 20 +++-------- src/gui/eventlist.cpp | 29 +++++----------- src/gui/infoviewer.cpp | 14 +++----- src/gui/osdlang_setup.cpp | 6 ++-- src/gui/timerlist.cpp | 10 +++--- src/neutrino.cpp | 14 +------- .../tuxboxapi/coolstream/controlapi.cpp | 34 ++++++++----------- .../tuxboxapi/coolstream/neutrinoapi.cpp | 5 ++- .../tuxboxapi/coolstream/neutrinoyparser.cpp | 20 +++++------ src/timerd/timermanager.cpp | 14 ++++---- 15 files changed, 76 insertions(+), 152 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index d6659148d..fbc608f64 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -48,6 +48,7 @@ #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 & 0xFFFFFFFFFFFFULL, 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/record.cpp b/src/driver/record.cpp index 269a4b442..2436db6b3 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -54,6 +54,7 @@ #include #include #include +#include /* TODO: * nextRecording / pending recordings - needs testing @@ -63,11 +64,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 } @@ -353,7 +349,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) { @@ -403,7 +399,7 @@ record_error_msg_t CRecordInstance::Record() 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&0xFFFFFFFFFFFFULL, &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 +504,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 +610,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 +799,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&0xFFFFFFFFFFFFULL, &epgData )) { eventinfo.epgID = epgData.eventID; eventinfo.epg_starttime = epgData.epg_times.startzeit; strncpy(eventinfo.epgTitle, epgData.title.c_str(), EPG_TITLE_MAXLEN-1); diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 7aea07577..c24ca5437 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&0xFFFFFFFFFFFFULL, &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/gui/channellist.cpp b/src/gui/channellist.cpp index 7a4d42231..0d52faf6e 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -73,6 +73,8 @@ #include #include +#include + extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; @@ -88,10 +90,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 +173,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 && @@ -198,7 +196,7 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) p_requested_channels[count] = chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL; } CChannelEventList levents; - sectionsd_getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); + CEitManager::getInstance()->getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); 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 +1542,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 & 0xFFFFFFFFFFFFULL, 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 ); 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/epgview.cpp b/src/gui/epgview.cpp index 40f6616be..9bf54faa6 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&0xFFFFFFFFFFFFULL, &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..141631200 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -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&0xFFFFFFFFFFFFULL, &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 +1024,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 +1038,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/infoviewer.cpp b/src/gui/infoviewer.cpp index 595044fc6..ab75da82b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -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 & 0xFFFFFFFFFFFFULL, 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; @@ -1270,8 +1265,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 & 0xFFFFFFFFFFFFULL, info); //printf("CInfoViewer::getEPG: old uniqueKey %llx new %llx\n", oldinfo.current_uniqueKey, info.current_uniqueKey); 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/timerlist.cpp b/src/gui/timerlist.cpp index 45803538a..b5c2605c0 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -51,7 +51,6 @@ #include #include - #include #include #include @@ -69,6 +68,8 @@ #include #include +#include + extern CBouquetManager *g_bouquetManager; #include @@ -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; @@ -1227,8 +1226,7 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) 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)) + if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata)) { timerbuf += ":"; timerbuf += epgdata.title; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3ea3be5cf..3b333b3e7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -140,12 +140,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 +1569,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) @@ -2669,8 +2660,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) { @@ -3550,7 +3540,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(); @@ -3568,7 +3557,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/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index e53469824..f5e496eaa 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 & 0xFFFFFFFFFFFFULL, 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&0xFFFFFFFFFFFFULL, 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&0xFFFFFFFFFFFFULL, 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..0ce62cf6d 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&0xFFFFFFFFFFFFULL, &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&0xFFFFFFFFFFFFULL, 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&0xFFFFFFFFFFFFULL, &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&0xFFFFFFFFFFFFULL, 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&0xFFFFFFFFFFFFULL, 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/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 9a34d4f89..83227c53c 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 &0xFFFFFFFFFFFFULL, 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 &0xFFFFFFFFFFFFULL, 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; } } From 8d02122425f1cc9755eaf9f41332836cc7f0e6d3 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 14:46:57 +0400 Subject: [PATCH 28/78] eitd/sectionsd.cpp: add channel_id mask in getXXX --- src/eitd/sectionsd.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index a30162cd5..767ffc392 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2253,7 +2253,7 @@ void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSecti /* 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... */ @@ -2504,14 +2504,15 @@ bool CEitManager::getEPGid(const event_id_t epgID, const time_t startzeit, CEPGD return ret; } /* was commandActualEPGchannelID(int connfd, char *data, const unsigned dataLength) */ -bool CEitManager::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) { @@ -2567,7 +2568,7 @@ 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; @@ -2694,11 +2695,12 @@ bool CEitManager::getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSe } /* was static void commandTimesNVODservice(int connfd, char *data, const unsigned dataLength) */ -bool CEitManager::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(); From 3f5a0e5bb13152a8cf2f745d09284b67e8174da1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 14:50:01 +0400 Subject: [PATCH 29/78] remove channel_id mask for CEitManager getXXX calls --- src/daemonc/remotecontrol.cpp | 2 +- src/driver/record.cpp | 4 ++-- src/driver/screenshot.cpp | 2 +- src/gui/channellist.cpp | 2 +- src/gui/epgview.cpp | 2 +- src/gui/eventlist.cpp | 2 +- src/gui/infoviewer.cpp | 4 ++-- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 6 +++--- src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp | 10 +++++----- src/timerd/timermanager.cpp | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index fbc608f64..79bacc428 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -396,7 +396,7 @@ void CRemoteControl::getNVODs() if ( subChannels.empty() ) { CSectionsdClient::NVODTimesList NVODs; - if (CEitManager::getInstance()->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()); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 2436db6b3..f10f922d3 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -399,7 +399,7 @@ record_error_msg_t CRecordInstance::Record() CEPGData epgData; epgData.epg_times.startzeit = 0; epgData.epg_times.dauer = 0; - if (CEitManager::getInstance()->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; @@ -799,7 +799,7 @@ bool CRecordManager::Record(const t_channel_id channel_id, const char * dir, boo eventinfo.eventID = 0; eventinfo.channel_id = channel_id; - if (CEitManager::getInstance()->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); diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index c24ca5437..95a146daf 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -369,7 +369,7 @@ void CScreenShot::MakeFileName(const t_channel_id channel_id) } pos = strlen(fname); - if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData)) { + if(CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData)) { CShortEPGData epgdata; if(CEitManager::getInstance()->getEPGidShort(epgData.eventID, &epgdata)) { if (!(epgdata.title.empty())) { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 0d52faf6e..65c5286ba 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1542,7 +1542,7 @@ void CChannelList::paintDetails(int index) char buf[128] = {0}; char cFrom[50] = {0}; // UTF-8 CSectionsdClient::CurrentNextInfo CurrentNext; - CEitManager::getInstance()->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 ); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9bf54faa6..919a869d1 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -948,7 +948,7 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* st if ( id!= 0 ) res = CEitManager::getInstance()->getEPGid(id, *startzeit, &epgData); else - res = CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData ); + res = CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData ); if ( res ) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 141631200..4a2ee9eef 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -156,7 +156,7 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) CEPGData epgData; // todo: what if there are more than one events in the Portal - if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) + if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData )) { // epgData.eventID; // epgData.epg_times.startzeit; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ab75da82b..8312763cb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -384,7 +384,7 @@ void CInfoViewer::paintBackground(int col_NumBox) void CInfoViewer::show_current_next(bool new_chan, int epgpos) { - CEitManager::getInstance()->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 ) { @@ -1265,7 +1265,7 @@ CSectionsdClient::CurrentNextInfo CInfoViewer::getEPG (const t_channel_id for_ch { static CSectionsdClient::CurrentNextInfo oldinfo; - CEitManager::getInstance()->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); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index f5e496eaa..d737dbf0a 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -893,7 +893,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann if (event) { if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); timestr = timeString(event->startTime); firstEPG += hh->outPair("startTime", timestr, true); @@ -1502,7 +1502,7 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) { for(unsigned int i=0; i< desc.size(); i++) @@ -1642,7 +1642,7 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 0ce62cf6d..a4ba3bce3 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -287,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\"" : ""; - CEitManager::getInstance()->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; } @@ -392,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 (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) + if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id, nvod_list)) { CZapitClient::subServiceList subServiceList; @@ -409,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)! - CEitManager::getInstance()->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("%s
ChannelListEvents[channel->channel_id])) { bool has_current_next = true; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); timestr = timeString(event->startTime); yresult += string_printf("",classname); @@ -543,7 +543,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 83227c53c..ef84e1526 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1220,7 +1220,7 @@ void CTimerEvent_Record::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - CEitManager::getInstance()->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 ) @@ -1268,7 +1268,7 @@ void CTimerEvent_Zapto::getEpgId() { //TODO: Record/Zapto getEpgId code almost identical ! CChannelEventList evtlist; - CEitManager::getInstance()->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 ) From a391bf32376250ce2a476b239438aec7d6b3f28c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 15:54:49 +0400 Subject: [PATCH 30/78] lib/sectionsdclient/sectionsdMsg.h: cleanup commands, comment unused --- lib/sectionsdclient/sectionsdMsg.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) 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 { From 6eaa28449b84dbe9c1f9e9216874aa0f93b299aa Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 15:55:32 +0400 Subject: [PATCH 31/78] lib/sectionsdclient/sectionsdclient.cpp,h: comment unused --- lib/sectionsdclient/sectionsdclient.cpp | 122 +++++++++++------------- lib/sectionsdclient/sectionsdclient.h | 51 ++++------ 2 files changed, 75 insertions(+), 98 deletions(-) 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 From 7d1bb02f6a79714d0389a52964a2fd415cfcc182 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 15:55:50 +0400 Subject: [PATCH 32/78] eitd/sectionsd.cpp: cleanup commands --- src/eitd/sectionsd.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 767ffc392..5305359f4 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1183,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" }, From 338fd16ec764707563d7da765423c2379fe503ef Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 17:57:23 +0400 Subject: [PATCH 33/78] driver/record.cpp: remove not needed struct init --- src/driver/record.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f10f922d3..b11a6fbb1 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -397,8 +397,6 @@ record_error_msg_t CRecordInstance::Record() { int pre=0, post=0; CEPGData epgData; - epgData.epg_times.startzeit = 0; - epgData.epg_times.dauer = 0; if (CEitManager::getInstance()->getActualEPGServiceKey(channel_id, &epgData )) { g_Timerd->getRecordingSafety(pre, post); if (epgData.epg_times.startzeit > 0) From 25e4a396d7cb8096d81db2ca73a07fc5bfba5f7d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 18:11:14 +0400 Subject: [PATCH 34/78] gui/channellist.cpp: fix p_requested_channels allocate size --- src/gui/channellist.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 65c5286ba..078e5e467 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -186,17 +186,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; - CEitManager::getInstance()->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) { From 95b6e1234691261a7c3669df42328eb2dee463ee Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 Aug 2012 18:12:07 +0400 Subject: [PATCH 35/78] eitd/sectionsd.cpp: remove unused getChannelEvents() arg --- src/eitd/sectionsd.cpp | 5 +---- src/eitd/sectionsd.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 5305359f4..cedda59ee 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2563,16 +2563,13 @@ bool channel_in_requested_list(t_channel_id * clist, t_channel_id chid, int len) } /* 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 CEitManager::getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen) +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(); diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index 45db009f4..2181502f6 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -60,7 +60,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex 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, const bool tv_mode = true, t_channel_id *chidlist = NULL, int clen = 0); + 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); From 29ecf0d7421f5eeed7bc01942aa91e6fa4a6d5a6 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 31 Aug 2012 12:00:52 +0400 Subject: [PATCH 36/78] locals: add new locale for playback bookmark menu head --- data/locale/english.locale | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 3 files changed, 3 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index d774de83a..98be2cca6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1159,6 +1159,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/src/system/locals.h b/src/system/locals.h index e8604244c..39ab0ca6d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1186,6 +1186,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 e7418153a..48c4d9a98 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1186,6 +1186,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", From dc1e60eee10325e1babc85ebb80c3ccf4dc02110 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 31 Aug 2012 12:01:46 +0400 Subject: [PATCH 37/78] gui/movieplayer.cpp: change playback bookmark menu head locale; change 'new bookmark' menu point locale --- src/gui/movieplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index a542c066a..dbdb1b020 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -998,13 +998,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])); From 1e1a3265e6aa5fb40f4fb460f7cab5a1a91f12c9 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 5 Sep 2012 23:42:10 +0200 Subject: [PATCH 38/78] - tuxtxt: fix creation of /var/tuxbox/config/tuxtxt/ --- lib/libtuxtxt/tuxtxt.cpp | 9 +++++++-- lib/libtuxtxt/tuxtxt.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index c629daa6a..2a9da1f0a 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -18,6 +18,7 @@ #include "driver/framebuffer.h" #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 Date: Mon, 10 Sep 2012 19:18:32 +0400 Subject: [PATCH 39/78] locals: add hint for rotor move voltage --- data/locale/english.locale | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 3 files changed, 3 insertions(+) diff --git a/data/locale/english.locale b/data/locale/english.locale index 98be2cca6..3219c99bb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -976,6 +976,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 diff --git a/src/system/locals.h b/src/system/locals.h index 39ab0ca6d..fc39162e1 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1003,6 +1003,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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 48c4d9a98..eedc2a634 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1003,6 +1003,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", From b0bc4299ba29e1569e2e26952f18dff8134fc7aa Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 10 Sep 2012 19:19:05 +0400 Subject: [PATCH 40/78] gui/scan_setup.cpp: uncomment removed by error rotor move voltage --- src/gui/scan_setup.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index e92b3211e..b59936c4a 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -585,10 +585,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); From 52b2528da470040e498ad6489c8248aabb4829b4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 10 Sep 2012 19:19:36 +0400 Subject: [PATCH 41/78] zapit/src/frontend.cpp: fix debug --- src/zapit/src/frontend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 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 From a3bfab0bcd0a9326bc47e957e689df9a968bad8f Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 11 Sep 2012 20:31:33 +0200 Subject: [PATCH 42/78] remove doubles include --- lib/libdvbsub/dvbsub.cpp | 1 - lib/libdvbsub/dvbsubtitle.cpp | 2 +- lib/libtuxtxt/tuxtxt.cpp | 2 +- lib/xmltree/xmlparse.cpp | 2 +- lib/xmltree/xmlrole.c | 2 +- lib/xmltree/xmltok.c | 16 ++++++------- src/daemonc/remotecontrol.cpp | 4 ++-- src/driver/audioplay.cpp | 2 +- src/driver/netfile.cpp | 2 +- src/driver/pictureviewer/fb_display.cpp | 2 +- src/driver/pictureviewer/pictureviewer.cpp | 1 - src/driver/pictureviewer/pictureviewer.h | 2 +- src/driver/screen_max.cpp | 4 ++-- src/gui/audio_select.cpp | 4 ++-- src/gui/audio_setup.cpp | 2 +- src/gui/audioplayer.cpp | 2 -- src/gui/audioplayer.h | 10 ++++---- src/gui/audioplayer_setup.cpp | 6 ++--- src/gui/bedit/bouqueteditor_bouquets.cpp | 6 ++--- src/gui/bedit/bouqueteditor_channels.cpp | 4 ---- src/gui/bedit/bouqueteditor_chanselect.cpp | 3 +-- src/gui/bookmarkmanager.cpp | 1 - src/gui/bouquetlist.cpp | 1 - src/gui/cam_menu.cpp | 19 +++++++-------- src/gui/cec_setup.cpp | 2 +- src/gui/channellist.cpp | 4 +--- src/gui/epgplus.h | 1 - src/gui/eventlist.cpp | 2 +- src/gui/hdd_menu.cpp | 16 ++++++------- src/gui/info_menue.cpp | 6 ++--- src/gui/infoclock.h | 2 +- src/gui/infoviewer.cpp | 4 ++-- src/gui/infoviewer_bb.cpp | 4 ++-- src/gui/infoviewer_bb.h | 1 - src/gui/keybind_setup.cpp | 4 ++-- src/gui/mediaplayer.cpp | 8 +++---- src/gui/mediaplayer.h | 4 ++-- src/gui/mediaplayer_setup.cpp | 8 +++---- src/gui/miscsettings_menu.cpp | 14 +++++------ src/gui/miscsettings_menu.h | 1 - src/gui/motorcontrol.cpp | 2 +- src/gui/moviebrowser.cpp | 16 ++++++------- src/gui/moviebrowser.h | 12 +++++----- src/gui/movieplayer.cpp | 5 +--- src/gui/movieplayer.h | 12 +++++----- src/gui/network_service.cpp | 4 ++-- src/gui/network_setup.cpp | 6 ++--- src/gui/parentallock_setup.cpp | 2 +- src/gui/personalize.h | 4 ++-- src/gui/pictureviewer.h | 8 +++---- src/gui/pictureviewer_setup.cpp | 6 ++--- src/gui/proxyserver_setup.cpp | 2 +- src/gui/record_setup.cpp | 4 ++-- src/gui/scan.cpp | 2 +- src/gui/scan_setup.cpp | 13 +++++----- src/gui/screensetup.cpp | 2 +- src/gui/settings_manager.cpp | 10 ++++---- src/gui/subchannel_select.cpp | 2 +- src/gui/test_menu.cpp | 8 +++---- src/gui/timeosd.cpp | 3 +-- src/gui/timerlist.cpp | 1 - src/gui/update_menue.h | 2 +- src/gui/update_settings.cpp | 2 +- src/gui/update_settings.h | 2 +- src/gui/upnpbrowser.h | 10 ++++---- src/gui/user_menue.cpp | 28 +++++++++++----------- src/gui/user_menue_setup.cpp | 2 +- src/gui/vfd_setup.cpp | 2 +- src/gui/videosettings.cpp | 4 ++-- src/gui/widget/colorchooser.cpp | 2 +- src/gui/widget/listframe.cpp | 2 +- src/gui/widget/menue.cpp | 1 - src/gui/widget/msgbox.h | 1 - src/gui/widget/stringinput.h | 1 - src/gui/zapit_setup.cpp | 2 +- src/neutrino.cpp | 7 ++---- src/neutrino.h | 19 +++++++-------- src/neutrino_menue.cpp | 8 +++---- src/system/configure_network.cpp | 4 ++-- src/system/setting_helpers.cpp | 4 ++-- src/zapit/src/zapit.cpp | 4 ++-- 81 files changed, 188 insertions(+), 224 deletions(-) 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 2a9da1f0a..9ef4c5c67 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -15,7 +15,7 @@ #include "teletext.h" #include "tuxtxt.h" -#include "driver/framebuffer.h" +#include #include #include #include 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..24846d294 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -41,8 +41,8 @@ #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include #include 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/netfile.cpp b/src/driver/netfile.cpp index 2b6303cb2..8b0a85890 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -101,7 +101,7 @@ #endif #include "netfile.h" -#include "global.h" +#include #include #include #include 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/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/gui/audio_select.cpp b/src/gui/audio_select.cpp index ab66db7b6..cabf99de6 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -47,8 +47,8 @@ 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 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..4de5e4b28 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -60,14 +60,12 @@ #include #include -#include #include #include #include #include #include -#include #include #include 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..3aca47ae6 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -33,7 +33,6 @@ #include #endif -#include #include #include 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 7a4d42231..0f4752998 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 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/eventlist.cpp b/src/gui/eventlist.cpp index 496f545cf..5780eaef8 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 diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 178c56192..5bec11a8f 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..8320e457e 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 diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 1d0f8a193..e070b7e71 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,7 +50,6 @@ #include #include -#include #include #include #include diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index b41c0afcd..349be1a7a 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 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 243a870e2..199f3a485 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -53,23 +53,23 @@ #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; 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/movieplayer.cpp b/src/gui/movieplayer.cpp index a542c066a..ca6be2dbc 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -32,9 +32,7 @@ #include #include -#include #include -#include #include #include #include @@ -42,12 +40,11 @@ #include #include -#include #include #include #include -#include "libtuxtxt/teletext.h" +#include #include #include #include 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/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/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..67cafe8d9 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 diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 75324cfd1..670afe1f4 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 diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index e92b3211e..73f1f5735 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 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/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..6bb48b4d3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include 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..088da8b19 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 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 b5c79b107..8a9678ede 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -51,7 +51,7 @@ #include -#include "stdlib.h" +#include #include "listframe.h" #include diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index b973b7eb0..e4c8a971b 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #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/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 3ea3be5cf..8d563a613 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" @@ -107,12 +105,11 @@ #include #include -#include #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include int old_b_id = -1; 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/system/configure_network.cpp b/src/system/configure_network.cpp index ead2b3227..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 diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index ac601a102..f5826451a 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -76,8 +76,8 @@ #include #include #include -#include "libdvbsub/dvbsub.h" -#include "libtuxtxt/teletext.h" +#include +#include #include #include diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 143ee9ef3..eb86e40b5 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 From 3389defb1753dad0f9a5ea5f5aecca0477eff46f Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 11 Sep 2012 20:33:34 +0200 Subject: [PATCH 43/78] start SCRIPTs with-my_system --- src/driver/record.cpp | 8 +++++--- src/gui/audioplayer.cpp | 5 +++-- src/gui/filebrowser.cpp | 2 +- src/gui/movieplayer.cpp | 5 +++-- src/gui/scan.cpp | 5 +++-- src/neutrino.cpp | 11 ++++++----- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 269a4b442..6fc811b67 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 @@ -1452,7 +1454,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,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1466,7 +1468,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,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4de5e4b28..96424233b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -66,6 +66,7 @@ #include #include +#include #include #include @@ -317,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,NULL,NULL) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); show(); @@ -329,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,NULL,NULL) != 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/filebrowser.cpp b/src/gui/filebrowser.cpp index 9bfc94f0e..62abedeae 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -61,7 +61,7 @@ #ifndef NEW_LIBCURL #include #endif - +#include #include #ifdef __USE_FILE_OFFSET64 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ca6be2dbc..a51e04ff9 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -175,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,NULL,NULL) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -213,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,NULL,NULL) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 670afe1f4..7b66492b4 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -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,NULL,NULL) != 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,NULL,NULL) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8d563a613..6879eaa1e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -1745,7 +1746,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 (file_exists(neutrino_leave_deepstandby_script) && my_system(neutrino_leave_deepstandby_script,NULL,NULL) != 0) perror( neutrino_leave_deepstandby_script ); } #endif @@ -2686,7 +2687,7 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - system(NEUTRINO_RECORDING_TIMER_SCRIPT); + my_system(NEUTRINO_RECORDING_TIMER_SCRIPT,NULL,NULL); if (g_settings.recording_type == RECORDING_FILE) { char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -2946,7 +2947,7 @@ 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 (file_exists(neutrino_enter_deepstandby_script) && my_system(neutrino_enter_deepstandby_script,NULL,NULL) != 0) perror(neutrino_enter_deepstandby_script ); printf("entering off state\n"); @@ -3224,7 +3225,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,NULL,NULL) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3268,7 +3269,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,NULL,NULL) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); From dfa32314696a66b83c9acece67ec9576e06688cd Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 11 Sep 2012 20:34:53 +0200 Subject: [PATCH 44/78] move safe_mkdir & check_dir to system-helpers --- src/gui/hdd_menu.cpp | 2 +- src/gui/infoviewer_bb.cpp | 2 +- src/gui/record_setup.cpp | 2 +- src/system/helpers.cpp | 45 ++++++++++++++++++++++++++++++++++ src/system/helpers.h | 2 ++ src/system/setting_helpers.cpp | 45 ---------------------------------- src/system/setting_helpers.h | 3 --- 7 files changed, 50 insertions(+), 51 deletions(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 5bec11a8f..88b618954 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -56,7 +56,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index e070b7e71..b8e2bb967 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -55,7 +55,7 @@ #include #include #include - +#include #include #include diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 67cafe8d9..aced80cda 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -51,7 +51,7 @@ #include #include - +#include CRecordSetup::CRecordSetup() { diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 4e3758ad4..bd4d598ab 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include /* or */ +#include #include @@ -102,3 +106,44 @@ FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) } 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; +} + +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/helpers.h b/src/system/helpers.h index 9fd335f3b..29f96dd4c 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -24,5 +24,7 @@ int my_system(const char * cmd, const char * arg1, const char * arg2); FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); +int safe_mkdir(char * path); +int check_dir(const char * newdir); #endif diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index f5826451a..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 @@ -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: From c6ae7255ace282f590dc50bad30108b470d3c409 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 11 Sep 2012 20:35:47 +0200 Subject: [PATCH 45/78] -add wakeup_hdd & file_exists to system-helpers --- src/driver/record.cpp | 4 ++-- src/gui/audioplayer.cpp | 4 ++-- src/gui/movieplayer.cpp | 6 +++--- src/gui/plugins.cpp | 16 ++-------------- src/gui/plugins.h | 1 - src/gui/scan.cpp | 4 ++-- src/neutrino.cpp | 9 +++++---- src/system/helpers.cpp | 24 ++++++++++++++++++++++++ src/system/helpers.h | 2 ++ 9 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 6fc811b67..cf0e3388c 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1454,7 +1454,7 @@ bool CRecordManager::RunStartScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_START_SCRIPT "."); - if (my_system(NEUTRINO_RECORDING_START_SCRIPT,NULL,NULL) != 0) { + if (file_exists(NEUTRINO_RECORDING_START_SCRIPT) && my_system(NEUTRINO_RECORDING_START_SCRIPT,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1468,7 +1468,7 @@ bool CRecordManager::RunStopScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_ENDED_SCRIPT "."); - if (my_system(NEUTRINO_RECORDING_ENDED_SCRIPT,NULL,NULL) != 0) { + if (file_exists(NEUTRINO_RECORDING_ENDED_SCRIPT) && my_system(NEUTRINO_RECORDING_ENDED_SCRIPT,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 96424233b..2a7b74855 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -318,7 +318,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->setPauseScanning(true); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); - if (my_system(AUDIOPLAYER_START_SCRIPT,NULL,NULL) != 0) + if (file_exists(AUDIOPLAYER_START_SCRIPT) && my_system(AUDIOPLAYER_START_SCRIPT,NULL,NULL) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); show(); @@ -330,7 +330,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_frameBuffer->paintBackground(); puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT "."); - if (my_system(AUDIOPLAYER_END_SCRIPT,NULL,NULL) != 0) + if (file_exists(AUDIOPLAYER_END_SCRIPT) && my_system(AUDIOPLAYER_END_SCRIPT,NULL,NULL) != 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/movieplayer.cpp b/src/gui/movieplayer.cpp index a51e04ff9..f35e55c4d 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -176,7 +176,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) startposition = 0; puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT "."); - if (my_system(MOVIEPLAYER_START_SCRIPT,NULL,NULL) != 0) + if (file_exists(MOVIEPLAYER_START_SCRIPT) && my_system(MOVIEPLAYER_START_SCRIPT,NULL,NULL) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -214,7 +214,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager->flush(); puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT "."); - if (my_system(MOVIEPLAYER_END_SCRIPT,NULL,NULL) != 0) + if (file_exists(MOVIEPLAYER_END_SCRIPT) && my_system(MOVIEPLAYER_END_SCRIPT,NULL,NULL) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); @@ -301,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(); diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 8a0e1c7e9..06b8b88e8 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -96,18 +96,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; @@ -370,7 +358,7 @@ 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()); @@ -423,7 +411,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()); 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/scan.cpp b/src/gui/scan.cpp index 7b66492b4..0c6587f83 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -249,7 +249,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { g_RCInput->close_click(); - if (my_system(NEUTRINO_SCAN_START_SCRIPT,NULL,NULL) != 0) + if (file_exists(NEUTRINO_SCAN_START_SCRIPT) && my_system(NEUTRINO_SCAN_START_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -311,7 +311,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_Zapit->stopScan(); if(!manual) { - if (my_system(NEUTRINO_SCAN_STOP_SCRIPT,NULL,NULL) != 0) + if (file_exists(NEUTRINO_SCAN_STOP_SCRIPT) && my_system(NEUTRINO_SCAN_STOP_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6879eaa1e..01cb36036 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2687,7 +2687,8 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - my_system(NEUTRINO_RECORDING_TIMER_SCRIPT,NULL,NULL); + if(file_exists(NEUTRINO_RECORDING_TIMER_SCRIPT)) + my_system(NEUTRINO_RECORDING_TIMER_SCRIPT,NULL,NULL); if (g_settings.recording_type == RECORDING_FILE) { char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -2701,7 +2702,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 ) { @@ -3225,7 +3226,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); - if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT,NULL,NULL) != 0) + if (file_exists(NEUTRINO_ENTER_STANDBY_SCRIPT) && my_system(NEUTRINO_ENTER_STANDBY_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3269,7 +3270,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT,NULL,NULL) != 0) + if (file_exists(NEUTRINO_LEAVE_STANDBY_SCRIPT) && my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index bd4d598ab..6038eea98 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -32,9 +32,33 @@ #include #include /* or */ #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(); + } +} + int my_system(const char * cmd, const char * arg1, const char * arg2) { int i; diff --git a/src/system/helpers.h b/src/system/helpers.h index 29f96dd4c..ec3074d6c 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -26,5 +26,7 @@ int my_system(const char * cmd, const char * arg1, const char * arg2); FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); int safe_mkdir(char * path); int check_dir(const char * newdir); +bool file_exists(const char *filename); +void wakeup_hdd(const char *hdd_dir); #endif From 86632f0369c43dc3626c4ba74cb375c1f0c61832 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 12 Sep 2012 18:28:11 +0200 Subject: [PATCH 46/78] if curl version --- src/gui/audioplayer.cpp | 2 +- src/gui/filebrowser.cpp | 2 +- src/gui/update.cpp | 2 +- src/system/httptool.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 2a7b74855..308cecdb3 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -144,7 +144,7 @@ void CAudiofileExt::operator=(const CAudiofileExt& src) #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 62abedeae..4e7f07f1f 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -58,7 +58,7 @@ #include #include -#ifndef NEW_LIBCURL +#if LIBCURL_VERSION_NUM < 0x071507 #include #endif #include 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/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 From e50a5ef013177ff4ce85c86e219a79acd26d2ddc Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 12 Sep 2012 22:48:15 +0200 Subject: [PATCH 47/78] /bouquetlist.cpp: close Favo also with RC_favorites --- src/driver/framebuffer.cpp | 2 -- src/driver/netfile.cpp | 2 -- src/gui/bouquetlist.cpp | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) 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 8b0a85890..3a235e3fa 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -105,8 +105,6 @@ #include #include #include -#include -#include #include /* TODO: diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 3aca47ae6..009885b51 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -352,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()) { From 8e3f4917ce998fe3d1b681230755575c56bf35e8 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Sep 2012 11:23:56 +0400 Subject: [PATCH 48/78] cross-configure.cool: enable flac --- cross-configure.cool | 2 +- cross-configure.cool.debug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 4ae70b853..10f42ba3b 100755 --- a/cross-configure.cool.debug +++ b/cross-configure.cool.debug @@ -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="" "$*" From 576d3d9da01a75b9bee77b503f8aab07014be806 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 13 Sep 2012 12:59:18 +0200 Subject: [PATCH 49/78] infoviewer.cpp:fix showSysfsHdd --- src/gui/infoviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 8320e457e..691c9662f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1364,7 +1364,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, From 5c89d3937f24dd7b5f6e9cf5fbe5ff9c9098b57d Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 13 Sep 2012 14:40:24 +0200 Subject: [PATCH 50/78] moviebrowser.cpp: fix vfd --- src/gui/moviebrowser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 199f3a485..3558b9f0e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1300,6 +1300,9 @@ void CMovieBrowser::refreshLCD(void) } else { + if(CVFD::getInstance()->getMode() != CVFD::MODE_MENU_UTF8) + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); + CVFD::getInstance()->showMenuText(0, m_movieSelectionHandler->epgTitle.c_str(), -1, true); // UTF-8 //lcd->showMenuText(1, m_movieSelectionHandler->epgInfo1.c_str(), -1, true); // UTF-8 } From db17a4ee6fb328cdae82cdacb21ad1bbd61984b1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Sep 2012 19:13:49 +0400 Subject: [PATCH 51/78] driver/record.cpp: fix fd leak, if record start failed --- src/driver/record.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index a5ff08e7c..50de25279 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -171,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; @@ -215,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) From 106c59a79251084d5bb74d692532af0d7e7059c5 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Sep 2012 20:07:18 +0400 Subject: [PATCH 52/78] driver/record.cpp: always call RestoreNeutrino(), if record start failed --- src/driver/record.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 50de25279..8f32bf937 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -891,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() From 2d0642d36df537767c4e8feb23fa07c066e368dc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Sep 2012 20:10:53 +0400 Subject: [PATCH 53/78] driver/record.cpp: fix temp timeshift file delete cmd --- src/driver/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 8f32bf937..e952976ea 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -224,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; From 12eee1db1e6250ae0eb0853551db612e7defd7ac Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Sep 2012 20:18:32 +0400 Subject: [PATCH 54/78] neutrino.cpp: remove StartAutoRecord on leaving standby - auto-timeshift started later anyway --- src/neutrino.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1345ffee9..6c365910c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3170,7 +3170,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 ) { @@ -3188,7 +3188,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) 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); @@ -3297,11 +3297,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(); } } From bafceab7f0cbfe06e76327aaa1085fef3309147f Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 14 Sep 2012 15:44:33 +0200 Subject: [PATCH 55/78] neutrino.cpp: -fix CVFD on timeshift stop --- src/neutrino.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6c365910c..b40506333 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3080,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); } } } From e45aa72605c17f5903ddac97977b207c88a8fa33 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 14 Sep 2012 20:12:04 +0200 Subject: [PATCH 56/78] moviebrowser.cpp: -fix2 vfd --- src/gui/moviebrowser.cpp | 3 --- src/gui/widget/menue.cpp | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 3558b9f0e..199f3a485 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1300,9 +1300,6 @@ void CMovieBrowser::refreshLCD(void) } else { - if(CVFD::getInstance()->getMode() != CVFD::MODE_MENU_UTF8) - CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); - CVFD::getInstance()->showMenuText(0, m_movieSelectionHandler->epgTitle.c_str(), -1, true); // UTF-8 //lcd->showMenuText(1, m_movieSelectionHandler->epgInfo1.c_str(), -1, true); // UTF-8 } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index e4c8a971b..23af427ce 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -469,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; @@ -733,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++) { From 87342fd0d9e1eb4634aee28c1a4c6947802c41fd Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 15 Sep 2012 11:20:49 +0200 Subject: [PATCH 57/78] my_system fix --- src/driver/record.cpp | 4 ++-- src/gui/audioplayer.cpp | 4 ++-- src/gui/movieplayer.cpp | 4 ++-- src/gui/scan.cpp | 4 ++-- src/neutrino.cpp | 14 +++++++------- src/system/helpers.cpp | 24 +++++++++++++++++------- src/system/helpers.h | 5 ++++- 7 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index e952976ea..4f2f723e2 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1451,7 +1451,7 @@ bool CRecordManager::RunStartScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_START_SCRIPT "."); - if (file_exists(NEUTRINO_RECORDING_START_SCRIPT) && my_system(NEUTRINO_RECORDING_START_SCRIPT,NULL,NULL) != 0) { + if (my_system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1465,7 +1465,7 @@ bool CRecordManager::RunStopScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_ENDED_SCRIPT "."); - if (file_exists(NEUTRINO_RECORDING_ENDED_SCRIPT) && my_system(NEUTRINO_RECORDING_ENDED_SCRIPT,NULL,NULL) != 0) { + if (my_system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 308cecdb3..c16d70b09 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -318,7 +318,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->setPauseScanning(true); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); - if (file_exists(AUDIOPLAYER_START_SCRIPT) && my_system(AUDIOPLAYER_START_SCRIPT,NULL,NULL) != 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(); @@ -330,7 +330,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_frameBuffer->paintBackground(); puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT "."); - if (file_exists(AUDIOPLAYER_END_SCRIPT) && my_system(AUDIOPLAYER_END_SCRIPT,NULL,NULL) != 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/movieplayer.cpp b/src/gui/movieplayer.cpp index 0103724a8..d2b299c5b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -176,7 +176,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) startposition = 0; puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT "."); - if (file_exists(MOVIEPLAYER_START_SCRIPT) && my_system(MOVIEPLAYER_START_SCRIPT,NULL,NULL) != 0) + if (my_system(MOVIEPLAYER_START_SCRIPT) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -214,7 +214,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager->flush(); puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT "."); - if (file_exists(MOVIEPLAYER_END_SCRIPT) && my_system(MOVIEPLAYER_END_SCRIPT,NULL,NULL) != 0) + if (my_system(MOVIEPLAYER_END_SCRIPT) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 0c6587f83..e11f0c099 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -249,7 +249,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { g_RCInput->close_click(); - if (file_exists(NEUTRINO_SCAN_START_SCRIPT) && my_system(NEUTRINO_SCAN_START_SCRIPT,NULL,NULL) != 0) + if (my_system(NEUTRINO_SCAN_START_SCRIPT) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -311,7 +311,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_Zapit->stopScan(); if(!manual) { - if (file_exists(NEUTRINO_SCAN_STOP_SCRIPT) && my_system(NEUTRINO_SCAN_STOP_SCRIPT,NULL,NULL) != 0) + if (my_system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b40506333..6aa7d9945 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1737,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 (file_exists(neutrino_leave_deepstandby_script) && my_system(neutrino_leave_deepstandby_script,NULL,NULL) != 0) + if (my_system(neutrino_leave_deepstandby_script) != 0) perror( neutrino_leave_deepstandby_script ); } #endif @@ -2677,8 +2677,8 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - if(file_exists(NEUTRINO_RECORDING_TIMER_SCRIPT)) - my_system(NEUTRINO_RECORDING_TIMER_SCRIPT,NULL,NULL); + 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++) { @@ -2938,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 (file_exists(neutrino_enter_deepstandby_script) && my_system(neutrino_enter_deepstandby_script,NULL,NULL) != 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); @@ -3217,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 (file_exists(NEUTRINO_ENTER_STANDBY_SCRIPT) && my_system(NEUTRINO_ENTER_STANDBY_SCRIPT,NULL,NULL) != 0) + if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3261,7 +3261,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (file_exists(NEUTRINO_LEAVE_STANDBY_SCRIPT) && my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT,NULL,NULL) != 0) + if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 6038eea98..51657da65 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -58,10 +58,18 @@ void wakeup_hdd(const char *hdd_dir) sync(); } } - -int my_system(const char * cmd, const char * arg1, const char * arg2) +//use for script with full path +int my_system(const char * cmd) { - int i; + 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; pid_t pid; int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); switch (pid = vfork()) @@ -72,16 +80,18 @@ int my_system(const char * cmd, const char * arg1, const char * arg2) case 0: /* child process */ for(i = 3; i < maxfd; i++) close(i); - if(execlp(cmd, cmd, arg1, arg2, NULL)) + if(execlp(cmd, cmd, arg1, arg2, arg3, arg3, arg4, arg5, arg6, NULL)) { - perror("exec"); + std::string txt = "ERROR: my_system \"" + (std::string) cmd + "\""; + perror(txt.c_str()); } - exit(0); + ret = 1; + _exit (0); // terminate c h i l d proces s only default: /* parent returns to calling process */ break; } waitpid(pid, 0, 0); - return 0; + return ret; } FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type) diff --git a/src/system/helpers.h b/src/system/helpers.h index ec3074d6c..6b6b31ddc 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -22,7 +22,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -int my_system(const char * cmd, const char * arg1, const char * arg2); +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); int check_dir(const char * newdir); From bf1f9afc8d132b7fae0717889f8c40a8e54b163e Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 15 Sep 2012 15:33:50 +0200 Subject: [PATCH 58/78] oops --- src/system/helpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 51657da65..8fc6d9d60 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -80,12 +80,12 @@ int my_system(const char * cmd, const char * arg1, const char * arg2, const char case 0: /* child process */ for(i = 3; i < maxfd; i++) close(i); - if(execlp(cmd, cmd, arg1, arg2, arg3, arg3, arg4, arg5, arg6, NULL)) + 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; } - ret = 1; _exit (0); // terminate c h i l d proces s only default: /* parent returns to calling process */ break; From acaf807bbbf46bb82d1f1df9a8646207675d6fc2 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 15 Sep 2012 21:26:12 +0200 Subject: [PATCH 59/78] - helpers.cpp: fix errorlevel of child-process; whitespace cleanup --- src/system/helpers.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 8fc6d9d60..ec730e2f8 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -69,7 +69,7 @@ int my_system(const char * cmd) 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; + int i=0 ,ret=0, childExit=0; pid_t pid; int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX); switch (pid = vfork()) @@ -79,8 +79,8 @@ int my_system(const char * cmd, const char * arg1, const char * arg2, const char 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)) + 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()); @@ -90,7 +90,9 @@ int my_system(const char * cmd, const char * arg1, const char * arg2, const char default: /* parent returns to calling process */ break; } - waitpid(pid, 0, 0); + waitpid(pid, &childExit, 0); + if(childExit != 0) + ret = childExit; return ret; } From c7e764f93c2ad1cf1a43333c6d4913bde165d6a4 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 16 Sep 2012 16:42:26 +0200 Subject: [PATCH 60/78] sectionsd.cpp:-fix channelID --- src/eitd/sectionsd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index cedda59ee..90ba4c097 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2160,8 +2160,8 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey); eList.clear(); - serviceUniqueKey &= 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 - if(serviceUniqueKey == 0) + t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 + if(serviceUniqueKey64 == 0) return; // service Found @@ -2173,7 +2173,7 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) { - if ((*e)->get_channel_id() == serviceUniqueKey) { + if ((*e)->get_channel_id() == serviceUniqueKey64) { serviceIDfound = 1; bool copy = true; From 324a4721f4acba70f22a90d8e1699c75d378c959 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 16 Sep 2012 20:15:38 +0200 Subject: [PATCH 61/78] sectionsd.cpp:-fix search mode --- src/eitd/sectionsd.cpp | 4 +++- src/gui/eventlist.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 90ba4c097..412c860cd 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2159,7 +2159,9 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve { dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey); - eList.clear(); + if(!eList.empty() && search == 0)//skip on search mode + eList.clear(); + t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 if(serviceUniqueKey64 == 0) return; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 20afa9c3e..f0f2f5d21 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1014,6 +1014,8 @@ bool CNeutrinoEventList::findEvents(void) { res = true; m_showChannel = true; // force the event list to paint the channel name + if(!evtlist.empty()) + evtlist.clear(); if(m_search_list == SEARCH_LIST_CHANNEL) { CEitManager::getInstance()->getEventsServiceKey(m_search_channel_id, evtlist, m_search_epg_item,m_search_keyword); From ff129578e6f1d0be06a5be46a6a41fc2980b7a89 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 17 Sep 2012 13:20:44 +0400 Subject: [PATCH 62/78] zapit/src/capmt.cpp: reduce debug --- src/zapit/src/capmt.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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) { From b194502795e8637c61e2501c638135c5ffa19cd7 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 17 Sep 2012 13:24:56 +0400 Subject: [PATCH 63/78] zapit/src/zapit.cpp: change volume debug level --- src/zapit/src/zapit.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index eb86e40b5..6215f1772 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -465,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) { @@ -624,7 +622,7 @@ int CZapit::GetPidVolume(t_channel_id channel_id, int pid, bool ac3) } } } -INFO("############################### channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); + DBG("channel %llx pid %x map size %d percent %d", channel_id, pid, vol_map.size(), percent); return percent; } @@ -637,7 +635,7 @@ void CZapit::SetVolume(int vol) current_volume = 100; int value = (current_volume * volume_percent) / 100; -INFO("############ volume %d percent %d -> %d ############", current_volume, volume_percent, value); + DBG("volume %d percent %d -> %d", current_volume, volume_percent, value); audioDecoder->setVolume(value, value); //volume_left = volume_right = current_volume; } From 7b2ac6d3374255c46c87e436e80605eb86f283a0 Mon Sep 17 00:00:00 2001 From: satbaby Date: Mon, 17 Sep 2012 14:17:16 +0200 Subject: [PATCH 64/78] streaminfo2.cpp:tiny fix --- src/gui/streaminfo2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 07396e261..e508ea134 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -807,7 +807,9 @@ int CStreamInfo2::ts_setup () if(vpid == 0 && apid == 0) return -1; - dmx = new cDemux(0);//FIXME test + dmx = new cDemux(0); + if(!dmx) + return -1; dmx->Open(DMX_TP_CHANNEL, NULL, 3 * 3008 * 62); From d00032975a82a1faccc4fa0649d72a4f8c51521b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 17 Sep 2012 21:55:53 +0200 Subject: [PATCH 65/78] - vdf: reducing flicker while going into standby --- src/neutrino.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6aa7d9945..004e2dfd7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3186,9 +3186,6 @@ 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(); if(!CRecordManager::getInstance()->RecordingStatus()) { @@ -3209,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(); } From 1b1213c7bbd8fbdf44d91cc7f0d70e867418879c Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 18 Sep 2012 02:40:08 +0200 Subject: [PATCH 66/78] * Update deutsch.locale --- data/locale/deutsch.locale | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 8330c1220..1b6fe0dfc 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -976,6 +976,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 @@ -1159,6 +1160,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: From 807dce94976a2f7d0da1d494eeab5ea487d78f93 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 30 Aug 2012 15:42:31 +0200 Subject: [PATCH 67/78] *CInfoViewer: don't show tuner icon with single boxes --- src/gui/infoviewer.cpp | 3 ++- src/gui/infoviewer_bb.cpp | 6 ++++-- src/gui/osd_setup.cpp | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 043bc0a90..0b6883847 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1152,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; diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index b8e2bb967..e03621c76 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -180,8 +180,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: diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 688c37c87..8dd62f4fc 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -52,6 +52,7 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; @@ -761,9 +762,11 @@ 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); - mc->setHint("", LOCALE_MENU_HINT_INFOBAR_TUNER); - menu_infobar->addItem(mc); + if (CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_SINGLE){ + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, &g_settings.infobar_show_tuner, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_INFOBAR_TUNER); + menu_infobar->addItem(mc); + } // show on epg change mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW, &g_settings.infobar_show, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); From 5a5ec2bba068b76687a38fd6c607d87c9b155829 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 30 Aug 2012 15:55:53 +0200 Subject: [PATCH 68/78] *CTimerList: show warnings on overlapping recording only in single mode NOTE: Only tested on single box by me, please send feedback --- src/gui/timerlist.cpp | 93 +++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 29a95527f..f5835073f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -66,6 +66,7 @@ #include #include +#include #include @@ -1210,51 +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 (CEitManager::getInstance()->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; } From ca748c6f48a8cd2fbe21bd79356e33b5f8e025d6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 18 Sep 2012 11:53:31 +0200 Subject: [PATCH 69/78] *COsdSetup: show correct option in infobar tuner icon setup item It could be confused for single stb users to see the option 'ON', although it is not possible. So it's better to show only a possible or real option at item, if stb is in single mode or item is disabled, but the real value of g_settings.infobar_show_tuner is not touched. --- src/gui/osd_setup.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8dd62f4fc..610642622 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -762,11 +762,18 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(mc); // tuner icon + 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 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, &g_settings.infobar_show_tuner, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_INFOBAR_TUNER); - menu_infobar->addItem(mc); + 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); // show on epg change mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW, &g_settings.infobar_show, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); From a84ba36e0b24332d8653fedaac11b6eb66311f96 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 18 Sep 2012 18:38:03 +0200 Subject: [PATCH 70/78] use new for buf, fix possible memlaek --- src/gui/moviebrowser.cpp | 27 ++++++++++++++++----------- src/gui/streaminfo2.cpp | 27 +++++++++++++++++---------- src/gui/streaminfo2.h | 2 +- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 199f3a485..6f14c3d2c 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -3948,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; @@ -3965,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; } @@ -4019,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) { @@ -4051,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; @@ -4179,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; @@ -4195,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; @@ -4209,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; } @@ -4247,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); @@ -4389,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/streaminfo2.cpp b/src/gui/streaminfo2.cpp index e508ea134..25ca76582 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -776,8 +776,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 +787,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,13 +801,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); if(!dmx) - return -1; + 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) { @@ -825,8 +831,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 () @@ -834,8 +840,6 @@ int CStreamInfo2::update_rate () if(!dmx) return 0; - - unsigned char buf[TS_BUF_SIZE] = {0}; long b = 0; int ret = 0; @@ -843,7 +847,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; @@ -881,6 +885,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(); From 8f509f5dcf41f181440ee4dea37bedee293367d7 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 18 Sep 2012 19:43:24 +0200 Subject: [PATCH 71/78] use new for buf, fix for last commit --- src/gui/streaminfo2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 25ca76582..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 () From 87f7a224f762c2641014df157df653ae3d9fcca6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 19 Sep 2012 21:23:50 +0200 Subject: [PATCH 72/78] - infoviewerbb: determination of hdd-percentage in a seperate thread --- src/gui/infoviewer_bb.cpp | 61 +++++++++++++++++++++++++++------------ src/gui/infoviewer_bb.h | 7 +++++ src/system/helpers.cpp | 35 ++++++++++++++++------ src/system/helpers.h | 3 +- 4 files changed, 78 insertions(+), 28 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index e03621c76..3ef336473 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -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() @@ -589,28 +595,47 @@ 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); + + //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; - } - } - hddscale->paintProgressBar(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2, hddwidth, 6, per, 100); } } +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 349be1a7a..84353c6b9 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -121,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/system/helpers.cpp b/src/system/helpers.cpp index ec730e2f8..334163f51 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -158,11 +158,11 @@ int safe_mkdir(char * path) return ret; } -int check_dir(const char * newdir) +int check_dir(const char * dir) { - - struct statfs s; - if (::statfs(newdir, &s) == 0) { + int ret = 0; + struct statfs s; + if (::statfs(dir, &s) == 0) { switch (s.f_type) /* f_type is long */ { case 0xEF53L: /*EXT2 & EXT3*/ @@ -174,12 +174,29 @@ int check_dir(const char * newdir) case 0x58465342L: /*xfs*/ case 0x4d44L: /*msdos*/ case 0x0187: /* AUTOFS_SUPER_MAGIC */ - case 0x858458f6: /*ramfs*/ - return 0;//ok + case 0x858458f6L: /*ramfs*/ + case 0x72b6L: /*jffs2*/ + break; //ok default: - fprintf( stderr,"%s Unknow File system type: %i\n",newdir ,s.f_type); - break; + fprintf(stderr, "%s Unknow File system type: %i\n" ,dir ,s.f_type); + ret = -1; + break; // error } } - return 1; // error + return ret; +} + +int get_fs_usage(const char * dir) +{ + int ret = check_dir(dir); + long blocks_used; + struct statfs s; + + if (ret == 0) { + 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; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 6b6b31ddc..ee1a09f8a 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -28,8 +28,9 @@ int my_system(const char * cmd); FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type); int safe_mkdir(char * path); -int check_dir(const char * newdir); 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); #endif From 708b6a3ad0cb901e2df11f9e74326f093b24e851 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 19 Sep 2012 21:58:21 +0200 Subject: [PATCH 73/78] - neutrino.cpp: localize "Saving EPG" --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/neutrino.cpp | 10 +++++----- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1b6fe0dfc..2ca31dd32 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -292,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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 3219c99bb..3f3100cbf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -292,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 diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 004e2dfd7..369f89771 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3063,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)) { diff --git a/src/system/locals.h b/src/system/locals.h index fc39162e1..272c29188 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -319,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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index eedc2a634..2879066a0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -319,6 +319,7 @@ const char * locale_real_names[] = "date.Thu", "date.Tue", "date.Wed", + "epg.saving", "epgextended.actors", "epgextended.director", "epgextended.guests", From 768a064629aaf41e95801cbb94c54d2cf6256d55 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 20 Sep 2012 22:43:00 +0200 Subject: [PATCH 74/78] Zombie Killer ;) --- src/gui/plugins.cpp | 51 ++++----------------------------------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 06b8b88e8..80836e7a1 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -308,52 +309,6 @@ void CPlugins::startPlugin(const char * const name) } -FILE* popen2( 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); -} - void CPlugins::startScriptPlugin(int number) { const char *script = plugin_list[number].pluginfile.c_str(); @@ -375,8 +330,10 @@ void CPlugins::startScriptPlugin(int number) { scriptOutput += output; } - kill(pid, SIGINT ); pclose(f); + int s; + while (waitpid(pid,&s,WNOHANG)>0); + kill(pid,SIGTERM); if(output) free(output); } From 5dc2656b8e70de63f8c3425952a5865b2728e9a0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 21 Sep 2012 17:41:28 +0400 Subject: [PATCH 75/78] system/helpers.cpp: add function to get total/free mem without cached/buffers --- src/system/helpers.cpp | 32 ++++++++++++++++++++++++++++++++ src/system/helpers.h | 1 + 2 files changed, 33 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 334163f51..cdb1ea84e 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -33,6 +33,7 @@ #include /* or */ #include #include +#include #include @@ -200,3 +201,34 @@ int get_fs_usage(const char * dir) } 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 index ee1a09f8a..7707cce05 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -32,5 +32,6 @@ 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 From bc74b0c3a61ffa49b2d355820cea51bc53814874 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 21 Sep 2012 17:45:19 +0400 Subject: [PATCH 76/78] gui/dboxinfo.cpp: show free mem without cached/buffers; add 5 seconds timer to update window --- src/gui/dboxinfo.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 { From 108ee92618a8517c0152e03d34774b1075db0731 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 21 Sep 2012 18:44:47 +0400 Subject: [PATCH 77/78] system/helpers.cpp: fix check_dir - we use it to check for record, last change allow recording to jffs2 --- src/system/helpers.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index cdb1ea84e..f5f1cdb96 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -159,9 +159,11 @@ int safe_mkdir(char * path) return ret; } +/* function used to check is this dir writable, i.e. not flash, for record etc */ int check_dir(const char * dir) { - int ret = 0; + /* 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 */ @@ -176,11 +178,13 @@ int check_dir(const char * dir) 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); - ret = -1; break; // error } } @@ -189,15 +193,13 @@ int check_dir(const char * dir) int get_fs_usage(const char * dir) { - int ret = check_dir(dir); + int ret = 0; long blocks_used; struct statfs s; - if (ret == 0) { - if (::statfs(dir, &s) == 0 && s.f_blocks) { - blocks_used = s.f_blocks - s.f_bfree; - ret = (blocks_used * 100ULL) / s.f_blocks; - } + 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; } From 0d4ce318c3706898a13190f41134f8c0c307d7bc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 21 Sep 2012 18:47:42 +0400 Subject: [PATCH 78/78] gui/infoviewer_bb.cpp: disable thread to update hdd used percent - there is screen corruption/artifacts (race?). better solution needed, probably hdd monitor thread which cache data ? --- src/gui/infoviewer_bb.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 3ef336473..d106d0f98 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -601,12 +601,19 @@ void CInfoViewerBB::showSysfsHdd() 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); } +#else + if (!check_dir(g_settings.network_nfs_recordingdir)) { + sysper = get_fs_usage(g_settings.network_nfs_recordingdir); + showBarHdd(sysper); + } +#endif } }