mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
- epgplus: formatting code using astyle; some manual code nicenings
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -70,10 +70,10 @@ int EpgPlus::channelsTableWidth = 0;
|
|||||||
int EpgPlus::entryFontSize = 0;
|
int EpgPlus::entryFontSize = 0;
|
||||||
int EpgPlus::channelNumberOffset = 0;
|
int EpgPlus::channelNumberOffset = 0;
|
||||||
|
|
||||||
/* negative size means "screen width in percent" */
|
// negative size means "screen width in percent"
|
||||||
static EpgPlus::SizeSetting sizeSettingTable[] =
|
static EpgPlus::SizeSetting sizeSettingTable[] =
|
||||||
{
|
{
|
||||||
{ EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */
|
{ EpgPlus::EPGPlus_channelentry_width, -15 },
|
||||||
{ EpgPlus::EPGPlus_separationline_thickness, 1 }
|
{ EpgPlus::EPGPlus_separationline_thickness, 1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ static int current_bouquet;
|
|||||||
|
|
||||||
Font *EpgPlus::Header::font = NULL;
|
Font *EpgPlus::Header::font = NULL;
|
||||||
|
|
||||||
EpgPlus::Header::Header(CFrameBuffer * pframeBuffer __attribute__((unused)), int px, int py, int pwidth)
|
EpgPlus::Header::Header(CFrameBuffer *pframeBuffer __attribute__((unused)), int px, int py, int pwidth)
|
||||||
{
|
{
|
||||||
//this->frameBuffer = pframeBuffer;
|
//this->frameBuffer = pframeBuffer;
|
||||||
this->x = px;
|
this->x = px;
|
||||||
@@ -105,7 +105,7 @@ void EpgPlus::Header::init()
|
|||||||
font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
|
font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::Header::paint(const char * Name)
|
void EpgPlus::Header::paint(const char *Name)
|
||||||
{
|
{
|
||||||
std::string caption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD);
|
std::string caption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD);
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ void EpgPlus::Header::paint(const char * Name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel)
|
void EpgPlus::Header::paintChannelLogo(const CZapitChannel *Channel)
|
||||||
{
|
{
|
||||||
if (!g_settings.channellist_show_channellogo)
|
if (!g_settings.channellist_show_channellogo)
|
||||||
return;
|
return;
|
||||||
@@ -159,7 +159,7 @@ int EpgPlus::Header::getUsedHeight()
|
|||||||
Font *EpgPlus::TimeLine::font = NULL;
|
Font *EpgPlus::TimeLine::font = NULL;
|
||||||
int EpgPlus::TimeLine::separationLineThickness = 0;
|
int EpgPlus::TimeLine::separationLineThickness = 0;
|
||||||
|
|
||||||
EpgPlus::TimeLine::TimeLine(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX)
|
EpgPlus::TimeLine::TimeLine(CFrameBuffer *pframeBuffer, int px, int py, int pwidth, int pstartX, int pdurationX)
|
||||||
{
|
{
|
||||||
this->frameBuffer = pframeBuffer;
|
this->frameBuffer = pframeBuffer;
|
||||||
this->x = px;
|
this->x = px;
|
||||||
@@ -193,10 +193,10 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration)
|
|||||||
|
|
||||||
// display date of begin
|
// display date of begin
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(),
|
||||||
COL_MENUCONTENT_PLUS_0);
|
COL_MENUCONTENT_PLUS_0);
|
||||||
|
|
||||||
this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(),
|
this->font->RenderString(this->x + OFFSET_INNER_MID, this->y + this->font->getHeight(),
|
||||||
this->width, EpgPlus::getTimeString(_startTime, "%d-%b"), COL_MENUCONTENT_TEXT);
|
this->width, EpgPlus::getTimeString(_startTime, "%d-%b"), COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
// paint ticks
|
// paint ticks
|
||||||
for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks)
|
for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks)
|
||||||
@@ -206,19 +206,19 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration)
|
|||||||
xWidth = this->x + width - xPos;
|
xWidth = this->x + width - xPos;
|
||||||
|
|
||||||
this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(xPos, this->y, xWidth, this->font->getHeight(),
|
||||||
toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1);
|
toggleColor ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENT_PLUS_1);
|
||||||
|
|
||||||
std::string timeStr = EpgPlus::getTimeString(tickTime, "%H");
|
std::string timeStr = EpgPlus::getTimeString(tickTime, "%H");
|
||||||
|
|
||||||
int textWidth = this->font->getRenderWidth(timeStr);
|
int textWidth = this->font->getRenderWidth(timeStr);
|
||||||
|
|
||||||
this->font->RenderString(xPos - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight(),
|
this->font->RenderString(xPos - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight(),
|
||||||
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
timeStr = EpgPlus::getTimeString(tickTime, "%M");
|
timeStr = EpgPlus::getTimeString(tickTime, "%M");
|
||||||
textWidth = this->font->getRenderWidth(timeStr);
|
textWidth = this->font->getRenderWidth(timeStr);
|
||||||
this->font->RenderString(xPos + OFFSET_INNER_MIN, this->y + this->font->getHeight(),
|
this->font->RenderString(xPos + OFFSET_INNER_MIN, this->y + this->font->getHeight(),
|
||||||
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
toggleColor = !toggleColor;
|
toggleColor = !toggleColor;
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
|
|||||||
|
|
||||||
// paint new mark
|
// paint new mark
|
||||||
CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight());
|
CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight());
|
||||||
pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0);
|
//pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0);
|
||||||
pbbar.setType(CProgressBar::PB_TIMESCALE);
|
pbbar.setType(CProgressBar::PB_TIMESCALE);
|
||||||
|
|
||||||
time_t currentTime;
|
time_t currentTime;
|
||||||
@@ -267,7 +267,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
|
|||||||
int textWidth = this->font->getRenderWidth(timeStr);
|
int textWidth = this->font->getRenderWidth(timeStr);
|
||||||
|
|
||||||
this->font->RenderString(px - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(),
|
this->font->RenderString(px - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(),
|
||||||
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
textWidth, timeStr, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
// display end time
|
// display end time
|
||||||
timeStr = EpgPlus::getTimeString(_startTime + pduration, "%H:%M");
|
timeStr = EpgPlus::getTimeString(_startTime + pduration, "%H:%M");
|
||||||
@@ -279,7 +279,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
|
|||||||
// display end time after mark
|
// display end time after mark
|
||||||
textX = px + pwidth + OFFSET_INNER_MIN;
|
textX = px + pwidth + OFFSET_INNER_MIN;
|
||||||
}
|
}
|
||||||
else if (textWidth < pwidth - 2*OFFSET_INNER_MIN)
|
else if (textWidth < pwidth - 2 * OFFSET_INNER_MIN)
|
||||||
{
|
{
|
||||||
// display end time before mark
|
// display end time before mark
|
||||||
textX = px + pwidth - textWidth - OFFSET_INNER_MIN;
|
textX = px + pwidth - textWidth - OFFSET_INNER_MIN;
|
||||||
@@ -292,32 +292,32 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
|
|||||||
if (separationLineThickness > 0)
|
if (separationLineThickness > 0)
|
||||||
{
|
{
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(),
|
||||||
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::TimeLine::clearMark()
|
void EpgPlus::TimeLine::clearMark()
|
||||||
{
|
{
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
||||||
this->width, this->font->getHeight() , COL_MENUCONTENT_PLUS_0);
|
this->width, this->font->getHeight(), COL_MENUCONTENT_PLUS_0);
|
||||||
|
|
||||||
// paint the separation line
|
// paint the separation line
|
||||||
if (separationLineThickness > 0)
|
if (separationLineThickness > 0)
|
||||||
{
|
{
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight() + this->font->getHeight(),
|
||||||
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int EpgPlus::TimeLine::getUsedHeight()
|
int EpgPlus::TimeLine::getUsedHeight()
|
||||||
{
|
{
|
||||||
return 2*font->getHeight() + separationLineThickness;
|
return 2 * font->getHeight() + separationLineThickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
Font *EpgPlus::ChannelEventEntry::font = NULL;
|
Font *EpgPlus::ChannelEventEntry::font = NULL;
|
||||||
int EpgPlus::ChannelEventEntry::separationLineThickness = 0;
|
int EpgPlus::ChannelEventEntry::separationLineThickness = 0;
|
||||||
|
|
||||||
EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent * pchannelEvent, CFrameBuffer * pframeBuffer, TimeLine * ptimeLine, Footer * pfooter, int px, int py, int pwidth)
|
EpgPlus::ChannelEventEntry::ChannelEventEntry(const CChannelEvent *pchannelEvent, CFrameBuffer *pframeBuffer, TimeLine *ptimeLine, Footer *pfooter, int px, int py, int pwidth)
|
||||||
{
|
{
|
||||||
// copy neccessary?
|
// copy neccessary?
|
||||||
if (pchannelEvent != NULL)
|
if (pchannelEvent != NULL)
|
||||||
@@ -358,24 +358,25 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor)
|
|||||||
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor);
|
this->frameBuffer->paintBoxRel(this->x, this->y, this->width, this->font->getHeight(), bgcolor);
|
||||||
|
|
||||||
this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(),
|
this->font->RenderString(this->x + OFFSET_INNER_SMALL, this->y + this->font->getHeight(),
|
||||||
this->width - 2*OFFSET_INNER_SMALL > 0 ? this->width - 2*OFFSET_INNER_SMALL : 0, this->channelEvent.description, color);
|
this->width - 2 * OFFSET_INNER_SMALL > 0 ? this->width - 2 * OFFSET_INNER_SMALL : 0, this->channelEvent.description, color);
|
||||||
|
|
||||||
// paint the separation lines
|
// paint the separation lines
|
||||||
if (separationLineThickness > 0)
|
if (separationLineThickness > 0)
|
||||||
{
|
{
|
||||||
// left side
|
// left side
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y,
|
this->frameBuffer->paintBoxRel(this->x, this->y,
|
||||||
this->separationLineThickness, this->font->getHeight(), COL_MENUCONTENTDARK_PLUS_0);
|
this->separationLineThickness, this->font->getHeight(), COL_MENUCONTENTDARK_PLUS_0);
|
||||||
|
|
||||||
// bottom
|
// bottom
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
||||||
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pisSelected)
|
if (pisSelected)
|
||||||
{
|
{
|
||||||
if (this->channelEvent.description.empty())
|
if (this->channelEvent.description.empty())
|
||||||
{ // dummy channel event
|
{
|
||||||
|
// dummy channel event
|
||||||
this->timeLine->clearMark();
|
this->timeLine->clearMark();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -400,7 +401,7 @@ int EpgPlus::ChannelEventEntry::getUsedHeight()
|
|||||||
Font *EpgPlus::ChannelEntry::font = NULL;
|
Font *EpgPlus::ChannelEntry::font = NULL;
|
||||||
int EpgPlus::ChannelEntry::separationLineThickness = 0;
|
int EpgPlus::ChannelEntry::separationLineThickness = 0;
|
||||||
|
|
||||||
EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, CFrameBuffer * pframeBuffer, Header * pheader, Footer * pfooter, CBouquetList * pbouquetList, int px, int py, int pwidth)
|
EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel *pchannel, int pindex, CFrameBuffer *pframeBuffer, Header *pheader, Footer *pfooter, CBouquetList *pbouquetList, int px, int py, int pwidth)
|
||||||
{
|
{
|
||||||
this->channel = pchannel;
|
this->channel = pchannel;
|
||||||
|
|
||||||
@@ -435,8 +436,8 @@ void EpgPlus::ChannelEntry::init()
|
|||||||
EpgPlus::ChannelEntry::~ChannelEntry()
|
EpgPlus::ChannelEntry::~ChannelEntry()
|
||||||
{
|
{
|
||||||
for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin();
|
for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin();
|
||||||
It != this->channelEventEntries.end();
|
It != this->channelEventEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
delete *It;
|
delete *It;
|
||||||
}
|
}
|
||||||
@@ -468,13 +469,13 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
|
|||||||
{
|
{
|
||||||
// display channelnumber
|
// display channelnumber
|
||||||
int xOffset = EpgPlus::channelNumberOffset - this->font->getRenderWidth(this->displayNumber);
|
int xOffset = EpgPlus::channelNumberOffset - this->font->getRenderWidth(this->displayNumber);
|
||||||
this->font->RenderString(xPos + xOffset, this->y + this->font->getHeight(), this->width - 2*OFFSET_INNER_MID, this->displayNumber, color);
|
this->font->RenderString(xPos + xOffset, this->y + this->font->getHeight(), this->width - 2 * OFFSET_INNER_MID, this->displayNumber, color);
|
||||||
numberWidth = EpgPlus::channelNumberOffset + OFFSET_INNER_SMALL;
|
numberWidth = EpgPlus::channelNumberOffset + OFFSET_INNER_SMALL;
|
||||||
xPos += numberWidth;
|
xPos += numberWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// display channelname
|
// display channelname
|
||||||
this->font->RenderString(xPos, this->y + this->font->getHeight(), this->width - numberWidth - 2*OFFSET_INNER_MID, this->displayName, color);
|
this->font->RenderString(xPos, this->y + this->font->getHeight(), this->width - numberWidth - 2 * OFFSET_INNER_MID, this->displayName, color);
|
||||||
|
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
{
|
{
|
||||||
@@ -510,13 +511,13 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
|
|||||||
if (separationLineThickness > 0)
|
if (separationLineThickness > 0)
|
||||||
{
|
{
|
||||||
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
this->frameBuffer->paintBoxRel(this->x, this->y + this->font->getHeight(),
|
||||||
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
this->width, this->separationLineThickness, COL_MENUCONTENTDARK_PLUS_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool toggleColor = false;
|
bool toggleColor = false;
|
||||||
for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin();
|
for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin();
|
||||||
It != this->channelEventEntries.end();
|
It != this->channelEventEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
(*It)->paint(isSelected && (*It)->isSelected(_selectedTime), toggleColor);
|
(*It)->paint(isSelected && (*It)->isSelected(_selectedTime), toggleColor);
|
||||||
|
|
||||||
@@ -534,14 +535,14 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
|
|||||||
// paint detailsline
|
// paint detailsline
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
{
|
{
|
||||||
xPos = this->x - DETAILSLINE_WIDTH;
|
xPos = this->x - DETAILSLINE_WIDTH;
|
||||||
int yPosTop = this->y + this->font->getHeight()/2;
|
int yPosTop = this->y + this->font->getHeight() / 2;
|
||||||
int yPosBottom = this->footer->y + this->footer->getUsedHeight()/2;
|
int yPosBottom = this->footer->y + this->footer->getUsedHeight() / 2;
|
||||||
|
|
||||||
if (detailsLine == NULL)
|
if (detailsLine == NULL)
|
||||||
detailsLine = new CComponentsDetailsLine();
|
detailsLine = new CComponentsDetailsLine();
|
||||||
|
|
||||||
detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight()/2, this->footer->getUsedHeight() - RADIUS_LARGE*2);
|
detailsLine->setDimensionsAll(xPos, yPosTop, yPosBottom, this->font->getHeight() / 2, this->footer->getUsedHeight() - RADIUS_LARGE * 2);
|
||||||
detailsLine->paint(false);
|
detailsLine->paint(false);
|
||||||
|
|
||||||
this->header->paintChannelLogo(this->channel);
|
this->header->paintChannelLogo(this->channel);
|
||||||
@@ -557,7 +558,7 @@ Font *EpgPlus::Footer::fontBouquetChannelName = NULL;
|
|||||||
Font *EpgPlus::Footer::fontEventDescription = NULL;
|
Font *EpgPlus::Footer::fontEventDescription = NULL;
|
||||||
Font *EpgPlus::Footer::fontEventInfo1 = NULL;
|
Font *EpgPlus::Footer::fontEventInfo1 = NULL;
|
||||||
|
|
||||||
EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int pbuttonHeight)
|
EpgPlus::Footer::Footer(CFrameBuffer *pframeBuffer, int px, int py, int pwidth, int pbuttonHeight)
|
||||||
{
|
{
|
||||||
this->frameBuffer = pframeBuffer;
|
this->frameBuffer = pframeBuffer;
|
||||||
this->x = px;
|
this->x = px;
|
||||||
@@ -579,7 +580,7 @@ void EpgPlus::Footer::init()
|
|||||||
fontEventInfo1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT];
|
fontEventInfo1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT];
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName, const std::string & newChannelName)
|
void EpgPlus::Footer::setBouquetChannelName(const std::string &newBouquetName, const std::string &newChannelName)
|
||||||
{
|
{
|
||||||
this->currentBouquetName = newBouquetName;
|
this->currentBouquetName = newBouquetName;
|
||||||
this->currentChannelName = newChannelName;
|
this->currentChannelName = newChannelName;
|
||||||
@@ -587,13 +588,13 @@ void EpgPlus::Footer::setBouquetChannelName(const std::string & newBouquetName,
|
|||||||
|
|
||||||
int EpgPlus::Footer::getUsedHeight()
|
int EpgPlus::Footer::getUsedHeight()
|
||||||
{
|
{
|
||||||
return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventInfo1->getHeight() + 2*OFFSET_INNER_SMALL;
|
return fontBouquetChannelName->getHeight() + fontEventDescription->getHeight() + fontEventInfo1->getHeight() + 2 * OFFSET_INNER_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::Footer::paintEventDetails(const std::string & description, const std::string & info1)
|
void EpgPlus::Footer::paintEventDetails(const std::string &description, const std::string &info1)
|
||||||
{
|
{
|
||||||
int yPos = this->y;
|
int yPos = this->y;
|
||||||
int frame_thickness = 2;
|
int frame_thickness = 1;
|
||||||
|
|
||||||
// clear the whole footer
|
// clear the whole footer
|
||||||
this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE);
|
this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE);
|
||||||
@@ -602,15 +603,15 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s
|
|||||||
|
|
||||||
// display bouquet and channel name
|
// display bouquet and channel name
|
||||||
yPos += OFFSET_INNER_SMALL + this->fontBouquetChannelName->getHeight();
|
yPos += OFFSET_INNER_SMALL + this->fontBouquetChannelName->getHeight();
|
||||||
this->fontBouquetChannelName->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT);
|
this->fontBouquetChannelName->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2 * OFFSET_INNER_MID, this->currentBouquetName + ": " + this->currentChannelName, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
// display event's descrition
|
// display event's descrition
|
||||||
yPos += this->fontEventDescription->getHeight();
|
yPos += this->fontEventDescription->getHeight();
|
||||||
this->fontEventDescription->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, description, COL_MENUCONTENT_TEXT);
|
this->fontEventDescription->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2 * OFFSET_INNER_MID, description, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
// display event's info1
|
// display event's info1
|
||||||
yPos += this->fontEventInfo1->getHeight();
|
yPos += this->fontEventInfo1->getHeight();
|
||||||
this->fontEventInfo1->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2*OFFSET_INNER_MID, info1, COL_MENUCONTENT_TEXT);
|
this->fontEventInfo1->RenderString(this->x + OFFSET_INNER_MID, yPos, this->width - 2 * OFFSET_INNER_MID, info1, COL_MENUCONTENT_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct button_label buttonLabels[] =
|
struct button_label buttonLabels[] =
|
||||||
@@ -619,15 +620,15 @@ struct button_label buttonLabels[] =
|
|||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EPGPLUS_PREV_BOUQUET },
|
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EPGPLUS_PREV_BOUQUET },
|
||||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_EPGPLUS_NEXT_BOUQUET },
|
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_EPGPLUS_NEXT_BOUQUET },
|
||||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGPLUS_OPTIONS },
|
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGPLUS_OPTIONS },
|
||||||
{ NEUTRINO_ICON_BUTTON_INFO_SMALL,LOCALE_EPGMENU_EVENTINFO }
|
{ NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_EPGMENU_EVENTINFO }
|
||||||
};
|
};
|
||||||
|
|
||||||
void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons)
|
void EpgPlus::Footer::paintButtons(button_label *pbuttonLabels, int numberOfButtons)
|
||||||
{
|
{
|
||||||
int buttonWidth = (this->width);
|
int buttonWidth = (this->width);
|
||||||
CComponentsFooter foot;
|
CComponentsFooter foot;
|
||||||
foot.enableShadow(CC_SHADOW_ON, -1, true);
|
foot.enableShadow(CC_SHADOW_ON, -1, true);
|
||||||
foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons);
|
foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth / numberOfButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
EpgPlus::EpgPlus()
|
EpgPlus::EpgPlus()
|
||||||
@@ -644,8 +645,8 @@ EpgPlus::~EpgPlus()
|
|||||||
void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
||||||
{
|
{
|
||||||
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
||||||
It != this->displayedChannelEntries.end();
|
It != this->displayedChannelEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
delete *It;
|
delete *It;
|
||||||
}
|
}
|
||||||
@@ -675,11 +676,11 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
int yPosEventEntry = this->eventsTableY;
|
int yPosEventEntry = this->eventsTableY;
|
||||||
|
|
||||||
for (int i = this->channelListStartIndex;
|
for (int i = this->channelListStartIndex;
|
||||||
(i < this->channelListStartIndex + this->maxNumberOfDisplayableEntries) && (i < this->channelList->getSize());
|
(i < this->channelListStartIndex + this->maxNumberOfDisplayableEntries) && (i < this->channelList->getSize());
|
||||||
++i, yPosChannelEntry += this->entryHeight, yPosEventEntry += this->entryHeight)
|
++i, yPosChannelEntry += this->entryHeight, yPosEventEntry += this->entryHeight)
|
||||||
{
|
{
|
||||||
|
|
||||||
CZapitChannel * channel = (*this->channelList)[i];
|
CZapitChannel *channel = (*this->channelList)[i];
|
||||||
|
|
||||||
ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->header, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth);
|
ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->header, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth);
|
||||||
//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL));
|
//printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL));
|
||||||
@@ -695,12 +696,13 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
for (CChannelEventList::const_iterator It = channelEventList.begin(); It != channelEventList.end(); ++It)
|
for (CChannelEventList::const_iterator It = channelEventList.begin(); It != channelEventList.end(); ++It)
|
||||||
{
|
{
|
||||||
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration));
|
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration));
|
||||||
if (!(It->startTime < (this->startTime + this->duration)) )
|
if (!(It->startTime < (this->startTime + this->duration)))
|
||||||
continue;
|
continue;
|
||||||
if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime)) {
|
if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime))
|
||||||
|
{
|
||||||
int startTimeDiff = It->startTime - this->startTime;
|
int startTimeDiff = It->startTime - this->startTime;
|
||||||
int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration);
|
int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration);
|
||||||
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str());
|
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str());
|
||||||
if ((startTimeDiff >= 0) && (endTimeDiff >= 0))
|
if ((startTimeDiff >= 0) && (endTimeDiff >= 0))
|
||||||
{
|
{
|
||||||
// channel event fits completely in the visible part of time line
|
// channel event fits completely in the visible part of time line
|
||||||
@@ -725,13 +727,13 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
{
|
{
|
||||||
// channel event starts and ends after visible part of the time line => break the loop
|
// channel event starts and ends after visible part of the time line => break the loop
|
||||||
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n");
|
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** break 1\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// channel event starts and ends after visible part of the time line => ignore the channel event
|
// channel event starts and ends after visible part of the time line => ignore the channel event
|
||||||
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff);
|
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** continue 1 startTimeDiff %ld endTimeDiff %ld\n", startTimeDiff, endTimeDiff);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastEndTime < It->startTime)
|
if (lastEndTime < It->startTime)
|
||||||
@@ -741,8 +743,8 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
channelEvent.startTime = lastEndTime;
|
channelEvent.startTime = lastEndTime;
|
||||||
channelEvent.duration = It->startTime - channelEvent.startTime;
|
channelEvent.duration = It->startTime - channelEvent.startTime;
|
||||||
|
|
||||||
ChannelEventEntry *channelEventEntry = new ChannelEventEntry (&channelEvent, this->frameBuffer, this->timeLine, this->footer, this->eventsTableX + ((channelEvent.startTime - this->startTime) * this->eventsTableWidth) / this->duration, yPosEventEntry, (channelEvent.duration * this->eventsTableWidth) / this->duration + 1);
|
ChannelEventEntry *channelEventEntry = new ChannelEventEntry(&channelEvent, this->frameBuffer, this->timeLine, this->footer, this->eventsTableX + ((channelEvent.startTime - this->startTime) * this->eventsTableWidth) / this->duration, yPosEventEntry, (channelEvent.duration * this->eventsTableWidth) / this->duration + 1);
|
||||||
channelEntry->channelEventEntries.push_back (channelEventEntry);
|
channelEntry->channelEventEntries.push_back(channelEventEntry);
|
||||||
}
|
}
|
||||||
// correct position
|
// correct position
|
||||||
int xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration;
|
int xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration;
|
||||||
@@ -756,7 +758,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
if (xPosEventEntry + widthEventEntry > this->eventsTableX + this->eventsTableWidth)
|
if (xPosEventEntry + widthEventEntry > this->eventsTableX + this->eventsTableWidth)
|
||||||
widthEventEntry = this->eventsTableX + this->eventsTableWidth - xPosEventEntry;
|
widthEventEntry = this->eventsTableX + this->eventsTableWidth - xPosEventEntry;
|
||||||
|
|
||||||
ChannelEventEntry *channelEventEntry = new ChannelEventEntry(&(*It) , this->frameBuffer, this->timeLine, this->footer, xPosEventEntry, yPosEventEntry, widthEventEntry);
|
ChannelEventEntry *channelEventEntry = new ChannelEventEntry(&(*It), this->frameBuffer, this->timeLine, this->footer, xPosEventEntry, yPosEventEntry, widthEventEntry);
|
||||||
|
|
||||||
channelEntry->channelEventEntries.push_back(channelEventEntry);
|
channelEntry->channelEventEntries.push_back(channelEventEntry);
|
||||||
lastEndTime = It->startTime + It->duration;
|
lastEndTime = It->startTime + It->duration;
|
||||||
@@ -783,8 +785,8 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
|
|||||||
// get largest channelnumber
|
// get largest channelnumber
|
||||||
int n = 1;
|
int n = 1;
|
||||||
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
||||||
It != this->displayedChannelEntries.end();
|
It != this->displayedChannelEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
n = std::max(n, (*It)->channel->number);
|
n = std::max(n, (*It)->channel->number);
|
||||||
}
|
}
|
||||||
@@ -891,7 +893,7 @@ void EpgPlus::free()
|
|||||||
delete this->footer;
|
delete this->footer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouquetList *pbouquetList)
|
int EpgPlus::exec(CChannelList *pchannelList, int selectedChannelIndex, CBouquetList *pbouquetList)
|
||||||
{
|
{
|
||||||
this->channelList = pchannelList;
|
this->channelList = pchannelList;
|
||||||
this->channelListStartIndex = int (selectedChannelIndex / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
this->channelListStartIndex = int (selectedChannelIndex / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
||||||
@@ -984,12 +986,12 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
selected += step;
|
selected += step;
|
||||||
if (selected >= listSize)
|
if (selected >= listSize)
|
||||||
{
|
{
|
||||||
if ((listSize - step -1 < prev_selected) && (prev_selected != (listSize - 1)))
|
if ((listSize - step - 1 < prev_selected) && (prev_selected != (listSize - 1)))
|
||||||
selected = listSize - 1;
|
selected = listSize - 1;
|
||||||
else if (((listSize / step) + 1) * step == listSize + step) // last page has full entries
|
else if (((listSize / step) + 1) * step == listSize + step) // last page has full entries
|
||||||
selected = 0;
|
selected = 0;
|
||||||
else
|
else
|
||||||
selected = ((selected < (((listSize / step)+1) * step))) ? (listSize - 1) : 0;
|
selected = ((selected < (((listSize / step) + 1) * step))) ? (listSize - 1) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->createChannelEntries(selected);
|
this->createChannelEntries(selected);
|
||||||
@@ -1002,7 +1004,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
int step = this->maxNumberOfDisplayableEntries;
|
int step = this->maxNumberOfDisplayableEntries;
|
||||||
|
|
||||||
selected -= step;
|
selected -= step;
|
||||||
if ((prev_selected-step) < 0)
|
if ((prev_selected - step) < 0)
|
||||||
{
|
{
|
||||||
if (prev_selected != 0 && step != 1)
|
if (prev_selected != 0 && step != 1)
|
||||||
selected = 0;
|
selected = 0;
|
||||||
@@ -1018,12 +1020,12 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
if (!bouquetList->Bouquets.empty())
|
if (!bouquetList->Bouquets.empty())
|
||||||
{
|
{
|
||||||
bool found = true;
|
bool found = true;
|
||||||
uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size();
|
uint32_t nNext = (bouquetList->getActiveBouquetNumber() + 1) % bouquetList->Bouquets.size();
|
||||||
//printf("EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext);
|
//printf("EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext);
|
||||||
if (bouquetList->Bouquets[nNext]->channelList->isEmpty())
|
if (bouquetList->Bouquets[nNext]->channelList->isEmpty())
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0;
|
nNext = nNext < bouquetList->Bouquets.size() - 1 ? nNext + 1 : 0;
|
||||||
for (uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++)
|
for (uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++)
|
||||||
{
|
{
|
||||||
if (!bouquetList->Bouquets[i]->channelList->isEmpty())
|
if (!bouquetList->Bouquets[i]->channelList->isEmpty())
|
||||||
@@ -1040,7 +1042,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
pbouquetList->activateBouquet(nNext, false);
|
pbouquetList->activateBouquet(nNext, false);
|
||||||
this->channelList = bouquetList->Bouquets[nNext]->channelList;
|
this->channelList = bouquetList->Bouquets[nNext]->channelList;
|
||||||
this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
||||||
this->createChannelEntries (channelList->getSelectedChannelIndex());
|
this->createChannelEntries(channelList->getSelectedChannelIndex());
|
||||||
this->header->paint(this->channelList->getName());
|
this->header->paint(this->channelList->getName());
|
||||||
this->paint();
|
this->paint();
|
||||||
}
|
}
|
||||||
@@ -1051,11 +1053,11 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
if (!bouquetList->Bouquets.empty())
|
if (!bouquetList->Bouquets.empty())
|
||||||
{
|
{
|
||||||
bool found = true;
|
bool found = true;
|
||||||
int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size();
|
int nNext = (bouquetList->getActiveBouquetNumber() + bouquetList->Bouquets.size() - 1) % bouquetList->Bouquets.size();
|
||||||
if (bouquetList->Bouquets[nNext]->channelList->isEmpty())
|
if (bouquetList->Bouquets[nNext]->channelList->isEmpty())
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1;
|
nNext = nNext > 0 ? nNext - 1 : bouquetList->Bouquets.size() - 1;
|
||||||
for (int i = nNext; i > 0; i--)
|
for (int i = nNext; i > 0; i--)
|
||||||
{
|
{
|
||||||
if (!bouquetList->Bouquets[i]->channelList->isEmpty())
|
if (!bouquetList->Bouquets[i]->channelList->isEmpty())
|
||||||
@@ -1071,12 +1073,12 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
pbouquetList->activateBouquet(nNext, false);
|
pbouquetList->activateBouquet(nNext, false);
|
||||||
this->channelList = bouquetList->Bouquets[nNext]->channelList;
|
this->channelList = bouquetList->Bouquets[nNext]->channelList;
|
||||||
this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
this->channelListStartIndex = int (channelList->getSelectedChannelIndex() / maxNumberOfDisplayableEntries) * maxNumberOfDisplayableEntries;
|
||||||
this->createChannelEntries (channelList->getSelectedChannelIndex());
|
this->createChannelEntries(channelList->getSelectedChannelIndex());
|
||||||
this->header->paint(this->channelList->getName());
|
this->header->paint(this->channelList->getName());
|
||||||
this->paint();
|
this->paint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_ok)
|
else if (msg == CRCInput::RC_ok)
|
||||||
{
|
{
|
||||||
if (selectedChannelEntry)
|
if (selectedChannelEntry)
|
||||||
@@ -1084,7 +1086,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->getChannelID());
|
CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->getChannelID());
|
||||||
}
|
}
|
||||||
current_bouquet = bouquetList->getActiveBouquetNumber();
|
current_bouquet = bouquetList->getActiveBouquetNumber();
|
||||||
}
|
}
|
||||||
else if (CRCInput::isNumeric(msg) && !bouquetList->Bouquets.empty())
|
else if (CRCInput::isNumeric(msg) && !bouquetList->Bouquets.empty())
|
||||||
{
|
{
|
||||||
this->hide();
|
this->hide();
|
||||||
@@ -1106,7 +1108,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
this->paint();
|
this->paint();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_up && this->selectedChannelEntry != NULL)
|
else if (msg == CRCInput::RC_up && this->selectedChannelEntry != NULL)
|
||||||
{
|
{
|
||||||
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
||||||
@@ -1134,7 +1136,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex);
|
this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex);
|
||||||
this->paintChannelEntry(selectedChannelEntryIndex - this->channelListStartIndex);
|
this->paintChannelEntry(selectedChannelEntryIndex - this->channelListStartIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_down && this->selectedChannelEntry != NULL)
|
else if (msg == CRCInput::RC_down && this->selectedChannelEntry != NULL)
|
||||||
{
|
{
|
||||||
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
|
||||||
@@ -1157,7 +1159,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex);
|
this->paintChannelEntry(prevSelectedChannelEntryIndex - this->channelListStartIndex);
|
||||||
this->paintChannelEntry(this->selectedChannelEntry->index - this->channelListStartIndex);
|
this->paintChannelEntry(this->selectedChannelEntry->index - this->channelListStartIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_red)
|
else if (msg == CRCInput::RC_red)
|
||||||
{
|
{
|
||||||
CMenuWidget menuWidgetActions(LOCALE_EPGPLUS_ACTIONS, NEUTRINO_ICON_FEATURES);
|
CMenuWidget menuWidgetActions(LOCALE_EPGPLUS_ACTIONS, NEUTRINO_ICON_FEATURES);
|
||||||
@@ -1173,7 +1175,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
menuWidgetActions.exec(NULL, "");
|
menuWidgetActions.exec(NULL, "");
|
||||||
|
|
||||||
this->refreshAll = true;
|
this->refreshAll = true;
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_blue)
|
else if (msg == CRCInput::RC_blue)
|
||||||
{
|
{
|
||||||
CMenuWidget menuWidgetOptions(LOCALE_EPGPLUS_OPTIONS, NEUTRINO_ICON_FEATURES);
|
CMenuWidget menuWidgetOptions(LOCALE_EPGPLUS_OPTIONS, NEUTRINO_ICON_FEATURES);
|
||||||
@@ -1190,7 +1192,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
{
|
{
|
||||||
this->refreshAll = true;
|
this->refreshAll = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_left)
|
else if (msg == CRCInput::RC_left)
|
||||||
{
|
{
|
||||||
switch (this->currentViewMode)
|
switch (this->currentViewMode)
|
||||||
@@ -1207,13 +1209,13 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
}
|
}
|
||||||
case ViewMode_Scroll:
|
case ViewMode_Scroll:
|
||||||
{
|
{
|
||||||
if(this->selectedChannelEntry == NULL)
|
if (this->selectedChannelEntry == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
||||||
|
|
||||||
if ((It != this->selectedChannelEntry->channelEventEntries.begin())
|
if ((It != this->selectedChannelEntry->channelEventEntries.begin())
|
||||||
&& (It != this->selectedChannelEntry->channelEventEntries.end()))
|
&& (It != this->selectedChannelEntry->channelEventEntries.end()))
|
||||||
{
|
{
|
||||||
--It;
|
--It;
|
||||||
this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2;
|
this->selectedTime = (*It)->channelEvent.startTime + (*It)->channelEvent.duration / 2;
|
||||||
@@ -1235,7 +1237,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
this->startTime = this->firstStartTime;
|
this->startTime = this->firstStartTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->selectedTime = this->startTime + this->duration - 1; // select last event
|
this->selectedTime = this->startTime + this->duration - 1; // select last event
|
||||||
this->createChannelEntries(this->selectedChannelEntry->index);
|
this->createChannelEntries(this->selectedChannelEntry->index);
|
||||||
|
|
||||||
this->paint();
|
this->paint();
|
||||||
@@ -1244,7 +1246,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_right)
|
else if (msg == CRCInput::RC_right)
|
||||||
{
|
{
|
||||||
switch (this->currentViewMode)
|
switch (this->currentViewMode)
|
||||||
@@ -1261,13 +1263,13 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
}
|
}
|
||||||
case ViewMode_Scroll:
|
case ViewMode_Scroll:
|
||||||
{
|
{
|
||||||
if(this->selectedChannelEntry == NULL)
|
if (this->selectedChannelEntry == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
||||||
|
|
||||||
if ((It != this->selectedChannelEntry->channelEventEntries.end() - 1)
|
if ((It != this->selectedChannelEntry->channelEventEntries.end() - 1)
|
||||||
&& (It != this->selectedChannelEntry->channelEventEntries.end()))
|
&& (It != this->selectedChannelEntry->channelEventEntries.end()))
|
||||||
{
|
{
|
||||||
++It;
|
++It;
|
||||||
|
|
||||||
@@ -1289,7 +1291,7 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_info && this->selectedChannelEntry != NULL)
|
else if (msg == CRCInput::RC_info && this->selectedChannelEntry != NULL)
|
||||||
{
|
{
|
||||||
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
TCChannelEventEntries::const_iterator It = this->getSelectedEvent();
|
||||||
@@ -1361,8 +1363,8 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
fader.StopFade();
|
fader.StopFade();
|
||||||
#if 0
|
#if 0
|
||||||
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
||||||
It != this->displayedChannelEntries.end();
|
It != this->displayedChannelEntries.end();
|
||||||
It++)
|
It++)
|
||||||
{
|
{
|
||||||
delete *It;
|
delete *It;
|
||||||
}
|
}
|
||||||
@@ -1372,8 +1374,8 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
while (this->refreshAll);
|
while (this->refreshAll);
|
||||||
|
|
||||||
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
for (TChannelEntries::iterator It = this->displayedChannelEntries.begin();
|
||||||
It != this->displayedChannelEntries.end();
|
It != this->displayedChannelEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
delete *It;
|
delete *It;
|
||||||
}
|
}
|
||||||
@@ -1388,8 +1390,8 @@ int EpgPlus::exec(CChannelList * pchannelList, int selectedChannelIndex, CBouque
|
|||||||
EpgPlus::TCChannelEventEntries::const_iterator EpgPlus::getSelectedEvent() const
|
EpgPlus::TCChannelEventEntries::const_iterator EpgPlus::getSelectedEvent() const
|
||||||
{
|
{
|
||||||
for (TCChannelEventEntries::const_iterator It = this->selectedChannelEntry->channelEventEntries.begin();
|
for (TCChannelEventEntries::const_iterator It = this->selectedChannelEntry->channelEventEntries.begin();
|
||||||
It != this->selectedChannelEntry->channelEventEntries.end();
|
It != this->selectedChannelEntry->channelEventEntries.end();
|
||||||
++It)
|
++It)
|
||||||
{
|
{
|
||||||
if ((*It)->isSelected(this->selectedTime))
|
if ((*It)->isSelected(this->selectedTime))
|
||||||
{
|
{
|
||||||
@@ -1408,7 +1410,8 @@ void EpgPlus::hide()
|
|||||||
this->header->head = NULL;
|
this->header->head = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->selectedChannelEntry && this->selectedChannelEntry->detailsLine) {
|
if (this->selectedChannelEntry && this->selectedChannelEntry->detailsLine)
|
||||||
|
{
|
||||||
this->selectedChannelEntry->detailsLine->kill();
|
this->selectedChannelEntry->detailsLine->kill();
|
||||||
delete this->selectedChannelEntry->detailsLine;
|
delete this->selectedChannelEntry->detailsLine;
|
||||||
this->selectedChannelEntry->detailsLine = NULL;
|
this->selectedChannelEntry->detailsLine = NULL;
|
||||||
@@ -1429,7 +1432,7 @@ void EpgPlus::paintChannelEntry(int position)
|
|||||||
channelEntry->paint(currentChannelIsSelected, this->selectedTime);
|
channelEntry->paint(currentChannelIsSelected, this->selectedTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string EpgPlus::getTimeString(const time_t & time, const std::string & format)
|
std::string EpgPlus::getTimeString(const time_t &time, const std::string &format)
|
||||||
{
|
{
|
||||||
char tmpstr[256];
|
char tmpstr[256];
|
||||||
struct tm *tmStartTime = localtime(&time);
|
struct tm *tmStartTime = localtime(&time);
|
||||||
@@ -1467,7 +1470,7 @@ void EpgPlus::paint()
|
|||||||
paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL);
|
paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
EpgPlus::MenuTargetAddReminder::MenuTargetAddReminder(EpgPlus * pepgPlus)
|
EpgPlus::MenuTargetAddReminder::MenuTargetAddReminder(EpgPlus *pepgPlus)
|
||||||
{
|
{
|
||||||
this->epgPlus = pepgPlus;
|
this->epgPlus = pepgPlus;
|
||||||
}
|
}
|
||||||
@@ -1477,7 +1480,7 @@ int EpgPlus::MenuTargetAddReminder::exec(CMenuTarget * /*parent*/, const std::st
|
|||||||
TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent();
|
TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent();
|
||||||
|
|
||||||
if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end())
|
if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end())
|
||||||
&& (!(*It)->channelEvent.description.empty()))
|
&& (!(*It)->channelEvent.description.empty()))
|
||||||
{
|
{
|
||||||
if (g_Timerd->isTimerdAvailable())
|
if (g_Timerd->isTimerdAvailable())
|
||||||
{
|
{
|
||||||
@@ -1492,12 +1495,12 @@ int EpgPlus::MenuTargetAddReminder::exec(CMenuTarget * /*parent*/, const std::st
|
|||||||
return menu_return::RETURN_EXIT_ALL;
|
return menu_return::RETURN_EXIT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer(EpgPlus * pepgPlus)
|
EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer(EpgPlus *pepgPlus)
|
||||||
{
|
{
|
||||||
this->epgPlus = pepgPlus;
|
this->epgPlus = pepgPlus;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sortByDateTime(const CChannelEvent& a, const CChannelEvent& b)
|
static bool sortByDateTime(const CChannelEvent &a, const CChannelEvent &b)
|
||||||
{
|
{
|
||||||
return a.startTime < b.startTime;
|
return a.startTime < b.startTime;
|
||||||
}
|
}
|
||||||
@@ -1507,7 +1510,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget * /*parent*/, const std:
|
|||||||
TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent();
|
TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent();
|
||||||
|
|
||||||
if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end())
|
if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end())
|
||||||
&& (!(*It)->channelEvent.description.empty()))
|
&& (!(*It)->channelEvent.description.empty()))
|
||||||
{
|
{
|
||||||
bool doRecord = true;
|
bool doRecord = true;
|
||||||
if (g_settings.recording_already_found_check)
|
if (g_settings.recording_already_found_check)
|
||||||
@@ -1522,7 +1525,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget * /*parent*/, const std:
|
|||||||
{
|
{
|
||||||
printf("already found in moviebrowser: %s\n", rec_title);
|
printf("already found in moviebrowser: %s\n", rec_title);
|
||||||
char message[1024];
|
char message[1024];
|
||||||
snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title);
|
snprintf(message, sizeof(message) - 1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title);
|
||||||
doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes);
|
doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1530,7 +1533,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget * /*parent*/, const std:
|
|||||||
{
|
{
|
||||||
CChannelEventList evtlist;
|
CChannelEventList evtlist;
|
||||||
CEitManager::getInstance()->getEventsServiceKey(this->epgPlus->selectedChannelEntry->channel->channel_id, evtlist);
|
CEitManager::getInstance()->getEventsServiceKey(this->epgPlus->selectedChannelEntry->channel->channel_id, evtlist);
|
||||||
sort(evtlist.begin(),evtlist.end(),sortByDateTime);
|
sort(evtlist.begin(), evtlist.end(), sortByDateTime);
|
||||||
CFollowScreenings m(this->epgPlus->selectedChannelEntry->channel->channel_id,
|
CFollowScreenings m(this->epgPlus->selectedChannelEntry->channel->channel_id,
|
||||||
(*It)->channelEvent.startTime,
|
(*It)->channelEvent.startTime,
|
||||||
(*It)->channelEvent.startTime + (*It)->channelEvent.duration,
|
(*It)->channelEvent.startTime + (*It)->channelEvent.duration,
|
||||||
@@ -1543,7 +1546,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget * /*parent*/, const std:
|
|||||||
return menu_return::RETURN_EXIT_ALL;
|
return menu_return::RETURN_EXIT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EpgPlus::MenuTargetRefreshEpg::MenuTargetRefreshEpg(EpgPlus * pepgPlus)
|
EpgPlus::MenuTargetRefreshEpg::MenuTargetRefreshEpg(EpgPlus *pepgPlus)
|
||||||
{
|
{
|
||||||
this->epgPlus = pepgPlus;
|
this->epgPlus = pepgPlus;
|
||||||
}
|
}
|
||||||
@@ -1560,9 +1563,9 @@ struct CMenuOptionChooser::keyval menuOptionChooserSwitchSwapModes[] =
|
|||||||
{ EpgPlus::SwapMode_ByBouquet, LOCALE_EPGPLUS_BYBOUQUET_MODE }
|
{ EpgPlus::SwapMode_ByBouquet, LOCALE_EPGPLUS_BYBOUQUET_MODE }
|
||||||
};
|
};
|
||||||
|
|
||||||
EpgPlus::MenuOptionChooserSwitchSwapMode::MenuOptionChooserSwitchSwapMode(EpgPlus * pepgPlus)
|
EpgPlus::MenuOptionChooserSwitchSwapMode::MenuOptionChooserSwitchSwapMode(EpgPlus *pepgPlus)
|
||||||
: CMenuOptionChooser(LOCALE_EPGPLUS_SWAP_MODE, (int *) &pepgPlus->currentSwapMode, menuOptionChooserSwitchSwapModes, sizeof(menuOptionChooserSwitchSwapModes) / sizeof(CMenuOptionChooser::keyval),
|
: CMenuOptionChooser(LOCALE_EPGPLUS_SWAP_MODE, (int *) & pepgPlus->currentSwapMode, menuOptionChooserSwitchSwapModes, sizeof(menuOptionChooserSwitchSwapModes) / sizeof(CMenuOptionChooser::keyval),
|
||||||
true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW, 0)
|
true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW, 0)
|
||||||
{
|
{
|
||||||
this->epgPlus = pepgPlus;
|
this->epgPlus = pepgPlus;
|
||||||
this->oldSwapMode = epgPlus->currentSwapMode;
|
this->oldSwapMode = epgPlus->currentSwapMode;
|
||||||
@@ -1594,7 +1597,7 @@ EpgPlus::MenuOptionChooserSwitchSwapMode::~MenuOptionChooserSwitchSwapMode()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int EpgPlus::MenuOptionChooserSwitchSwapMode::exec(CMenuTarget * parent)
|
int EpgPlus::MenuOptionChooserSwitchSwapMode::exec(CMenuTarget *parent)
|
||||||
{
|
{
|
||||||
// change time out settings temporary
|
// change time out settings temporary
|
||||||
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1;
|
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1;
|
||||||
@@ -1610,9 +1613,9 @@ struct CMenuOptionChooser::keyval menuOptionChooserSwitchViewModes[] =
|
|||||||
{ EpgPlus::ViewMode_Stretch, LOCALE_EPGPLUS_SCROLL_MODE }
|
{ EpgPlus::ViewMode_Stretch, LOCALE_EPGPLUS_SCROLL_MODE }
|
||||||
};
|
};
|
||||||
|
|
||||||
EpgPlus::MenuOptionChooserSwitchViewMode::MenuOptionChooserSwitchViewMode(EpgPlus * epgPlus)
|
EpgPlus::MenuOptionChooserSwitchViewMode::MenuOptionChooserSwitchViewMode(EpgPlus *epgPlus)
|
||||||
: CMenuOptionChooser(LOCALE_EPGPLUS_VIEW_MODE, (int *) &epgPlus->currentViewMode, menuOptionChooserSwitchViewModes, sizeof(menuOptionChooserSwitchViewModes) / sizeof(CMenuOptionChooser::keyval),
|
: CMenuOptionChooser(LOCALE_EPGPLUS_VIEW_MODE, (int *) & epgPlus->currentViewMode, menuOptionChooserSwitchViewModes, sizeof(menuOptionChooserSwitchViewModes) / sizeof(CMenuOptionChooser::keyval),
|
||||||
true, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)
|
true, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)
|
||||||
{
|
{
|
||||||
this->oldTimingMenuSettings = g_settings.timing[SNeutrinoSettings::TIMING_MENU];
|
this->oldTimingMenuSettings = g_settings.timing[SNeutrinoSettings::TIMING_MENU];
|
||||||
}
|
}
|
||||||
@@ -1622,7 +1625,7 @@ EpgPlus::MenuOptionChooserSwitchViewMode::~MenuOptionChooserSwitchViewMode()
|
|||||||
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = this->oldTimingMenuSettings;
|
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = this->oldTimingMenuSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EpgPlus::MenuOptionChooserSwitchViewMode::exec(CMenuTarget * parent)
|
int EpgPlus::MenuOptionChooserSwitchViewMode::exec(CMenuTarget *parent)
|
||||||
{
|
{
|
||||||
// change time out settings temporary
|
// change time out settings temporary
|
||||||
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1;
|
g_settings.timing[SNeutrinoSettings::TIMING_MENU] = 1;
|
||||||
@@ -1635,7 +1638,7 @@ int EpgPlus::MenuOptionChooserSwitchViewMode::exec(CMenuTarget * parent)
|
|||||||
// -- EPG+ Menu Handler Class
|
// -- EPG+ Menu Handler Class
|
||||||
// -- to be used for calls from Menu
|
// -- to be used for calls from Menu
|
||||||
|
|
||||||
int CEPGplusHandler::exec(CMenuTarget * parent, const std::string & /*actionKey*/)
|
int CEPGplusHandler::exec(CMenuTarget *parent, const std::string & /*actionKey*/)
|
||||||
{
|
{
|
||||||
int res = menu_return::RETURN_EXIT_ALL;
|
int res = menu_return::RETURN_EXIT_ALL;
|
||||||
EpgPlus *e;
|
EpgPlus *e;
|
||||||
|
@@ -37,7 +37,7 @@ struct button_label;
|
|||||||
|
|
||||||
class EpgPlus
|
class EpgPlus
|
||||||
{
|
{
|
||||||
//// types, inner classes
|
// types, inner classes
|
||||||
public:
|
public:
|
||||||
enum SizeSettingID
|
enum SizeSettingID
|
||||||
{
|
{
|
||||||
@@ -48,8 +48,8 @@ class EpgPlus
|
|||||||
|
|
||||||
struct SizeSetting
|
struct SizeSetting
|
||||||
{
|
{
|
||||||
SizeSettingID settingID;
|
SizeSettingID settingID;
|
||||||
int size;
|
int size;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TViewMode
|
enum TViewMode
|
||||||
@@ -70,43 +70,43 @@ class EpgPlus
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CComponentsChannelLogo *logo;
|
CComponentsChannelLogo *logo;
|
||||||
//// construction / destruction
|
|
||||||
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
Header(CFrameBuffer* frameBuffer,
|
Header(CFrameBuffer *frameBuffer,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width);
|
int width);
|
||||||
|
|
||||||
~Header();
|
~Header();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
void paint(const char * Name = NULL);
|
void paint(const char *Name = NULL);
|
||||||
|
|
||||||
void paintChannelLogo(const CZapitChannel * Channel = NULL);
|
void paintChannelLogo(const CZapitChannel *Channel = NULL);
|
||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
static Font* font;
|
static Font *font;
|
||||||
CComponentsHeader *head;
|
CComponentsHeader *head;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TimeLine
|
class TimeLine
|
||||||
{
|
{
|
||||||
//// construction / destruction
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
TimeLine(CFrameBuffer* frameBuffer,
|
TimeLine(CFrameBuffer *frameBuffer,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
@@ -115,7 +115,7 @@ class EpgPlus
|
|||||||
|
|
||||||
~TimeLine();
|
~TimeLine();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
@@ -129,9 +129,9 @@ class EpgPlus
|
|||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
|
|
||||||
int currentDuration;
|
int currentDuration;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ class EpgPlus
|
|||||||
int width;
|
int width;
|
||||||
static int separationLineThickness;
|
static int separationLineThickness;
|
||||||
|
|
||||||
static Font* font;
|
static Font *font;
|
||||||
|
|
||||||
int startX;
|
int startX;
|
||||||
int durationX;
|
int durationX;
|
||||||
@@ -148,19 +148,19 @@ class EpgPlus
|
|||||||
|
|
||||||
class ChannelEventEntry
|
class ChannelEventEntry
|
||||||
{
|
{
|
||||||
//// construction / destruction
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
ChannelEventEntry(const CChannelEvent* channelEvent,
|
ChannelEventEntry(const CChannelEvent *channelEvent,
|
||||||
CFrameBuffer* frameBuffer,
|
CFrameBuffer *frameBuffer,
|
||||||
TimeLine* timeLine,
|
TimeLine *timeLine,
|
||||||
Footer* footer,
|
Footer *footer,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width);
|
int width);
|
||||||
|
|
||||||
~ChannelEventEntry();
|
~ChannelEventEntry();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
@@ -170,41 +170,41 @@ class EpgPlus
|
|||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
CChannelEvent channelEvent;
|
CChannelEvent channelEvent;
|
||||||
|
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
TimeLine* timeLine;
|
TimeLine *timeLine;
|
||||||
Footer* footer;
|
Footer *footer;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int width;
|
int width;
|
||||||
static int separationLineThickness;
|
static int separationLineThickness;
|
||||||
|
|
||||||
static Font* font;
|
static Font *font;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<ChannelEventEntry*> TCChannelEventEntries;
|
typedef std::vector<ChannelEventEntry *> TCChannelEventEntries;
|
||||||
|
|
||||||
class ChannelEntry
|
class ChannelEntry
|
||||||
{
|
{
|
||||||
//// construction / destruction
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
ChannelEntry(const CZapitChannel* channel,
|
ChannelEntry(const CZapitChannel *channel,
|
||||||
int index,
|
int index,
|
||||||
CFrameBuffer* frameBuffer,
|
CFrameBuffer *frameBuffer,
|
||||||
Header* header,
|
Header *header,
|
||||||
Footer* footer,
|
Footer *footer,
|
||||||
CBouquetList* bouquetList,
|
CBouquetList *bouquetList,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width);
|
int width);
|
||||||
|
|
||||||
~ChannelEntry();
|
~ChannelEntry();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
@@ -212,36 +212,36 @@ class EpgPlus
|
|||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
const CZapitChannel * channel;
|
const CZapitChannel *channel;
|
||||||
std::string displayNumber;
|
std::string displayNumber;
|
||||||
std::string displayName;
|
std::string displayName;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
Header* header;
|
Header *header;
|
||||||
Footer* footer;
|
Footer *footer;
|
||||||
CBouquetList* bouquetList;
|
CBouquetList *bouquetList;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int width;
|
int width;
|
||||||
static int separationLineThickness;
|
static int separationLineThickness;
|
||||||
|
|
||||||
static Font* font;
|
static Font *font;
|
||||||
|
|
||||||
TCChannelEventEntries channelEventEntries;
|
TCChannelEventEntries channelEventEntries;
|
||||||
CComponentsDetailsLine *detailsLine;
|
CComponentsDetailsLine *detailsLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<ChannelEntry*> TChannelEntries;
|
typedef std::vector<ChannelEntry *> TChannelEntries;
|
||||||
|
|
||||||
class Footer
|
class Footer
|
||||||
{
|
{
|
||||||
//// construction / destruction
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
Footer(CFrameBuffer* frameBuffer,
|
Footer(CFrameBuffer *frameBuffer,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
@@ -249,21 +249,21 @@ class EpgPlus
|
|||||||
|
|
||||||
~Footer();
|
~Footer();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
void setBouquetChannelName(const std::string& newBouquetName, const std::string& newChannelName);
|
void setBouquetChannelName(const std::string &newBouquetName, const std::string &newChannelName);
|
||||||
|
|
||||||
void paintEventDetails(const std::string& description, const std::string& shortDescription);
|
void paintEventDetails(const std::string &description, const std::string &shortDescription);
|
||||||
|
|
||||||
void paintButtons(button_label* buttonLabels, int numberOfButtons);
|
void paintButtons(button_label *buttonLabels, int numberOfButtons);
|
||||||
|
|
||||||
static int getUsedHeight();
|
static int getUsedHeight();
|
||||||
|
|
||||||
//// attributes
|
// attributes
|
||||||
public:
|
public:
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
@@ -272,9 +272,9 @@ class EpgPlus
|
|||||||
int buttonY;
|
int buttonY;
|
||||||
int buttonHeight;
|
int buttonHeight;
|
||||||
|
|
||||||
static Font* fontBouquetChannelName;
|
static Font *fontBouquetChannelName;
|
||||||
static Font* fontEventDescription;
|
static Font *fontEventDescription;
|
||||||
static Font* fontEventInfo1;
|
static Font *fontEventInfo1;
|
||||||
|
|
||||||
std::string currentBouquetName;
|
std::string currentBouquetName;
|
||||||
std::string currentChannelName;
|
std::string currentChannelName;
|
||||||
@@ -283,54 +283,54 @@ class EpgPlus
|
|||||||
class MenuTargetAddReminder : public CMenuTarget
|
class MenuTargetAddReminder : public CMenuTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuTargetAddReminder(EpgPlus* epgPlus);
|
MenuTargetAddReminder(EpgPlus *epgPlus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string& actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EpgPlus* epgPlus;
|
EpgPlus *epgPlus;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MenuTargetAddRecordTimer : public CMenuTarget
|
class MenuTargetAddRecordTimer : public CMenuTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuTargetAddRecordTimer(EpgPlus* epgPlus);
|
MenuTargetAddRecordTimer(EpgPlus *epgPlus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string& actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EpgPlus* epgPlus;
|
EpgPlus *epgPlus;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MenuTargetRefreshEpg : public CMenuTarget
|
class MenuTargetRefreshEpg : public CMenuTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuTargetRefreshEpg(EpgPlus* epgPlus);
|
MenuTargetRefreshEpg(EpgPlus *epgPlus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string& actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EpgPlus* epgPlus;
|
EpgPlus *epgPlus;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MenuOptionChooserSwitchSwapMode : public CMenuOptionChooser
|
class MenuOptionChooserSwitchSwapMode : public CMenuOptionChooser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuOptionChooserSwitchSwapMode(EpgPlus* epgPlus);
|
MenuOptionChooserSwitchSwapMode(EpgPlus *epgPlus);
|
||||||
|
|
||||||
virtual ~MenuOptionChooserSwitchSwapMode();
|
virtual ~MenuOptionChooserSwitchSwapMode();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent);
|
int exec(CMenuTarget *parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EpgPlus* epgPlus;
|
EpgPlus *epgPlus;
|
||||||
int oldTimingMenuSettings;
|
int oldTimingMenuSettings;
|
||||||
TSwapMode oldSwapMode;
|
TSwapMode oldSwapMode;
|
||||||
};
|
};
|
||||||
@@ -338,12 +338,12 @@ class EpgPlus
|
|||||||
class MenuOptionChooserSwitchViewMode : public CMenuOptionChooser
|
class MenuOptionChooserSwitchViewMode : public CMenuOptionChooser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuOptionChooserSwitchViewMode(EpgPlus* epgPlus);
|
MenuOptionChooserSwitchViewMode(EpgPlus *epgPlus);
|
||||||
|
|
||||||
virtual ~MenuOptionChooserSwitchViewMode();
|
virtual ~MenuOptionChooserSwitchViewMode();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent);
|
int exec(CMenuTarget *parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int oldTimingMenuSettings;
|
int oldTimingMenuSettings;
|
||||||
@@ -352,13 +352,13 @@ class EpgPlus
|
|||||||
class MenuTargetSettings : public CMenuTarget
|
class MenuTargetSettings : public CMenuTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuTargetSettings(EpgPlus* epgPlus);
|
MenuTargetSettings(EpgPlus *epgPlus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string& actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EpgPlus* epgPlus;
|
EpgPlus *epgPlus;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef time_t DurationSetting;
|
typedef time_t DurationSetting;
|
||||||
@@ -370,13 +370,13 @@ class EpgPlus
|
|||||||
|
|
||||||
virtual ~Settings();
|
virtual ~Settings();
|
||||||
|
|
||||||
FontSetting* fontSettings;
|
FontSetting *fontSettings;
|
||||||
SizeSetting* sizeSettings;
|
SizeSetting *sizeSettings;
|
||||||
DurationSetting durationSetting;
|
DurationSetting durationSetting;
|
||||||
};
|
};
|
||||||
typedef std::map<int, Font*> Fonts;
|
typedef std::map<int, Font *> Fonts;
|
||||||
typedef std::map<int, int> Sizes;
|
typedef std::map<int, int> Sizes;
|
||||||
static Font * fonts[NumberOfFontSettings];
|
static Font *fonts[NumberOfFontSettings];
|
||||||
static int sizes[NumberOfSizeSettings];
|
static int sizes[NumberOfSizeSettings];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -385,20 +385,20 @@ class EpgPlus
|
|||||||
friend class EpgPlus::MenuOptionChooserSwitchSwapMode;
|
friend class EpgPlus::MenuOptionChooserSwitchSwapMode;
|
||||||
friend class EpgPlus::MenuOptionChooserSwitchViewMode;
|
friend class EpgPlus::MenuOptionChooserSwitchViewMode;
|
||||||
|
|
||||||
//// construction / destruction
|
// construction / destruction
|
||||||
public:
|
public:
|
||||||
EpgPlus();
|
EpgPlus();
|
||||||
~EpgPlus();
|
~EpgPlus();
|
||||||
|
|
||||||
//// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
void init();
|
void init();
|
||||||
void free();
|
void free();
|
||||||
|
|
||||||
int exec(CChannelList* channelList, int selectedChannelIndex, CBouquetList* bouquetList);
|
int exec(CChannelList *channelList, int selectedChannelIndex, CBouquetList *bouquetList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string getTimeString(const time_t& time, const std::string& format);
|
static std::string getTimeString(const time_t &time, const std::string &format);
|
||||||
|
|
||||||
TCChannelEventEntries::const_iterator getSelectedEvent() const;
|
TCChannelEventEntries::const_iterator getSelectedEvent() const;
|
||||||
|
|
||||||
@@ -407,79 +407,79 @@ class EpgPlus
|
|||||||
void paintChannelEntry(int position);
|
void paintChannelEntry(int position);
|
||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
//// properties
|
// properties
|
||||||
private:
|
private:
|
||||||
CFrameBuffer* frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
|
|
||||||
TChannelEntries displayedChannelEntries;
|
TChannelEntries displayedChannelEntries;
|
||||||
|
|
||||||
Header* header;
|
Header *header;
|
||||||
TimeLine* timeLine;
|
TimeLine *timeLine;
|
||||||
|
|
||||||
CChannelList* channelList;
|
CChannelList *channelList;
|
||||||
CBouquetList* bouquetList;
|
CBouquetList *bouquetList;
|
||||||
|
|
||||||
Footer* footer;
|
Footer *footer;
|
||||||
|
|
||||||
ChannelEntry* selectedChannelEntry;
|
ChannelEntry *selectedChannelEntry;
|
||||||
time_t selectedTime;
|
time_t selectedTime;
|
||||||
|
|
||||||
int channelListStartIndex;
|
int channelListStartIndex;
|
||||||
int maxNumberOfDisplayableEntries; // maximal number of displayable entrys
|
int maxNumberOfDisplayableEntries; // maximal number of displayable entrys
|
||||||
static int channelNumberOffset;
|
static int channelNumberOffset;
|
||||||
|
|
||||||
time_t startTime;
|
time_t startTime;
|
||||||
time_t firstStartTime;
|
time_t firstStartTime;
|
||||||
static time_t duration;
|
static time_t duration;
|
||||||
|
|
||||||
int entryHeight;
|
int entryHeight;
|
||||||
static int entryFontSize;
|
static int entryFontSize;
|
||||||
|
|
||||||
TViewMode currentViewMode;
|
TViewMode currentViewMode;
|
||||||
TSwapMode currentSwapMode;
|
TSwapMode currentSwapMode;
|
||||||
|
|
||||||
int headerX;
|
int headerX;
|
||||||
int headerY;
|
int headerY;
|
||||||
int headerWidth;
|
int headerWidth;
|
||||||
|
|
||||||
int usableScreenWidth;
|
int usableScreenWidth;
|
||||||
int usableScreenHeight;
|
int usableScreenHeight;
|
||||||
int usableScreenX;
|
int usableScreenX;
|
||||||
int usableScreenY;
|
int usableScreenY;
|
||||||
|
|
||||||
int timeLineX;
|
int timeLineX;
|
||||||
int timeLineY;
|
int timeLineY;
|
||||||
int timeLineWidth;
|
int timeLineWidth;
|
||||||
|
|
||||||
int bodyHeight;
|
int bodyHeight;
|
||||||
|
|
||||||
int channelsTableX;
|
int channelsTableX;
|
||||||
int channelsTableY;
|
int channelsTableY;
|
||||||
static int channelsTableWidth;
|
static int channelsTableWidth;
|
||||||
int channelsTableHeight;
|
int channelsTableHeight;
|
||||||
|
|
||||||
int eventsTableX;
|
int eventsTableX;
|
||||||
int eventsTableY;
|
int eventsTableY;
|
||||||
int eventsTableWidth;
|
int eventsTableWidth;
|
||||||
int eventsTableHeight;
|
int eventsTableHeight;
|
||||||
|
|
||||||
int sliderX;
|
int sliderX;
|
||||||
int sliderY;
|
int sliderY;
|
||||||
static int sliderWidth;
|
static int sliderWidth;
|
||||||
int sliderHeight;
|
int sliderHeight;
|
||||||
|
|
||||||
int footerX;
|
int footerX;
|
||||||
int footerY;
|
int footerY;
|
||||||
int footerWidth;
|
int footerWidth;
|
||||||
|
|
||||||
bool refreshAll;
|
bool refreshAll;
|
||||||
bool refreshFooterButtons;
|
bool refreshFooterButtons;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEPGplusHandler : public CMenuTarget
|
class CEPGplusHandler : public CMenuTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string &actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __epgplus__
|
#endif // __epgplus__
|
||||||
|
Reference in New Issue
Block a user