mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
streaminfo: use fixed fonts
TODO: some small position fixes
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8e321292e2
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-03-08 (Fri, 08 Mar 2019)
Origin message was:
------------------
- streaminfo: use fixed fonts
TODO: some small position fixes
------------------
This commit was generated by Migit
This commit is contained in:
@@ -73,13 +73,14 @@ CStreamInfo2::CStreamInfo2() : fader(g_settings.theme.menu_Content_alpha)
|
|||||||
frameBuffer = CFrameBuffer::getInstance ();
|
frameBuffer = CFrameBuffer::getInstance ();
|
||||||
pip = NULL;
|
pip = NULL;
|
||||||
signalbox = NULL;
|
signalbox = NULL;
|
||||||
font_head = SNeutrinoSettings::FONT_TYPE_MENU_TITLE;
|
|
||||||
font_info = SNeutrinoSettings::FONT_TYPE_MENU;
|
|
||||||
font_small = SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL;
|
|
||||||
|
|
||||||
hheight = g_Font[font_head]->getHeight ();
|
font_head = SNeutrinoSettings::FONT_TYPE_FIXED_30_BOLD;
|
||||||
iheight = g_Font[font_info]->getHeight ();
|
font_info = SNeutrinoSettings::FONT_TYPE_FIXED_20_BOLD;
|
||||||
sheight = g_Font[font_small]->getHeight ();
|
font_small = SNeutrinoSettings::FONT_TYPE_FIXED_16_REGULAR;
|
||||||
|
|
||||||
|
hheight = g_FixedFont[font_head]->getHeight ();
|
||||||
|
iheight = g_FixedFont[font_info]->getHeight ();
|
||||||
|
sheight = g_FixedFont[font_small]->getHeight ();
|
||||||
|
|
||||||
max_width = frameBuffer->getScreenWidth(true);
|
max_width = frameBuffer->getScreenWidth(true);
|
||||||
max_height = frameBuffer->getScreenHeight(true);
|
max_height = frameBuffer->getScreenHeight(true);
|
||||||
@@ -427,7 +428,7 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
char tmp_str[150];
|
char tmp_str[150];
|
||||||
int delay_counter = 0;
|
int delay_counter = 0;
|
||||||
const int delay = 15;
|
const int delay = 15;
|
||||||
int sw = 3 * g_Font[font_small]->getRenderWidth(" ") + 8 * g_Font[font_small]->getMaxDigitWidth();
|
int sw = 3 * g_FixedFont[font_small]->getRenderWidth(" ") + 8 * g_FixedFont[font_small]->getMaxDigitWidth();
|
||||||
maxb = minb = lastb = tmp_rate = 0;
|
maxb = minb = lastb = tmp_rate = 0;
|
||||||
bool repaint_bitrate = true;
|
bool repaint_bitrate = true;
|
||||||
ts_setup ();
|
ts_setup ();
|
||||||
@@ -475,10 +476,10 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
if (repaint_bitrate)
|
if (repaint_bitrate)
|
||||||
{
|
{
|
||||||
snprintf(tmp_str, sizeof(tmp_str), "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE));
|
snprintf(tmp_str, sizeof(tmp_str), "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE));
|
||||||
g_Font[font_info]->RenderString(dx1, average_bitrate_pos, spaceoffset, tmp_str, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_info]->RenderString(dx1, average_bitrate_pos, spaceoffset, tmp_str, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
snprintf(tmp_str, sizeof(tmp_str), " (%s)",g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE));
|
snprintf(tmp_str, sizeof(tmp_str), " (%s)",g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE));
|
||||||
g_Font[font_info]->RenderString(dx1 + spaceoffset + sw , average_bitrate_pos, box_width - spaceoffset - sw, tmp_str, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_info]->RenderString(dx1 + spaceoffset + sw , average_bitrate_pos, box_width - spaceoffset - sw, tmp_str, COL_MENUCONTENT_TEXT);
|
||||||
repaint_bitrate = false;
|
repaint_bitrate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,7 +493,7 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
currate[4] = currate[5];
|
currate[4] = currate[5];
|
||||||
currate[5] = currate[6];
|
currate[5] = currate[6];
|
||||||
currate[6] = ' ';
|
currate[6] = ' ';
|
||||||
g_Font[font_info]->RenderString (dx1 + spaceoffset, average_bitrate_pos, sw, currate, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_info]->RenderString (dx1 + spaceoffset, average_bitrate_pos, sw, currate, COL_MENUCONTENT_TEXT);
|
||||||
lastb = bit_s;
|
lastb = bit_s;
|
||||||
}
|
}
|
||||||
if ((!mp && pmt_version != current_pmt_version && delay_counter > delay) || probed)
|
if ((!mp && pmt_version != current_pmt_version && delay_counter > delay) || probed)
|
||||||
@@ -627,7 +628,7 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
|||||||
else
|
else
|
||||||
tname += to_string(1 + frontend->getNumber()) + ": " + frontend->getName();
|
tname += to_string(1 + frontend->getNumber()) + ": " + frontend->getName();
|
||||||
|
|
||||||
g_Font[font_small]->RenderString(_x, _y + iheight, width - _x - OFFSET_INNER_MID, tname /*tuner_name.c_str()*/, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_small]->RenderString(_x, _y + iheight, width - _x - OFFSET_INNER_MID, tname /*tuner_name.c_str()*/, COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
sigBox_x = _x;
|
sigBox_x = _x;
|
||||||
sigBox_y = _y + iheight + OFFSET_INNER_MID;
|
sigBox_y = _y + iheight + OFFSET_INNER_MID;
|
||||||
@@ -637,10 +638,10 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
|||||||
sig_text_y = sigBox_y + sigBox_h + OFFSET_INNER_SMALL;
|
sig_text_y = sigBox_y + sigBox_h + OFFSET_INNER_SMALL;
|
||||||
|
|
||||||
int y1 = sig_text_y + sheight + OFFSET_INNER_SMALL;
|
int y1 = sig_text_y + sheight + OFFSET_INNER_SMALL;
|
||||||
int fw = g_Font[font_small]->getWidth();
|
int fw = g_FixedFont[font_small]->getWidth();
|
||||||
|
|
||||||
int maxmin_x; // x-position of min and max
|
int maxmin_x; // x-position of min and max
|
||||||
int fontW = g_Font[font_small]->getWidth();
|
int fontW = g_FixedFont[font_small]->getWidth();
|
||||||
int xd;
|
int xd;
|
||||||
int col = 0;
|
int col = 0;
|
||||||
|
|
||||||
@@ -657,26 +658,26 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
|||||||
col = 1;
|
col = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 1) +OFFSET_INNER_SMALL, fw*3, "max", COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_small]->RenderString(maxmin_x, y1 + (sheight * 1) +OFFSET_INNER_SMALL, fw*3, "max", COL_MENUCONTENT_TEXT);
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +OFFSET_INNER_SMALL, fw*3, "now", COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +OFFSET_INNER_SMALL, fw*3, "now", COL_MENUCONTENT_TEXT);
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +OFFSET_INNER_SMALL, fw*3, "min", COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +OFFSET_INNER_SMALL, fw*3, "min", COL_MENUCONTENT_TEXT);
|
||||||
|
|
||||||
if (!mp)
|
if (!mp)
|
||||||
{
|
{
|
||||||
g_Font[font_small]->RenderString(_x+xd*col, y1, fw*8, "BER [%]", COL_RED);
|
g_FixedFont[font_small]->RenderString(_x+xd*col, y1, fw*8, "BER [%]", COL_RED);
|
||||||
sig_text_ber_x = _x + OFFSET_INNER_SMALL + xd * col;
|
sig_text_ber_x = _x + OFFSET_INNER_SMALL + xd * col;
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
g_Font[font_small]->RenderString(_x+xd*col, y1, fw*8, "SNR [%]", COL_LIGHT_BLUE);
|
g_FixedFont[font_small]->RenderString(_x+xd*col, y1, fw*8, "SNR [%]", COL_LIGHT_BLUE);
|
||||||
sig_text_snr_x = _x + OFFSET_INNER_SMALL + xd * col;
|
sig_text_snr_x = _x + OFFSET_INNER_SMALL + xd * col;
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
g_Font[font_small]->RenderString(_x+xd*col, y1, fw*8, "SIG [%]", COL_GREEN);
|
g_FixedFont[font_small]->RenderString(_x+xd*col, y1, fw*8, "SIG [%]", COL_GREEN);
|
||||||
sig_text_sig_x = _x + OFFSET_INNER_SMALL + xd * col;
|
sig_text_sig_x = _x + OFFSET_INNER_SMALL + xd * col;
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Font[font_small]->RenderString(_x+xd*col, y1, fw*10, "BR [kbps]", COL_YELLOW);
|
g_FixedFont[font_small]->RenderString(_x+xd*col, y1, fw*10, "BR [kbps]", COL_YELLOW);
|
||||||
sig_text_rate_x = _x + OFFSET_INNER_SMALL + xd * col;
|
sig_text_rate_x = _x + OFFSET_INNER_SMALL + xd * col;
|
||||||
|
|
||||||
sigBox_pos = 0;
|
sigBox_pos = 0;
|
||||||
@@ -779,11 +780,11 @@ int CStreamInfo2::y_signal_fe(unsigned long value, unsigned long max_value, int
|
|||||||
void CStreamInfo2::SignalRenderStr(unsigned int value, int _x, int _y)
|
void CStreamInfo2::SignalRenderStr(unsigned int value, int _x, int _y)
|
||||||
{
|
{
|
||||||
char str[30];
|
char str[30];
|
||||||
int fw = g_Font[font_small]->getWidth();
|
int fw = g_FixedFont[font_small]->getWidth();
|
||||||
fw *=(fw>17)?5:6;
|
fw *=(fw>17)?5:6;
|
||||||
frameBuffer->paintBoxRel(_x, _y - sheight + OFFSET_INNER_SMALL, fw, sheight -1, COL_MENUCONTENT_PLUS_0);
|
frameBuffer->paintBoxRel(_x, _y - sheight + OFFSET_INNER_SMALL, fw, sheight -1, COL_MENUCONTENT_PLUS_0);
|
||||||
sprintf(str,"%6u",value);
|
sprintf(str,"%6u",value);
|
||||||
g_Font[font_small]->RenderString(_x, _y + OFFSET_INNER_SMALL, fw, str, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_small]->RenderString(_x, _y + OFFSET_INNER_SMALL, fw, str, COL_MENUCONTENT_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::paint (int /*mode*/)
|
void CStreamInfo2::paint (int /*mode*/)
|
||||||
@@ -805,7 +806,7 @@ void CStreamInfo2::paint (int /*mode*/)
|
|||||||
|
|
||||||
// paint backround, title pig, etc.
|
// paint backround, title pig, etc.
|
||||||
frameBuffer->paintBoxRel (0, 0, max_width, max_height, COL_MENUCONTENT_PLUS_0);
|
frameBuffer->paintBoxRel (0, 0, max_width, max_height, COL_MENUCONTENT_PLUS_0);
|
||||||
g_Font[font_head]->RenderString (xpos, ypos + hheight, width, head_string, COL_MENUHEAD_TEXT);
|
g_FixedFont[font_head]->RenderString (xpos, ypos + hheight, width, head_string, COL_MENUHEAD_TEXT);
|
||||||
|
|
||||||
ypos += hheight + iheight;
|
ypos += hheight + iheight;
|
||||||
|
|
||||||
@@ -838,7 +839,7 @@ struct row {
|
|||||||
std::string val;
|
std::string val;
|
||||||
Font *f;
|
Font *f;
|
||||||
int col;
|
int col;
|
||||||
row(): f(g_Font[SNeutrinoSettings::FONT_TYPE_MENU])
|
row(): f(g_FixedFont[SNeutrinoSettings::FONT_TYPE_FIXED_20_BOLD])
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1126,7 +1127,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL);
|
snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1170,7 +1171,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL);
|
snprintf(buf, sizeof(buf), "%llx.png", channel->getChannelID() & 0xFFFFFFFFFFFFULL);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
|
|
||||||
// onid
|
// onid
|
||||||
@@ -1179,7 +1180,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
|
|
||||||
// sid
|
// sid
|
||||||
@@ -1188,7 +1189,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
|
|
||||||
// tsid
|
// tsid
|
||||||
@@ -1197,7 +1198,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
|
|
||||||
// pmtpid
|
// pmtpid
|
||||||
@@ -1207,7 +1208,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "0x%04X (%i) [0x%02X]", i, i, pmt_version);
|
snprintf(buf, sizeof(buf), "0x%04X (%i) [0x%02X]", i, i, pmt_version);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
|
|
||||||
//vtxtpid
|
//vtxtpid
|
||||||
@@ -1218,7 +1219,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
snprintf(buf, sizeof(buf), "0x%04X (%i)", i, i);
|
||||||
r.val = buf;
|
r.val = buf;
|
||||||
r.col = COL_MENUCONTENT_TEXT;
|
r.col = COL_MENUCONTENT_TEXT;
|
||||||
r.f = g_Font[font_small];
|
r.f = g_FixedFont[font_small];
|
||||||
v.push_back(r);
|
v.push_back(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1226,7 +1227,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
for (std::vector<row>::iterator it = v.begin(); it != v.end(); ++it)
|
for (std::vector<row>::iterator it = v.begin(); it != v.end(); ++it)
|
||||||
spaceoffset = std::max(spaceoffset, it->f->getRenderWidth(it->key));
|
spaceoffset = std::max(spaceoffset, it->f->getRenderWidth(it->key));
|
||||||
|
|
||||||
spaceoffset = std::max(spaceoffset, g_Font[font_info]->getRenderWidth(std::string(g_Locale->getText(LOCALE_STREAMINFO_BITRATE)) + ": "));
|
spaceoffset = std::max(spaceoffset, g_FixedFont[font_info]->getRenderWidth(std::string(g_Locale->getText(LOCALE_STREAMINFO_BITRATE)) + ": "));
|
||||||
|
|
||||||
for (std::vector<row>::iterator it = v.begin(); it != v.end(); ++it)
|
for (std::vector<row>::iterator it = v.begin(); it != v.end(); ++it)
|
||||||
{
|
{
|
||||||
@@ -1264,7 +1265,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
|
|||||||
|
|
||||||
for (int i = 0; i < NUM_CAIDS; i++)
|
for (int i = 0; i < NUM_CAIDS; i++)
|
||||||
{
|
{
|
||||||
array[i] = g_Font[font_small]->getRenderWidth(casys[i]);
|
array[i] = g_FixedFont[font_small]->getRenderWidth(casys[i]);
|
||||||
caids[i] = false;
|
caids[i] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1350,7 +1351,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
|
|||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
std::string casys_locale(g_Locale->getText(LOCALE_STREAMINFO_CASYSTEMS));
|
std::string casys_locale(g_Locale->getText(LOCALE_STREAMINFO_CASYSTEMS));
|
||||||
casys_locale += ":";
|
casys_locale += ":";
|
||||||
g_Font[font_info]->RenderString(xpos , ypos, box_width, casys_locale, COL_MENUCONTENT_TEXT);
|
g_FixedFont[font_info]->RenderString(xpos , ypos, box_width, casys_locale, COL_MENUCONTENT_TEXT);
|
||||||
cryptsystems = false;
|
cryptsystems = false;
|
||||||
}
|
}
|
||||||
ypos += sheight;
|
ypos += sheight;
|
||||||
@@ -1368,11 +1369,11 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
|
|||||||
if (1 == sscanf(casys[ca_id].substr(last_pos, pos - last_pos).c_str(), "%X", &id) && acaid == id)
|
if (1 == sscanf(casys[ca_id].substr(last_pos, pos - last_pos).c_str(), "%X", &id) && acaid == id)
|
||||||
col = COL_MENUCONTENT_TEXT;
|
col = COL_MENUCONTENT_TEXT;
|
||||||
}
|
}
|
||||||
g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos), col);
|
g_FixedFont[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos), col);
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
width_txt = spaceoffset;
|
width_txt = spaceoffset;
|
||||||
else
|
else
|
||||||
width_txt += g_Font[font_small]->getRenderWidth(casys[ca_id].substr(last_pos, pos - last_pos))+10;
|
width_txt += g_FixedFont[font_small]->getRenderWidth(casys[ca_id].substr(last_pos, pos - last_pos))+10;
|
||||||
index++;
|
index++;
|
||||||
if (index > 5)
|
if (index > 5)
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user