- epgplus: add channellogo to header

This commit is contained in:
svenhoefer
2017-04-22 16:11:55 +02:00
parent 9ef6c49a23
commit e74db896bb
2 changed files with 33 additions and 2 deletions

View File

@@ -115,6 +115,12 @@ void EpgPlus::Header::paint(const char * Name)
if (this->head) if (this->head)
{ {
if (g_settings.channellist_show_channellogo)
{
// ensure to have clean background
this->head->getChannelLogoObject()->hide();
this->head->getChannelLogoObject()->allowPaint(false);
}
this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); this->head->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight());
this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK); this->head->setCaption(caption, CTextBox::NO_AUTO_LINEBREAK);
this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP);
@@ -123,6 +129,24 @@ void EpgPlus::Header::paint(const char * Name)
} }
} }
void EpgPlus::Header::paintChannelLogo(const CZapitChannel * Channel)
{
if (!g_settings.channellist_show_channellogo)
return;
if (this->head)
{
this->head->getChannelLogoObject()->hide();
this->head->getChannelLogoObject()->clearSavedScreen();
if (Channel)
{
this->head->setChannelLogo(Channel->getChannelID(), Channel->getName());
}
this->head->getChannelLogoObject()->allowPaint(true);
this->head->getChannelLogoObject()->paint();
}
}
int EpgPlus::Header::getUsedHeight() int EpgPlus::Header::getUsedHeight()
{ {
return font->getHeight(); return font->getHeight();
@@ -368,7 +392,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, 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;
@@ -383,6 +407,7 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex,
this->index = pindex; this->index = pindex;
this->frameBuffer = pframeBuffer; this->frameBuffer = pframeBuffer;
this->header = pheader;
this->footer = pfooter; this->footer = pfooter;
this->bouquetList = pbouquetList; this->bouquetList = pbouquetList;
@@ -510,6 +535,8 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime)
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);
} }
} }
@@ -644,7 +671,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
CZapitChannel * channel = (*this->channelList)[i]; CZapitChannel * channel = (*this->channelList)[i];
ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, 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));
CChannelEventList channelEventList; CChannelEventList channelEventList;
CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList);

View File

@@ -84,6 +84,8 @@ class EpgPlus
void paint(const char * Name = NULL); void paint(const char * Name = NULL);
void paintChannelLogo(const CZapitChannel * Channel = NULL);
static int getUsedHeight(); static int getUsedHeight();
//// attributes //// attributes
@@ -192,6 +194,7 @@ class EpgPlus
ChannelEntry(const CZapitChannel* channel, ChannelEntry(const CZapitChannel* channel,
int index, int index,
CFrameBuffer* frameBuffer, CFrameBuffer* frameBuffer,
Header* header,
Footer* footer, Footer* footer,
CBouquetList* bouquetList, CBouquetList* bouquetList,
int x, int x,
@@ -216,6 +219,7 @@ class EpgPlus
int index; int index;
CFrameBuffer* frameBuffer; CFrameBuffer* frameBuffer;
Header* header;
Footer* footer; Footer* footer;
CBouquetList* bouquetList; CBouquetList* bouquetList;