mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
Merge remote-tracking branch 'cst-next'
This commit is contained in:
@@ -125,6 +125,9 @@ CInfoViewer::CInfoViewer ()
|
||||
oldinfo.current_uniqueKey = 0;
|
||||
oldinfo.next_uniqueKey = 0;
|
||||
isVolscale = false;
|
||||
info_time_width = 0;
|
||||
timeoutEnd = 0;
|
||||
sec_timer_id = 0;
|
||||
}
|
||||
|
||||
CInfoViewer::~CInfoViewer()
|
||||
@@ -195,35 +198,22 @@ void CInfoViewer::start ()
|
||||
2 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 25;
|
||||
infoViewerBB->Init();
|
||||
|
||||
if ( g_settings.infobar_show_channellogo != 3 && g_settings.infobar_show_channellogo != 5 && g_settings.infobar_show_channellogo != 6) /* 3 & 5 & 6 is "default" with sigscales etc. */
|
||||
{
|
||||
ChanWidth = 4 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getMaxDigitWidth() + 10;
|
||||
ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight() * 9 / 8;
|
||||
}
|
||||
else
|
||||
{ /* default mode, with signal bars etc. */
|
||||
ChanWidth = 122;
|
||||
ChanHeight = 74;
|
||||
int test = g_SignalFont->getWidth() * 14;
|
||||
if (test > ChanWidth) {
|
||||
ChanWidth = test;
|
||||
}
|
||||
test = (g_SignalFont->getHeight() * 2) + (36 * g_settings.screen_yres / 100);
|
||||
if (test > ChanHeight) {
|
||||
ChanHeight = test;
|
||||
}
|
||||
}
|
||||
ChanWidth = max(125, 4 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getMaxDigitWidth() + 10);
|
||||
|
||||
ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/* * 9/8*/;
|
||||
ChanHeight += g_SignalFont->getHeight()/2;
|
||||
ChanHeight = max(75, ChanHeight);
|
||||
|
||||
BoxStartX = g_settings.screen_StartX + 10;
|
||||
BoxEndX = g_settings.screen_EndX - 10;
|
||||
BoxEndY = g_settings.screen_EndY - 10 - infoViewerBB->InfoHeightY_Info - infoViewerBB->bottom_bar_offset;
|
||||
BoxStartY = BoxEndY - InfoHeightY - ChanHeight / 2;
|
||||
|
||||
ChanNameY = BoxStartY + (ChanHeight / 2)/* + SHADOW_OFFSET*/; //oberkante schatten?
|
||||
ChanNameY = BoxStartY + (ChanHeight / 2) + SHADOW_OFFSET;
|
||||
ChanInfoX = BoxStartX + (ChanWidth / 3);
|
||||
|
||||
initClock();
|
||||
time_height = clock->getHeight();
|
||||
time_height = max(ChanHeight / 2, clock->getHeight());
|
||||
time_width = clock->getWidth();
|
||||
}
|
||||
|
||||
@@ -235,6 +225,8 @@ void CInfoViewer::ResetPB()
|
||||
}
|
||||
|
||||
if (timescale){
|
||||
if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT)
|
||||
timescale->kill();
|
||||
delete timescale;
|
||||
timescale = NULL;
|
||||
}
|
||||
@@ -338,7 +330,7 @@ void CInfoViewer::showRecordIcon (const bool show)
|
||||
if (rec == NULL){ //TODO: full refactoring of this icon handler
|
||||
rec = new CComponentsShapeSquare(box_posX, BoxStartY + box_posY , box_len, chanH, NULL, CC_SHADOW_ON, COL_RED, COL_INFOBAR_PLUS_0);
|
||||
rec->setFrameThickness(2);
|
||||
rec->setShadowWidth(3);
|
||||
rec->setShadowWidth(SHADOW_OFFSET/2);
|
||||
rec->setCorner(RADIUS_MIN, CORNER_ALL);
|
||||
}
|
||||
if (!rec->isPainted())
|
||||
@@ -403,12 +395,12 @@ void CInfoViewer::paintBackground(int col_NumBox)
|
||||
paintBody();
|
||||
|
||||
// number box
|
||||
int y_numbox = body->getYPos()-ChanHeight-SHADOW_OFFSET;
|
||||
if (numbox == NULL){ //TODO: move into an own member, paintNumBox() or so...
|
||||
numbox = new CComponentsShapeSquare(BoxStartX, BoxStartY, ChanWidth, ChanHeight);
|
||||
numbox->enableShadow(CC_SHADOW_ON, 6, true);
|
||||
numbox = new CComponentsShapeSquare(BoxStartX, y_numbox, ChanWidth, ChanHeight);
|
||||
numbox->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET, true);
|
||||
}else
|
||||
numbox->setDimensionsAll(BoxStartX, BoxStartY, ChanWidth, ChanHeight);
|
||||
|
||||
numbox->setDimensionsAll(BoxStartX, y_numbox, ChanWidth, ChanHeight);
|
||||
numbox->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : col_NumBox);
|
||||
numbox->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : col_NumBox, g_settings.theme.infobar_gradient_top_direction);
|
||||
numbox->setCorner(c_rad_mid, CORNER_ALL);
|
||||
@@ -417,7 +409,7 @@ void CInfoViewer::paintBackground(int col_NumBox)
|
||||
|
||||
void CInfoViewer::paintHead()
|
||||
{
|
||||
int head_x = BoxStartX+ChanWidth+5;
|
||||
int head_x = BoxStartX+ChanWidth -1; /*Ugly: -1 to avoid background shine through round borders*/
|
||||
int head_w = BoxEndX-head_x;
|
||||
if (header == NULL){
|
||||
header = new CComponentsShapeSquare(head_x, ChanNameY, head_w, time_height, NULL, CC_SHADOW_RIGHT);
|
||||
@@ -436,11 +428,19 @@ void CInfoViewer::paintHead()
|
||||
void CInfoViewer::paintBody()
|
||||
{
|
||||
int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0);
|
||||
|
||||
if(virtual_zap_mode)
|
||||
h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0);
|
||||
|
||||
if (body == NULL)
|
||||
body = new CComponentsShapeSquare(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body, NULL, CC_SHADOW_RIGHT);
|
||||
body = new CComponentsShapeSquare(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body);
|
||||
else
|
||||
body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body);
|
||||
|
||||
//set corner and shadow modes, consider virtual zap mode
|
||||
body->setCorner(RADIUS_LARGE, virtual_zap_mode ? CORNER_BOTTOM : CORNER_NONE);
|
||||
body->enableShadow(virtual_zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT);
|
||||
|
||||
body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0);
|
||||
body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction);
|
||||
|
||||
@@ -637,7 +637,10 @@ void CInfoViewer::reset_allScala()
|
||||
{
|
||||
changePB();
|
||||
lastsig = lastsnr = -1;
|
||||
infoViewerBB->changePB();
|
||||
infoViewerBB->reset_allScala();
|
||||
if(!clock)
|
||||
initClock();
|
||||
}
|
||||
|
||||
void CInfoViewer::check_channellogo_ca_SettingsChange()
|
||||
@@ -769,7 +772,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
|
||||
}
|
||||
}
|
||||
int chanH = g_SignalFont->getHeight ();
|
||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , BoxStartY + chanH, satNameWidth, satname_tmp, COL_INFOBAR_TEXT);
|
||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + chanH, satNameWidth, satname_tmp, COL_INFOBAR_TEXT);
|
||||
ChanNumYPos += 10;
|
||||
}
|
||||
|
||||
@@ -777,10 +780,19 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
|
||||
if ((!logo_ok && g_settings.infobar_show_channellogo < 2) || g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 4) // no logo in numberbox
|
||||
{
|
||||
// show number in numberbox
|
||||
int tmpwidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(
|
||||
BoxStartX + (ChanWidth - tmpwidth) / 2, ChanNumYPos,
|
||||
ChanWidth, strChanNum, col_NumBoxText);
|
||||
int h_tmp = numbox->getHeight();
|
||||
int y_tmp = numbox->getYPos() + 5*100/h_tmp; //5%
|
||||
if (g_settings.infobar_sat_display){
|
||||
int h_sfont = g_SignalFont->getHeight();
|
||||
h_tmp -= h_sfont;
|
||||
y_tmp += h_sfont;
|
||||
}
|
||||
y_tmp += h_tmp/2 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2,
|
||||
y_tmp,
|
||||
ChanWidth,
|
||||
strChanNum,
|
||||
col_NumBoxText);
|
||||
}
|
||||
if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok) || g_settings.infobar_show_channellogo == 6 ) /* channel number besides channel name */
|
||||
{
|
||||
@@ -1488,7 +1500,7 @@ void CInfoViewer::showSNR ()
|
||||
TODO: decouple this */
|
||||
if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) {
|
||||
int chanH = g_SignalFont->getHeight();
|
||||
// int freqStartY = BoxStartY + 2 * chanH - 3;
|
||||
int y_numbox = numbox->getYPos();
|
||||
if ((newfreq && chanready) || SDT_freq_update) {
|
||||
char freq[20];
|
||||
newfreq = false;
|
||||
@@ -1502,12 +1514,12 @@ void CInfoViewer::showSNR ()
|
||||
snprintf (freq, sizeof(freq), "%d.%d MHz %s", frequency / 1000, frequency % 1000, polarisation.c_str());
|
||||
|
||||
int satNameWidth = g_SignalFont->getRenderWidth (freq);
|
||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), BoxStartY + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT);
|
||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), y_numbox + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT);
|
||||
SDT_freq_update = false;
|
||||
}
|
||||
if (sigbox == NULL){
|
||||
int sb_x = ChanWidth *10/100;
|
||||
sigbox = new CSignalBox(BoxStartX+sb_x, BoxStartY+ChanHeight/2, ChanWidth-2*sb_x, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
||||
sigbox = new CSignalBox(BoxStartX+sb_x, y_numbox+ChanHeight/2, ChanWidth-2*sb_x, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
||||
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
||||
sigbox->doPaintBg(false);
|
||||
}
|
||||
@@ -1623,7 +1635,13 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height);
|
||||
txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
txt_cur_event->paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
if (txt_cur_event_rest && txt_cur_event_rest->isPainted())
|
||||
txt_cur_event_rest->hide();
|
||||
if (txt_cur_event && txt_cur_event->isPainted())
|
||||
txt_cur_event->hide();
|
||||
|
||||
txt_cur_event->paint(CC_SAVE_SCREEN_YES);
|
||||
if (runningStart){
|
||||
if (txt_cur_start == NULL)
|
||||
txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height);
|
||||
@@ -1639,7 +1657,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height);
|
||||
txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
txt_cur_event_rest->paint(CC_SAVE_SCREEN_NO);
|
||||
txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1947,7 +1965,7 @@ void CInfoViewer::showInfoFile()
|
||||
//set some properties for info object
|
||||
infobar_txt->setDimensionsAll(xStart, yStart, width, height);
|
||||
infobar_txt->setCorner(RADIUS_SMALL);
|
||||
infobar_txt->enableShadow(CC_SHADOW_ON, 3);
|
||||
infobar_txt->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET/2);
|
||||
infobar_txt->setTextColor(COL_INFOBAR_TEXT);
|
||||
infobar_txt->setColorBody(COL_INFOBAR_PLUS_0);
|
||||
infobar_txt->doPaintTextBoxBg(false);
|
||||
@@ -1984,18 +2002,18 @@ void CInfoViewer::killTitle()
|
||||
sigbox->kill();
|
||||
#endif
|
||||
header->kill();
|
||||
#if 0 //not really required to kill clock, body does this
|
||||
#if 0 //not really required to kill clock, header does this
|
||||
if (clock)
|
||||
clock->kill();
|
||||
#endif
|
||||
body->kill();
|
||||
#if 0 //not really required to kill epg infos, body does this
|
||||
if (txt_cur_start)
|
||||
txt_cur_start->kill();
|
||||
if (txt_cur_event)
|
||||
txt_cur_event->kill();
|
||||
if (txt_cur_event_rest)
|
||||
txt_cur_event_rest->kill();
|
||||
#if 0 //not really required to kill epg infos, body does this
|
||||
if (txt_cur_start)
|
||||
txt_cur_start->kill();
|
||||
if (txt_next_start)
|
||||
txt_next_start->kill();
|
||||
if (txt_next_event)
|
||||
@@ -2064,7 +2082,7 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id, const int c
|
||||
// calculate mid of numberbox
|
||||
int satNameHeight = g_settings.infobar_sat_display ? g_SignalFont->getHeight() : 0;
|
||||
int x_mid = BoxStartX + ChanWidth / 2;
|
||||
y_mid = BoxStartY + (satNameHeight + ChanHeight) / 2;
|
||||
y_mid = numbox->getYPos() + (satNameHeight + ChanHeight) / 2;
|
||||
|
||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, ChanWidth, ChanHeight - satNameHeight);
|
||||
// channel name with number
|
||||
|
Reference in New Issue
Block a user