adzap: use adzap-thread in epg view; remove pseudo timertype ADZAP

Origin commit data
------------------
Branch: ni/coolstream
Commit: 19154192db
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-29 (Mon, 29 Feb 2016)

Origin message was:
------------------
- adzap: use adzap-thread in epg view; remove pseudo timertype ADZAP

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-02-29 14:00:09 +01:00
parent 550709de5e
commit 7615e8eac0
8 changed files with 39 additions and 72 deletions

View File

@@ -28,7 +28,6 @@
#include <timerdclient/timerdmsg.h>
#include <timerdclient/timerdclient.h>
int CTimerdClient::adzap_eventID = 0;
unsigned char CTimerdClient::getVersion () const
{
return CTimerdMsg::ACTVERSION;
@@ -296,11 +295,6 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
return -1;
}
}
bool adzaptimer = false;
if(evType == CTimerd::TIMER_ADZAP){
evType = CTimerd::TIMER_ZAPTO;
adzaptimer = true;
}
CTimerd::TransferEventInfo tei;
CTimerd::TransferRecordingInfo tri;
CTimerdMsg::commandAddTimer msgAddTimer;
@@ -317,8 +311,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
}
/* else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || */
else if (evType == CTimerd::TIMER_ZAPTO ||
evType == CTimerd::TIMER_IMMEDIATE_RECORD ||
evType == CTimerd::TIMER_ADZAP)
evType == CTimerd::TIMER_IMMEDIATE_RECORD)
{
CTimerd::EventInfo *ei=static_cast<CTimerd::EventInfo*>(data);
tei.apids = ei->apids;
@@ -367,18 +360,12 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
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)
{
if(evId == adzap_eventID)
adzap_eventID = 0;//reset adzap flag
CTimerdMsg::commandRemoveTimer msgRemoveTimer;
msgRemoveTimer.eventID = evId;

View File

@@ -61,7 +61,6 @@ 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;
bool isTimerdAvailable(); // check if timerd is running
@@ -153,18 +152,6 @@ class CTimerdClient:private CBasicClient
eventInfo.recordingSafety = false;
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);
};
#if 0
int addNextProgramTimerEvent(CTimerd::EventInfo eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0)

View File

@@ -68,8 +68,7 @@ class CTimerd
TIMER_REMIND,
TIMER_SLEEPTIMER,
TIMER_EXEC_PLUGIN,
TIMER_IMMEDIATE_RECORD,
TIMER_ADZAP
TIMER_IMMEDIATE_RECORD
};
enum CTimerEventStates

View File

@@ -26,6 +26,7 @@
#endif
#include <algorithm>
#include <gui/adzap.h>
#include <gui/epgview.h>
#include <gui/eventlist.h>
@@ -671,9 +672,8 @@ 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,wzap);
showTimerEventBar (true, isCurrentEPG(channel_id));
//show progressbar
if ( epg_done!= -1 )
@@ -783,24 +783,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
break;
case CRCInput::RC_page_up:
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;
int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60;
if (zapBackPeriod < 9)
zapBackPeriod++;
if (zapBackPeriod > 9)
zapBackPeriod = 9;
g_settings.adzap_zapBackPeriod = zapBackPeriod * 60;
showTimerEventBar(true, true);
}
break;
case CRCInput::RC_page_down:
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;
int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60;
if (zapBackPeriod > 1)
zapBackPeriod--;
if (zapBackPeriod < 1)
zapBackPeriod = 1;
g_settings.adzap_zapBackPeriod = zapBackPeriod * 60;
showTimerEventBar(true, true);
}
break;
@@ -889,20 +888,20 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
// 31.05.2002 dirch zapto timer
case CRCInput::RC_yellow:
{
//CTimerdClient timerdclient;
if (g_Timerd->isTimerdAvailable())
if (isCurrentEPG(channel_id))
{
CAdZapMenu::getInstance()->exec(NULL, "enable");
loop = false;
}
//CTimerdClient timerdclient;
else if (g_Timerd->isTimerdAvailable())
{
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 - (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);
}
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);
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
}
else
@@ -1170,7 +1169,7 @@ const struct button_label EpgButtons[] =
};
void CEpgData::showTimerEventBar (bool pshow, bool webzap)
void CEpgData::showTimerEventBar (bool pshow, bool adzap)
{
int x,y,h,fh;
@@ -1192,16 +1191,17 @@ void CEpgData::showTimerEventBar (bool pshow, bool webzap)
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 && !g_Timerd->adzap_eventID){
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);
std::string adzap_button;
if (adzap)
{
adzap_button = g_Locale->getText(LOCALE_ADZAP);
adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " ";
adzap_button += 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,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),1);
::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 2);
else
::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);
::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1);
#if 0
// Button: Timer Record & Channelswitch

View File

@@ -87,7 +87,7 @@ 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, bool webzap=false);
void showTimerEventBar(bool show, bool adzap = false);
bool isCurrentEPG(const t_channel_id channel_id);
public:

View File

@@ -484,7 +484,6 @@ 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);
@@ -1058,7 +1057,6 @@ 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

View File

@@ -196,7 +196,6 @@ 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;

View File

@@ -1294,9 +1294,6 @@ void CTimerEvent_Zapto::announceEvent()
//------------------------------------------------------------
void CTimerEvent_Zapto::fireEvent()
{
if(CTimerdClient::adzap_eventID == eventID)
CTimerdClient::adzap_eventID = 0;//reset adzap flag
CTimerManager::getInstance()->getEventServer()->sendEvent(CTimerdClient::EVT_ZAPTO,
CEventServer::INITID_TIMERD,
&eventInfo,