mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
CChannelList: Use one instance of CComponentsFrmClock for multiple instances of CChannelList
This commit is contained in:
@@ -95,6 +95,9 @@ extern int old_b_id;
|
|||||||
|
|
||||||
extern cVideo * videoDecoder;
|
extern cVideo * videoDecoder;
|
||||||
|
|
||||||
|
static CComponentsFrmClock *headerClock = NULL;
|
||||||
|
static int headerClockWidth = 0;
|
||||||
|
|
||||||
CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist)
|
CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist)
|
||||||
{
|
{
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
frameBuffer = CFrameBuffer::getInstance();
|
||||||
@@ -118,7 +121,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
|
|||||||
previous_channellist_additional = -1;
|
previous_channellist_additional = -1;
|
||||||
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
||||||
dline = NULL;
|
dline = NULL;
|
||||||
clock = NULL;
|
|
||||||
logo_off = 0;
|
logo_off = 0;
|
||||||
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
||||||
}
|
}
|
||||||
@@ -128,13 +130,14 @@ CChannelList::~CChannelList()
|
|||||||
//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout);
|
//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout);
|
||||||
chanlist.clear();
|
chanlist.clear();
|
||||||
delete dline;
|
delete dline;
|
||||||
if (clock) {
|
if (headerClock) {
|
||||||
if (clock->isClockRun())
|
headerClock->Stop();
|
||||||
clock->Stop();
|
if (headerClock->isPainted())
|
||||||
if (clock->isPainted())
|
headerClock->hide();
|
||||||
clock->hide();
|
if (headerClock->isClockRun())
|
||||||
delete clock;
|
headerClock->stopThread();
|
||||||
clock = NULL;
|
delete headerClock;
|
||||||
|
headerClock = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -949,8 +952,8 @@ int CChannelList::show()
|
|||||||
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clock && clock->isClockRun())
|
if (headerClock)
|
||||||
clock->Stop();
|
headerClock->Stop();
|
||||||
|
|
||||||
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())
|
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())
|
||||||
return -1;
|
return -1;
|
||||||
@@ -970,11 +973,10 @@ void CChannelList::hide()
|
|||||||
{
|
{
|
||||||
videoDecoder->Pig(-1, -1, -1, -1);
|
videoDecoder->Pig(-1, -1, -1, -1);
|
||||||
}
|
}
|
||||||
if (clock) {
|
if (headerClock) {
|
||||||
if (clock->isClockRun())
|
headerClock->Stop();
|
||||||
clock->Stop();
|
if (headerClock->isPainted())
|
||||||
if (clock->isPainted())
|
headerClock->hide();
|
||||||
clock->hide();
|
|
||||||
}
|
}
|
||||||
frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height);
|
frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height);
|
||||||
clearItem2DetailsLine();
|
clearItem2DetailsLine();
|
||||||
@@ -2073,29 +2075,28 @@ void CChannelList::paintHead()
|
|||||||
CComponentsHeader header(x, y, full_width, theight, name, NULL /*no header icon*/);
|
CComponentsHeader header(x, y, full_width, theight, name, NULL /*no header icon*/);
|
||||||
header.paint(CC_SAVE_SCREEN_NO);
|
header.paint(CC_SAVE_SCREEN_NO);
|
||||||
|
|
||||||
static int clockWidth = 0;
|
|
||||||
if (g_Sectionsd->getIsTimeSet()) {
|
if (g_Sectionsd->getIsTimeSet()) {
|
||||||
if (clock == NULL) {
|
if (headerClock == NULL) {
|
||||||
clock = new CComponentsFrmClock(0, y, 0, theight, "%H:%M");
|
headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M");
|
||||||
clock->setClockFontType(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
|
headerClock->setClockIntervall(10);
|
||||||
clock->setTextColor(COL_MENUHEAD);
|
headerClock->setClockFontType(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
|
||||||
clock->setColorBody(COL_MENUHEAD_PLUS_0);
|
headerClock->setCornerRadius(RADIUS_LARGE);
|
||||||
clock->setCornerRadius(RADIUS_LARGE);
|
headerClock->setCornerType(CORNER_TOP_RIGHT);
|
||||||
clock->setCornerType(CORNER_TOP_RIGHT);
|
|
||||||
clock->setClockIntervall(10);
|
|
||||||
clock->refresh();
|
|
||||||
clockWidth = clock->getWidth();
|
|
||||||
clock->setXPos(x + full_width - clockWidth - 10);
|
|
||||||
clockWidth += 6;
|
|
||||||
}
|
}
|
||||||
if (!clock->isClockRun())
|
headerClock->setYPos(y);
|
||||||
clock->Start();
|
headerClock->setHeight(theight);
|
||||||
else
|
headerClock->setTextColor(COL_MENUHEAD);
|
||||||
clock->paint(CC_SAVE_SCREEN_NO);
|
headerClock->setColorBody(COL_MENUHEAD_PLUS_0);
|
||||||
|
headerClock->refresh();
|
||||||
|
headerClockWidth = headerClock->getWidth();
|
||||||
|
headerClock->setXPos(x + full_width - headerClockWidth - 10);
|
||||||
|
headerClockWidth += 6;
|
||||||
|
|
||||||
|
headerClock->Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clockWidth = 0;
|
headerClockWidth = 0;
|
||||||
logo_off = clockWidth + 10;
|
logo_off = headerClockWidth + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paint()
|
void CChannelList::paint()
|
||||||
|
@@ -78,7 +78,6 @@ private:
|
|||||||
ZapitChannelList chanlist;
|
ZapitChannelList chanlist;
|
||||||
CZapProtection* zapProtection;
|
CZapProtection* zapProtection;
|
||||||
CComponentsDetailLine *dline;
|
CComponentsDetailLine *dline;
|
||||||
CComponentsFrmClock *clock;
|
|
||||||
|
|
||||||
int full_width;
|
int full_width;
|
||||||
int width;
|
int width;
|
||||||
|
Reference in New Issue
Block a user