Project "Tuxbox-GIT: apps":

The branch, master has been updated
       via  6ac4efb8c8b046ba88fca11c10ab4f9cc9ddca3e (commit)
      from  7a67c5a67d90674771736d0f07f9873d9c41d0e7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6ac4efb8c8b046ba88fca11c10ab4f9cc9ddca3e
Author: Jacek Jendrzej <crash...@googlemail.com>
Date:   Wed May 20 09:00:28 2015 +0200

    Neutrino: add AdZap/Werbezapper in EPGview
    
    use +/- to change time
    possible values are up to 60 Mins.
    
    Signed-off-by: GetAway <get-a...@t-online.de>

diff --git a/tuxbox/neutrino/data/locale/deutsch.locale 
b/tuxbox/neutrino/data/locale/deutsch.locale
index 4a26c68..e9ac38d 100644
--- a/tuxbox/neutrino/data/locale/deutsch.locale
+++ b/tuxbox/neutrino/data/locale/deutsch.locale
@@ -129,6 +129,7 @@ GENRE.TRAVEL_HOBBIES.5 Kochen
 GENRE.TRAVEL_HOBBIES.6 Einkauf
 GENRE.TRAVEL_HOBBIES.7 Garten
 GENRE.UNKNOWN Unbekannt
+adzap Werbezapper
 apidselector.head Audio-Auswahl
 audiomenu.PCMOffset Lautstärkeabsenkung PCM
 audiomenu.analogout Analog-Ausgang
diff --git a/tuxbox/neutrino/data/locale/english.locale 
b/tuxbox/neutrino/data/locale/english.locale
index c13e022..ff033c6 100644
--- a/tuxbox/neutrino/data/locale/english.locale
+++ b/tuxbox/neutrino/data/locale/english.locale
@@ -129,6 +129,7 @@ GENRE.TRAVEL_HOBBIES.5 cooking
 GENRE.TRAVEL_HOBBIES.6 advertisement/shopping
 GENRE.TRAVEL_HOBBIES.7 gardening
 GENRE.UNKNOWN unknown
+adzap AdZap
 apidselector.head Audio Selection
 audiomenu.PCMOffset Volume Decrease PCM
 audiomenu.analogout Analog Output
diff --git a/tuxbox/neutrino/lib/timerdclient/timerdclient.cpp 
b/tuxbox/neutrino/lib/timerdclient/timerdclient.cpp
index 49685f5..42313d4 100644
--- a/tuxbox/neutrino/lib/timerdclient/timerdclient.cpp
+++ b/tuxbox/neutrino/lib/timerdclient/timerdclient.cpp
@@ -28,7 +28,11 @@
 #include <timerdclient/timerdmsg.h>
 #include <timerdclient/timerdclient.h>
 
-
+int CTimerdClient::adzap_eventID = 0;
+void CTimerdClient::resetAdZap_EventID()
+{
+       adzap_eventID = 0;
+}
 unsigned char CTimerdClient::getVersion() const
 {
        return CTimerdMsg::ACTVERSION;
@@ -231,7 +235,6 @@ int CTimerdClient::addTimerEvent( CTimerEventTypes evType, 
void* data , int min,
 int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* 
data, time_t announcetime, time_t alarmtime,time_t stoptime,
                                  CTimerd::CTimerEventRepeat evrepeat, uint 
repeatcount,bool forceadd)
 {
-
        if (!forceadd)
        {
                //printf("[CTimerdClient] checking for overlapping timers\n");
@@ -244,6 +247,11 @@ int CTimerdClient::addTimerEvent( 
CTimerd::CTimerEventTypes evType, void* data,
                }
        }
 
+       bool adzaptimer = false;
+       if (evType == CTimerd::TIMER_ADZAP) {
+               evType = CTimerd::TIMER_ZAPTO;
+               adzaptimer = true;
+       }
        CTimerd::TransferEventInfo tei; 
        CTimerd::TransferRecordingInfo tri;
        CTimerdMsg::commandAddTimer msgAddTimer;
@@ -259,7 +267,8 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes 
evType, void* data,
                length = 0;
        }
        else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == 
CTimerd::TIMER_ZAPTO || 
-               evType == CTimerd::TIMER_IMMEDIATE_RECORD )
+               evType == CTimerd::TIMER_IMMEDIATE_RECORD ||
+               evType == CTimerd::TIMER_ADZAP)
        {
                CTimerd::EventInfo *ei=static_cast<CTimerd::EventInfo*>(data); 
                tei.apids = ei->apids;
@@ -307,15 +316,19 @@ int CTimerdClient::addTimerEvent( 
CTimerd::CTimerEventTypes evType, void* data,
        CTimerdMsg::responseAddTimer response;
        receive_data((char*)&response, sizeof(response));
        close_connection();
-
+       if (adzaptimer) {
+               adzap_eventID = response.eventID; //set adzap flag
+       }
        return( response.eventID);
 }
 //-------------------------------------------------------------------------
 
 void CTimerdClient::removeTimerEvent( int evId)
 {
-       CTimerdMsg::commandRemoveTimer msgRemoveTimer;
+       if (evId == adzap_eventID)
+               adzap_eventID = 0; //reset adzap flag
 
+       CTimerdMsg::commandRemoveTimer msgRemoveTimer;
        msgRemoveTimer.eventID  = evId;
 
        send(CTimerdMsg::CMD_REMOVETIMER, (char*) &msgRemoveTimer, 
sizeof(msgRemoveTimer));
diff --git a/tuxbox/neutrino/lib/timerdclient/timerdclient.h 
b/tuxbox/neutrino/lib/timerdclient/timerdclient.h
index 5696c0b..98e455a 100644
--- a/tuxbox/neutrino/lib/timerdclient/timerdclient.h
+++ b/tuxbox/neutrino/lib/timerdclient/timerdclient.h
@@ -62,7 +62,9 @@ class CTimerdClient:private CBasicClient
 
                void registerEvent(unsigned int eventID, unsigned int clientID, 
const char * const udsName);
                void unRegisterEvent(unsigned int eventID, unsigned int 
clientID);
+               static int adzap_eventID;
 
+               void resetAdZap_EventID();
                bool isTimerdAvailable();                       // check if 
timerd is running
 
                CTimerd::TimerList getOverlappingTimers(time_t& announcetime, 
time_t& stoptime);
@@ -148,6 +150,17 @@ class CTimerdClient:private CBasicClient
                        eventInfo.recordingSafety = safety;
                        return addTimerEvent(CTimerd::TIMER_ZAPTO, &eventInfo, 
announcetime, alarmtime, stoptime);
                };
+               // adds new adzap timer event //pseudo TIMER_ADZAP
+               int addAdZaptoTimerEvent(const t_channel_id channel_id, time_t 
alarmtime)
+               {
+                       CTimerd::EventInfo eventInfo;
+                       eventInfo.channel_id = channel_id;
+                       eventInfo.epgID = 1;
+                       eventInfo.epg_starttime = 0;
+                       eventInfo.apids = 0;
+                       eventInfo.recordingSafety = false;
+                       return addTimerEvent(CTimerd::TIMER_ADZAP, &eventInfo, 
0, alarmtime, 0);
+               };
 
                int addNextProgramTimerEvent(CTimerd::EventInfo 
eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0)
                {
diff --git a/tuxbox/neutrino/lib/timerdclient/timerdtypes.h 
b/tuxbox/neutrino/lib/timerdclient/timerdtypes.h
index a09ecaa..2105eaa 100644
--- a/tuxbox/neutrino/lib/timerdclient/timerdtypes.h
+++ b/tuxbox/neutrino/lib/timerdclient/timerdtypes.h
@@ -69,7 +69,8 @@ class CTimerd
                        TIMER_REMIND,
                        TIMER_SLEEPTIMER,
                        TIMER_EXEC_PLUGIN,
-                       TIMER_IMMEDIATE_RECORD
+                       TIMER_IMMEDIATE_RECORD,
+                       TIMER_ADZAP
                };
                
                enum CTimerEventStates 
diff --git a/tuxbox/neutrino/src/gui/epgview.cpp 
b/tuxbox/neutrino/src/gui/epgview.cpp
index f1ed2c5..b1424eb 100644
--- a/tuxbox/neutrino/src/gui/epgview.cpp
+++ b/tuxbox/neutrino/src/gui/epgview.cpp
@@ -36,6 +36,7 @@
 #endif
 
 #include <algorithm>
+#include <sstream>
 
 #include <gui/epgview.h>
 
@@ -455,6 +456,15 @@ 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 = g_Zapit->getCurrentServiceID();
+       if(( epg_done != -1 ) && live_channel_id == channel_id){
+               return true;
+       }
+       return false;
+}
+
 int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, 
time_t* a_startzeit, bool doLoop, bool callFromfollowlist )
 {
        int res = menu_return::RETURN_REPAINT;
@@ -630,7 +640,9 @@ int CEpgData::show(const t_channel_id channel_id, unsigned 
long long a_id, time_
        showText(showPos, sy + toph);
 
        // show Timer Event Buttons
-       showTimerEventBar (true);
+       bool wzap = isCurrentEPG(channel_id);
+       frameBuffer->paintBoxRel(sx, sy + oy, ox, buttonheight, 
COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM);
+       showTimerEventBar (true, wzap);
 
        //show Content&Component for Dolby & 16:9
        if (hasComponentTags)
@@ -678,6 +690,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned 
long long a_id, time_
                while(loop)
                {
                        g_RCInput->getMsgAbsoluteTimeout( &msg, &data, 
&timeoutEnd );
+                       neutrino_msg_t msg_repeatok = msg & 
~CRCInput::RC_Repeat;
 
                        scrollCount = medlinecount;
 
@@ -716,6 +729,29 @@ int CEpgData::show(const t_channel_id channel_id, unsigned 
long long a_id, time_
                                        else
                                                showText(showPos, sy + toph);
                                        break;
+                               case CRCInput::RC_plus:
+                                       if(isCurrentEPG(channel_id)){
+                                               if(g_settings.wzap_time> 14)
+                                                       g_settings.wzap_time+=5;
+                                               else
+                                                       g_settings.wzap_time++;
+                                               if(g_settings.wzap_time>60)
+                                                       g_settings.wzap_time = 
0;
+                                               showTimerEventBar(true, true);
+                                       }
+                                       break;
+                               case CRCInput::RC_minus:
+                                       if (isCurrentEPG(channel_id)) {
+                                               if(g_settings.wzap_time> 19)
+                                                       g_settings.wzap_time-=5;
+                                               else
+                                                       g_settings.wzap_time--;
+
+                                               if(g_settings.wzap_time<0)
+                                                       g_settings.wzap_time = 
60;
+                                               showTimerEventBar(true, true);
+                                       }
+                                       break;
 
                                // 31.05.2002 dirch             record timer
                                case CRCInput::RC_red:
@@ -779,14 +815,19 @@ int CEpgData::show(const t_channel_id channel_id, 
unsigned long long a_id, time_
                                // 31.05.2002 dirch             zapto timer
                                case CRCInput::RC_yellow:
                                {
-                                       CTimerdClient timerdclient;
-                                       if(timerdclient.isTimerdAvailable())
+                                       if(g_Timerd->isTimerdAvailable())
                                        {
-                                               
timerdclient.addZaptoTimerEvent(channel_id,
-                                                                               
                                                  epgData.epg_times.startzeit,
-                                                                               
                                                  epgData.epg_times.startzeit - 
ANNOUNCETIME, 0,
-                                                                               
                                                  epgData.eventID, 
epgData.epg_times.startzeit, 0, true);
-                                               
ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, 
LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, 
NEUTRINO_ICON_INFO);
+                                               if (!g_Timerd->adzap_eventID && 
g_settings.wzap_time && isCurrentEPG(channel_id)) {
+                                                       
g_Timerd->addAdZaptoTimerEvent(channel_id,
+                                                                               
        time (NULL) + (g_settings.wzap_time * 60));
+                                                       loop = false;
+                                               } else {
+                                                       
g_Timerd->addZaptoTimerEvent(channel_id,
+                                                                               
        epgData.epg_times.startzeit,
+                                                                               
        epgData.epg_times.startzeit - ANNOUNCETIME, 0,
+                                                                               
        epgData.eventID, epgData.epg_times.startzeit, 0, true);
+                                                       
ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, 
LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, 
NEUTRINO_ICON_INFO);
+                                               }
                                        }
                                        else
                                                printf("timerd not 
available\n");
@@ -848,6 +889,8 @@ int CEpgData::show(const t_channel_id channel_id, unsigned 
long long a_id, time_
                                        // konfigurierbare Keys handlen...
                                        if (msg == 
g_settings.key_channelList_cancel)
                                                loop = false;
+                                       else if (msg_repeatok == 
CRCInput::RC_plus || msg_repeatok == CRCInput::RC_minus)
+                                               ;
                                        else
                                        {
                                                if ( 
CNeutrinoApp::getInstance()->handleMsg( msg, data ) & 
messages_return::cancel_all )
@@ -1001,16 +1044,16 @@ void CEpgData::FollowScreenings(const time_t startzeit)
 // -- Just display or hide TimerEventbar
 // -- 2002-05-13 rasc
 //
-const struct button_label epgviewButtons[3] =
+struct button_label epgviewButtons[3] =
 {
        { NEUTRINO_ICON_BUTTON_RED    , LOCALE_TIMERBAR_RECORDEVENT            
},
-       { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_TIMERBAR_CHANNELSWITCH          
},
+       { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_GENERIC_EMPTY                   
}, // channelswitch / adZap
        { NEUTRINO_ICON_BUTTON_BLUE   , LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }
 };
 
-void CEpgData::showTimerEventBar(bool _show)
+void CEpgData::showTimerEventBar(bool _show, bool webzap)
 {
-       int ButtonWidth = (ox - 12) / 4; // 4 cells
+       int ButtonWidth = (ox - 70) / 3; // 3 cells + 16:9 & dd
        int by = sy + oy + 2;
 
        // hide only?
@@ -1020,14 +1063,27 @@ void CEpgData::showTimerEventBar(bool _show)
                return;
        }
 
-       frameBuffer->paintBoxRel(sx, sy + oy, ox, buttonheight, 
COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM);
+       frameBuffer->paintBoxRel(sx, sy + oy, ox-60, buttonheight, 
COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_LEFT);
+
+       std::string tmp_but_name;
+       std::stringstream s;
+       s << g_settings.wzap_time;
+       const char *but_name = NULL;
+       if (g_settings.wzap_time && webzap && !g_Timerd->adzap_eventID) {
+               tmp_but_name = g_Locale->getText(LOCALE_ADZAP);
+               tmp_but_name += " "+ s.str() + " ";
+               tmp_but_name += g_Locale->getText(LOCALE_WORD_MINUTES_SHORT);
+               but_name = tmp_but_name.c_str();
+       }
+       else
+               epgviewButtons[1].locale = LOCALE_TIMERBAR_CHANNELSWITCH;
 
        // Button: Timer Record & Channelswitch
        if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
                ::paintButtons(frameBuffer, 
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, sx + 6, by, 
ButtonWidth, 1, &epgviewButtons[0]);
 
-       // Button: Timer Channelswitch
-       ::paintButtons(frameBuffer, 
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, sx + 6 + 
ButtonWidth, by, ButtonWidth, 1, &epgviewButtons[1]);
+       // Button: Timer Channelswitch / AdZap
+       ::paintButtons(frameBuffer, 
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, sx + 6 + 
ButtonWidth-25, by, ButtonWidth, 1, &epgviewButtons[1], 0, false, 
COL_INFOBAR_SHADOW_PLUS_1, but_name);
 
        // Button: more screenings
        if (!followlist.empty() && !call_fromfollowlist)
diff --git a/tuxbox/neutrino/src/gui/epgview.h 
b/tuxbox/neutrino/src/gui/epgview.h
index 5e46982..189041e 100644
--- a/tuxbox/neutrino/src/gui/epgview.h
+++ b/tuxbox/neutrino/src/gui/epgview.h
@@ -95,7 +95,8 @@ class CEpgData
                void showText( int startPos, int ypos );
                bool hasFollowScreenings(const t_channel_id channel_id, const 
std::string & title, const time_t startzeit);
                void FollowScreenings(const time_t startzeit);
-               void showTimerEventBar(bool show);
+               void showTimerEventBar(bool show, bool webzap = false);
+               bool isCurrentEPG(const t_channel_id channel_id);
 
        public:
 
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 73f73e2..b531f55 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -400,8 +400,9 @@ int CNeutrinoApp::loadSetup()
        g_settings.infobar_show_channellogo     = 
configfile.getInt32("infobar_show_channellogo"                , 
CInfoViewer::NO_LOGO);
        g_settings.infobar_channellogo_background               = 
configfile.getInt32("infobar_channellogo_background"          , 
CInfoViewer::NO_BACKGROUND);
        g_settings.startmode                    = 
configfile.getInt32("startmode" , STARTMODE_RESTORE );
-
+       g_settings.wzap_time                    = 
configfile.getInt32("wzap_time", 3 );
        g_settings.radiotext_enable             = 
configfile.getBool("radiotext_enable"          , false);
+
        //audio
        g_settings.audio_AnalogMode             = configfile.getInt32( 
"audio_AnalogMode"        , 0 );
        g_settings.audio_DolbyDigital           = 
configfile.getBool("audio_DolbyDigital"        , false);
@@ -959,6 +960,7 @@ void CNeutrinoApp::saveSetup()
        configfile.setString("infobar_channel_logodir"  , 
g_settings.infobar_channel_logodir);
        configfile.setInt32( "infobar_channellogo_background"   , 
g_settings.infobar_channellogo_background);
        configfile.setInt32("startmode"                , g_settings.startmode);
+       configfile.setInt32("wzap_time"                , g_settings.wzap_time);
        configfile.setBool("radiotext_enable"          , 
g_settings.radiotext_enable);
 
        //audio
@@ -2924,6 +2926,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t m, 
neutrino_msg_data_t data)
                                        channelsInit(init_mode_switch, mode_tv);
                                }
                                
channelList->zapTo_ChannelID(eventinfo->channel_id);
+                               if (eventinfo->epgID == 1) {
+                                       g_Timerd->resetAdZap_EventID();
+                               }
                        }
                        delete [] (unsigned char*) data;
                        return messages_return::handled;
diff --git a/tuxbox/neutrino/src/system/locals.h 
b/tuxbox/neutrino/src/system/locals.h
index d772f7b..cb1510b 100644
--- a/tuxbox/neutrino/src/system/locals.h
+++ b/tuxbox/neutrino/src/system/locals.h
@@ -156,6 +156,7 @@ typedef enum
        LOCALE_GENRE_TRAVEL_HOBBIES_6,
        LOCALE_GENRE_TRAVEL_HOBBIES_7,
        LOCALE_GENRE_UNKNOWN,
+       LOCALE_ADZAP,
        LOCALE_APIDSELECTOR_HEAD,
        LOCALE_AUDIOMENU_PCMOFFSET,
        LOCALE_AUDIOMENU_ANALOGOUT,
diff --git a/tuxbox/neutrino/src/system/locals_intern.h 
b/tuxbox/neutrino/src/system/locals_intern.h
index 47a6218..4535f7f 100644
--- a/tuxbox/neutrino/src/system/locals_intern.h
+++ b/tuxbox/neutrino/src/system/locals_intern.h
@@ -156,6 +156,7 @@ const char * locale_real_names[] =
        "GENRE.TRAVEL_HOBBIES.6",
        "GENRE.TRAVEL_HOBBIES.7",
        "GENRE.UNKNOWN",
+       "adzap",
        "apidselector.head",
        "audiomenu.PCMOffset",
        "audiomenu.analogout",
diff --git a/tuxbox/neutrino/src/system/settings.h 
b/tuxbox/neutrino/src/system/settings.h
index 5651d8b..17e1ca4 100644
--- a/tuxbox/neutrino/src/system/settings.h
+++ b/tuxbox/neutrino/src/system/settings.h
@@ -75,6 +75,7 @@ struct SNeutrinoSettings
        int infobar_show_channellogo;
        int infobar_channellogo_background;
        int startmode;
+       int wzap_time;
        int radiotext_enable;
 
        // EPG

-----------------------------------------------------------------------

Summary of changes:
 tuxbox/neutrino/data/locale/deutsch.locale        |    1 +
 tuxbox/neutrino/data/locale/english.locale        |    1 +
 tuxbox/neutrino/lib/timerdclient/timerdclient.cpp |   23 +++++-
 tuxbox/neutrino/lib/timerdclient/timerdclient.h   |   13 +++
 tuxbox/neutrino/lib/timerdclient/timerdtypes.h    |    3 +-
 tuxbox/neutrino/src/gui/epgview.cpp               |   86 +++++++++++++++++----
 tuxbox/neutrino/src/gui/epgview.h                 |    3 +-
 tuxbox/neutrino/src/neutrino.cpp                  |    7 ++-
 tuxbox/neutrino/src/system/locals.h               |    1 +
 tuxbox/neutrino/src/system/locals_intern.h        |    1 +
 tuxbox/neutrino/src/system/settings.h             |    1 +
 11 files changed, 117 insertions(+), 23 deletions(-)


-- 
Tuxbox-GIT: apps

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Tuxbox-cvs-commits mailing list
Tuxbox-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits

Reply via email to