Merge remote-tracking branch 'test/cst-next'

Origin commit data
------------------
Branch: ni/coolstream
Commit: 92fcc879b4
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-03-07 (Sat, 07 Mar 2015)


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

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2015-03-07 20:09:44 +01:00
161 changed files with 707 additions and 703 deletions

View File

@@ -37,6 +37,7 @@
#include <gui/channellist.h>
#include <unistd.h>
#include <global.h>
#include <neutrino.h>
@@ -90,6 +91,7 @@ extern CBouquetManager *g_bouquetManager;
static CComponentsFrmClock *headerClock = NULL;
static int headerClockWidth = 0;
extern bool timeset;
CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist)
{
@@ -542,9 +544,10 @@ bool CChannelList::updateSelection(int newpos)
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if (oldliststart != liststart)
paint();
else {
if (oldliststart != liststart) {
paintBody();
updateVfd();
} else {
paintItem(prev_selected - liststart);
paintItem(selected - liststart);
showChannelLogo();
@@ -588,10 +591,6 @@ int CChannelList::show()
{
int res = CHANLIST_CANCEL;
/* temporary debugging stuff */
struct timeval t1, t2;
gettimeofday(&t1, NULL);
neutrino_msg_t msg;
neutrino_msg_data_t data;
bool actzap = 0;
@@ -604,13 +603,8 @@ int CChannelList::show()
COSDFader fader(g_settings.theme.menu_Content_alpha);
fader.StartFadeIn();
paintHead();
paint();
gettimeofday(&t2, NULL);
fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n",
((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL);
int oldselected = selected;
int zapOnExit = false;
bool bShowBouquetList = false;
@@ -634,7 +628,6 @@ int CChannelList::show()
cancelMoveChannel();
} else if (edit_state) {
editMode(false);
paintHead();
paint();
} else {
res = CHANLIST_CANCEL;
@@ -656,7 +649,6 @@ int CChannelList::show()
printf("[neutrino channellist] start direct recording...\n");
hide();
if (!CRecordManager::getInstance()->Record((*chanlist)[selected]->channel_id)) {
paintHead();
paint();
} else {
selected = oldselected;
@@ -675,7 +667,7 @@ int CChannelList::show()
{
CRecordManager::getInstance()->Stop((*chanlist)[selected]->channel_id);
calcSize();
paint();
paintBody();
}
}
}
@@ -691,7 +683,6 @@ int CChannelList::show()
res = CHANLIST_CANCEL_ALL;
loop = false;
} else {
paintHead();
paint();
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
}
@@ -723,7 +714,6 @@ int CChannelList::show()
selected++;
}
if (ret != 0) {
paintHead();
paint();
}
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
@@ -784,7 +774,7 @@ int CChannelList::show()
zapTo(selected);
actzap = true;
oldselected = selected;
paint(); // refresh zapped vs selected
paintBody(); // refresh zapped vs selected
} else if(SameTP()) {
zapOnExit = true;
loop=false;
@@ -868,7 +858,6 @@ int CChannelList::show()
else
displayNext = !displayNext;
paintHead(); // update button bar
paint();
}
}
@@ -885,7 +874,6 @@ int CChannelList::show()
g_settings.channellist_sort_mode = SORT_ALPHA;
CNeutrinoApp::getInstance()->SetChannelMode(mode);
oldselected = selected;
paintHead(); // update button bar
paint();
}
}
@@ -904,7 +892,7 @@ int CChannelList::show()
if (CZapit::getInstance()->GetPipChannelID() == (*chanlist)[selected]->getChannelID()) {
g_Zapit->stopPip();
calcSize();
paint();
paintBody();
} else {
handleMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, true);
}
@@ -922,7 +910,6 @@ int CChannelList::show()
else
g_EpgData->show((*chanlist)[selected]->channel_id);
paintHead();
paint();
} else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) {
g_RCInput->postMsg(msg, data);
@@ -1084,7 +1071,7 @@ out:
#ifdef ENABLE_PIP
if (CNeutrinoApp::getInstance()->StartPip((*chanlist)[selected]->getChannelID())) {
calcSize();
paint();
paintBody();
}
#endif
} else
@@ -1689,9 +1676,14 @@ void CChannelList::showChannelLogo()
}
CChannelLogo = new CComponentsChannelLogo(0, 0, logo_w_max, theight,
(*chanlist)[selected]->getName(), (*chanlist)[selected]->channel_id);
CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth());
CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2);
CChannelLogo->paint();
if (CChannelLogo->hasLogo()) {
CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth());
CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2);
CChannelLogo->paint();
} else {
delete CChannelLogo;
CChannelLogo = NULL;
}
headerNew = false;
}
}
@@ -2021,19 +2013,48 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
//name
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color);
}
if (curr == selected) {
if (!(chan->currentEvent.description.empty())) {
snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s",
chan->getName().c_str(), p_event->description.c_str());
CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8
} else
CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8
}
if (!firstpaint && curr == selected)
updateVfd();
}
}
void CChannelList::updateVfd()
{
if (selected >= (*chanlist).size())
return;
CZapitChannel* chan = (*chanlist)[selected];
CChannelEvent *p_event=NULL;
if (displayNext)
p_event = &chan->nextEvent;
else
p_event = &chan->currentEvent;
if (!(chan->currentEvent.description.empty())) {
char nameAndDescription[255];
snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s",
chan->getName().c_str(), p_event->description.c_str());
CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8
} else
CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8
}
void CChannelList::paint()
{
TIMER_START();
paintHead();
TIMER_STOP("CChannelList::paint() after paint head");
paintBody();
TIMER_STOP("CChannelList::paint() after paint body");
updateVfd();
TIMER_STOP("CChannelList::paint() paint total");
}
void CChannelList::paintHead()
{
static int gradient = g_settings.gradiant;
CComponentsHeader header(x, y, full_width, theight, name /*no header icon*/);
if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked)
header.setIcon(NEUTRINO_ICON_LOCK);
@@ -2042,22 +2063,23 @@ void CChannelList::paintHead()
header.paint(CC_SAVE_SCREEN_NO);
if (headerClock != NULL) {
if (gradient != g_settings.gradiant && headerClock != NULL) {
gradient = g_settings.gradiant;
headerClock->clearSavedScreen();
delete headerClock;
headerClock = NULL;
}
if (g_Sectionsd->getIsTimeSet()) {
if (timeset) {
if (headerClock == NULL) {
headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M", true);
headerClock->setClockBlink("%H %M");
headerClock->setClockIntervall(1);
headerClock->doPaintBg(false);
headerClock->doPaintBg(!gradient);
headerClock->enableTboxSaveScreen(gradient);
headerClock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
}
headerClock->setClockFormat("%H:%M");
headerClock->setClockFont(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
headerClock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
headerClock->setYPos(y);
headerClock->setHeight(theight);
headerClock->setTextColor(header.getTextObject()->getTextColor());
@@ -2071,11 +2093,12 @@ void CChannelList::paintHead()
}
else
headerClockWidth = 0;
logo_off = headerClockWidth + 10;
headerNew = true;
}
void CChannelList::paint()
void CChannelList::paintBody()
{
int icon_w = 0, icon_h = 0;
numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr());
@@ -2417,7 +2440,7 @@ void CChannelList::beginMoveChannel()
void CChannelList::finishMoveChannel()
{
move_state = beDefault;
paint();
paintBody();
}
void CChannelList::cancelMoveChannel()
@@ -2442,7 +2465,7 @@ void CChannelList::internalMoveChannel( unsigned int fromPosition, unsigned int
selected = toPosition;
newPosition = toPosition;
paint();
paintBody();
}
void CChannelList::deleteChannel(bool ask)
@@ -2464,7 +2487,8 @@ void CChannelList::deleteChannel(bool ask)
selected = chanlist->empty() ? 0 : (chanlist->size() - 1);
channelsChanged = true;
paint();
paintBody();
updateVfd();
}
void CChannelList::addChannel()
@@ -2487,8 +2511,7 @@ void CChannelList::addChannel()
selected = chanlist->empty() ? 0 : (chanlist->size() - 1);
}
delete channelSelectWidget;
paintHead();
paint();
paint();
}
void CChannelList::renameChannel()
@@ -2504,7 +2527,6 @@ void CChannelList::renameChannel()
channelsChanged = true;
}
paintHead();
paint();
}
@@ -2560,7 +2582,7 @@ void CChannelList::moveChannelToBouquet()
if (addChannelToBouquet())
deleteChannel(false);
else
paint();
paintBody();
paintHead();
}