mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CChannelList: revert of some implementations of CComponents classes
Current state of CChannelList is mostly not compatible with CC-classes and implementations are to expensive at the moment, because more preparations are necessary.
This commit is contained in:
@@ -116,10 +116,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
|
||||
previous_channellist_additional = -1;
|
||||
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
||||
dline = NULL;
|
||||
ibox = NULL;
|
||||
clHead = NULL;
|
||||
indexLogo = 0;
|
||||
|
||||
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -128,8 +124,6 @@ CChannelList::~CChannelList()
|
||||
//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout);
|
||||
chanlist.clear();
|
||||
delete dline;
|
||||
delete ibox;
|
||||
delete clHead;
|
||||
}
|
||||
|
||||
void CChannelList::ClearList(void)
|
||||
@@ -1515,20 +1509,6 @@ void CChannelList::quickZap(int key, bool /* cycle */)
|
||||
g_RCInput->clearRCMsg(); //FIXME test for n.103
|
||||
}
|
||||
|
||||
std::string CChannelList::getInfoTextTransponder(int index)
|
||||
{
|
||||
transponder t;
|
||||
CServiceManager::getInstance()->GetTransponder(chanlist[index]->getTransponderId(), t);
|
||||
|
||||
std::string desc = t.description();
|
||||
if(chanlist[index]->pname)
|
||||
desc = desc + " (" + std::string(chanlist[index]->pname) + ")";
|
||||
else
|
||||
desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")";
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
void CChannelList::paintDetails(int index)
|
||||
{
|
||||
CChannelEvent *p_event = NULL;
|
||||
@@ -1541,14 +1521,13 @@ void CChannelList::paintDetails(int index)
|
||||
if (g_settings.colored_events_channellist == 2)
|
||||
colored_event_N = true;
|
||||
|
||||
if (displayNext)
|
||||
if (displayNext) {
|
||||
p_event = &chanlist[index]->nextEvent;
|
||||
else
|
||||
} else {
|
||||
p_event = &chanlist[index]->currentEvent;
|
||||
}
|
||||
|
||||
//infobox
|
||||
if (ibox)
|
||||
ibox->paint(false);
|
||||
frameBuffer->paintBoxRel(x+2, y + height + 2, full_width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round
|
||||
|
||||
if (!p_event->description.empty()) {
|
||||
char cNoch[50] = {0}; // UTF-8
|
||||
@@ -1615,8 +1594,16 @@ void CChannelList::paintDetails(int index)
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
}
|
||||
if(g_settings.channellist_foot == 0) {
|
||||
std::string transp_info = getInfoTextTransponder(index);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, transp_info.c_str(), COL_MENUCONTENTDARK, 0, true);
|
||||
transponder t;
|
||||
CServiceManager::getInstance()->GetTransponder(chanlist[index]->getTransponderId(), t);
|
||||
|
||||
std::string desc = t.description();
|
||||
if(chanlist[index]->pname)
|
||||
desc = desc + " (" + std::string(chanlist[index]->pname) + ")";
|
||||
else
|
||||
desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")";
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
else if( !displayNext && g_settings.channellist_foot == 1) { // next Event
|
||||
char buf[128] = {0};
|
||||
@@ -1639,40 +1626,52 @@ void CChannelList::paintDetails(int index)
|
||||
|
||||
void CChannelList::clearItem2DetailsLine()
|
||||
{
|
||||
if (dline)
|
||||
dline->kill(); //kill details line
|
||||
paintItem2DetailsLine (-1, 0);
|
||||
}
|
||||
|
||||
void CChannelList::paintItem2DetailsLine (int pos)
|
||||
{
|
||||
int xpos = x - ConnectLineBox_Width;
|
||||
int ypos1 = y + theight+0 + pos*fheight;
|
||||
int ypos2 = y + height + INFO_BOX_Y_OFFSET;
|
||||
int ypos2 = y + height;
|
||||
int ypos1a = ypos1 + (fheight/2)-2;
|
||||
int ypos2a = ypos2 + (info_height/2)-2;
|
||||
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
|
||||
|
||||
if (dline)
|
||||
dline->kill(); //kill details line
|
||||
// // Clear
|
||||
// frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1);
|
||||
|
||||
// init Line if detail info (and not valid list pos)
|
||||
// paint Line if detail info (and not valid list pos)
|
||||
if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") {
|
||||
if(1) // FIXME why -> ? (!g_settings.channellist_extended)
|
||||
{
|
||||
//details line
|
||||
if (dline == NULL)
|
||||
dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2);
|
||||
dline->setYPos(ypos1a);
|
||||
dline->setHMarkDown(info_height-RADIUS_LARGE*2); //required if user has changed osd-settings (corner mode)
|
||||
dline->paint();
|
||||
|
||||
//info box frame
|
||||
frameBuffer->paintBoxFrame(x, ypos2, full_width, info_height, 2, col1, RADIUS_LARGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//infobox
|
||||
if (ibox == NULL)
|
||||
ibox = new CComponentsInfoBox(x, y + height + 2, width, info_height);
|
||||
if (ibox){
|
||||
ibox->setDimensionsAll(x, ypos2, full_width, info_height);
|
||||
ibox->setFrameThickness(2);
|
||||
ibox->setCornerRadius(RADIUS_LARGE);
|
||||
ibox->setShadowOnOff(CC_SHADOW_OFF);
|
||||
ibox->syncSysColors();
|
||||
void CChannelList::showChannelLogo()
|
||||
{
|
||||
if(g_settings.infobar_show_channellogo){
|
||||
static int logo_w = 0;
|
||||
static int logo_h = 0;
|
||||
int logo_w_max = full_width / 4;
|
||||
frameBuffer->paintBoxRel(x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0);
|
||||
|
||||
std::string lname;
|
||||
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) {
|
||||
if((logo_h > theight) || (logo_w > logo_w_max))
|
||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight);
|
||||
g_PicViewer->DisplayImage(lname, x + full_width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1994,31 +1993,46 @@ void CChannelList::paintItem(int pos)
|
||||
|
||||
void CChannelList::paintHead()
|
||||
{
|
||||
if (clHead == NULL) {
|
||||
clHead = new CComponentsTitleBar();
|
||||
clHead->setDimensionsAll(x, y, full_width, theight);
|
||||
int timestr_len = 0;
|
||||
char timestr[10] = {0};
|
||||
time_t now = time(NULL);
|
||||
struct tm *tm = localtime(&now);
|
||||
|
||||
clHead->addText(name);
|
||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
||||
|
||||
clHead->addIcon(NEUTRINO_ICON_BUTTON_INFO, CC_ALIGN_RIGHT);
|
||||
clHead->addIcon(NEUTRINO_ICON_BUTTON_MENU, CC_ALIGN_RIGHT);
|
||||
if (g_settings.channellist_new_zap_mode)
|
||||
clHead->addIcon(this->new_mode_active ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, CC_ALIGN_RIGHT);
|
||||
clHead->addClock();
|
||||
clHead->addPicture("", CC_ALIGN_RIGHT, &indexLogo);
|
||||
}
|
||||
clHead->paint();
|
||||
if(gotTime) {
|
||||
strftime(timestr, 10, "%H:%M", tm);
|
||||
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
||||
}
|
||||
|
||||
void CChannelList::showChannelLogo()
|
||||
{
|
||||
if(g_settings.infobar_show_channellogo){
|
||||
std::string lname = "";
|
||||
int dummy;
|
||||
g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &dummy, &dummy);
|
||||
clHead->refreshElement(indexLogo, lname);
|
||||
clHead->paintElement(indexLogo, true);
|
||||
int iw1, iw2, iw3, ih = 0;
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih);
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih);
|
||||
if (new_zap_mode)
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih);
|
||||
|
||||
// head
|
||||
frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
|
||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 );
|
||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button
|
||||
if (new_zap_mode)
|
||||
frameBuffer->paintIcon((new_zap_mode == 2 /* active */) ?
|
||||
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
||||
x + full_width - iw1 - iw2 - iw3 - 18, y, theight);
|
||||
|
||||
if (gotTime) {
|
||||
int iw3x = (new_zap_mode) ? iw3 : -10;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - iw1 - iw2 - iw3x - 28 -timestr_len,
|
||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
||||
timestr_len += 4;
|
||||
}
|
||||
|
||||
timestr_len += iw1 + iw2 + 12;
|
||||
if (new_zap_mode)
|
||||
timestr_len += iw3 + 10;
|
||||
logo_off = timestr_len + 10;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
||||
}
|
||||
|
||||
void CChannelList::paint()
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <driver/framebuffer.h>
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/widget/components.h>
|
||||
#include <system/lastchannel.h>
|
||||
|
||||
#include <sectionsdclient/sectionsdclient.h>
|
||||
@@ -74,6 +75,7 @@ private:
|
||||
std::string name;
|
||||
ZapitChannelList chanlist;
|
||||
CZapProtection* zapProtection;
|
||||
CComponentsDetailLine *dline;
|
||||
|
||||
int full_width;
|
||||
int width;
|
||||
@@ -95,10 +97,6 @@ private:
|
||||
|
||||
int info_height;
|
||||
int ChannelList_Rec;
|
||||
CComponentsDetailLine *dline;
|
||||
CComponentsInfoBox *ibox;
|
||||
CComponentsTitleBar* clHead;
|
||||
size_t indexLogo;
|
||||
|
||||
void paintDetails(int index);
|
||||
void clearItem2DetailsLine ();
|
||||
@@ -112,7 +110,6 @@ private:
|
||||
void showChannelLogo();
|
||||
void calcSize();
|
||||
std::string MaxChanNr();
|
||||
std::string getInfoTextTransponder(int index);
|
||||
void paint_pig(int x, int y, int w, int h);
|
||||
void paint_events(int index);
|
||||
CChannelEventList evtlist;
|
||||
|
Reference in New Issue
Block a user