From 3818875a80e35d7e7344bcdc348909e3af771f3f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Feb 2014 19:32:06 +0100 Subject: [PATCH] epgview.cpp: -add adzap --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/epgview.cpp | 67 +++++++++++++++++++++++++++++--------- src/gui/epgview.h | 3 +- src/neutrino.cpp | 3 ++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 8 files changed, 61 insertions(+), 17 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 16b0bc559..5e9d660d0 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 Kochen GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt +adzap Werbezapper apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark diff --git a/data/locale/english.locale b/data/locale/english.locale index 66a2baca5..e666ec168 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 cooking GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown +adzap AdZap apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 7e687d5d6..4cadb4fd5 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -435,19 +437,25 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) { return a.startTime< b.startTime; } - +bool CEpgData::isCurrentEPG(const t_channel_id channel_id) +{ + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(( epg_done!= -1 ) && live_channel_id == channel_id){ + return true; + } + return false; +} int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; - static uint64_t id; - static time_t startzeit; + static uint64_t id = 0; + static time_t startzeit = 0; call_fromfollowlist = callFromfollowlist; if (a_startzeit) startzeit=*a_startzeit; id=a_id; - int height; - height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); GetEPGData(channel_id, id, &startzeit ); if (doLoop) @@ -469,7 +477,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); return res; } - // Calculate offset for the title when logo appears. int pic_offx = 0; std::string lname; @@ -644,10 +651,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - + bool wzap = isCurrentEPG(channel_id); // show Timer Event Buttons - showTimerEventBar (true); - + showTimerEventBar (true,wzap); + //show Content&Component for Dolby & 16:9 int dummy_h,dummy_w; frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); @@ -775,6 +782,22 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start else showText(showPos, sy + toph); break; + case CRCInput::RC_page_up: + if(isCurrentEPG(channel_id)){ + g_settings.wzap_time++; + if(g_settings.wzap_time>9) + g_settings.wzap_time = 9; + showTimerEventBar(true, true); + } + break; + case CRCInput::RC_page_down: + if(isCurrentEPG(channel_id)){ + g_settings.wzap_time--; + if(g_settings.wzap_time<0) + g_settings.wzap_time = 0; + showTimerEventBar(true, true); + } + break; // 31.05.2002 dirch record timer case CRCInput::RC_red: @@ -862,12 +885,19 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start { //CTimerdClient timerdclient; if (g_Timerd->isTimerdAvailable()) - { - g_Timerd->addZaptoTimerEvent(channel_id, + { + if(g_settings.wzap_time && isCurrentEPG(channel_id)){ + g_Timerd->addZaptoTimerEvent(channel_id, + time (NULL) + (g_settings.wzap_time * 60), + 0, 0, + 0, 0, 0); + }else{ + g_Timerd->addZaptoTimerEvent(channel_id, epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + } timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else @@ -1130,7 +1160,7 @@ const struct button_label EpgButtons[] = }; -void CEpgData::showTimerEventBar (bool pshow) +void CEpgData::showTimerEventBar (bool pshow, bool webzap) { int x,y,h,fh; @@ -1150,13 +1180,18 @@ void CEpgData::showTimerEventBar (bool pshow) return; } frameBuffer->paintBoxRel(sx,y,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);//round - /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + std::string tmp_but_name; + if(g_settings.wzap_time && webzap){ + tmp_but_name = g_Locale->getText(LOCALE_ADZAP); + tmp_but_name += " "+ to_string(g_settings.wzap_time) + " "; + tmp_but_name += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),1); else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),0); #if 0 // Button: Timer Record & Channelswitch diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 7492a79b3..c15b00f5d 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -87,7 +87,8 @@ class CEpgData void showText( int startPos, int ypos ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); - void showTimerEventBar(bool show); + void showTimerEventBar(bool show, bool webzap=false); + bool isCurrentEPG(const t_channel_id channel_id); public: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 62fbf6acd..1a7252e03 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -419,6 +419,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); + g_settings.wzap_time = configfile.getInt32("wzap_time", 3 ); + g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); //audio @@ -930,6 +932,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); + configfile.setInt32("wzap_time" , g_settings.wzap_time ); configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); //audio diff --git a/src/system/locals.h b/src/system/locals.h index 008ca1026..fff99ba4c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -123,6 +123,7 @@ typedef enum LOCALE_GENRE_TRAVEL_HOBBIES_6, LOCALE_GENRE_TRAVEL_HOBBIES_7, LOCALE_GENRE_UNKNOWN, + LOCALE_ADZAP, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 75aff6eb0..7700d888d 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -123,6 +123,7 @@ const char * locale_real_names[] = "GENRE.TRAVEL_HOBBIES.6", "GENRE.TRAVEL_HOBBIES.7", "GENRE.UNKNOWN", + "adzap", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", diff --git a/src/system/settings.h b/src/system/settings.h index 3710a2e90..b4aa6ee09 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -95,6 +95,7 @@ struct SNeutrinoSettings int infobar_show_res; int infobar_show_tuner; int infobar_show_dd_available; + int wzap_time; //audio int audio_AnalogMode; int audio_DolbyDigital;