mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
gui/streaminfo2.cpp: unify sat/cable transponder info; cleanup; replace getCurrentServiceInfo()
Origin commit data
------------------
Commit: 2f67821e5f
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-04-18 (Wed, 18 Apr 2012)
This commit is contained in:
@@ -53,9 +53,6 @@ extern cAudio * audioDecoder;
|
|||||||
|
|
||||||
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
|
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
|
||||||
|
|
||||||
#if 0
|
|
||||||
extern CPipSetup * g_Pip0;
|
|
||||||
#endif
|
|
||||||
CStreamInfo2::CStreamInfo2 ()
|
CStreamInfo2::CStreamInfo2 ()
|
||||||
{
|
{
|
||||||
frameBuffer = CFrameBuffer::getInstance ();
|
frameBuffer = CFrameBuffer::getInstance ();
|
||||||
@@ -68,9 +65,6 @@ CStreamInfo2::CStreamInfo2 ()
|
|||||||
iheight = g_Font[font_info]->getHeight ();
|
iheight = g_Font[font_info]->getHeight ();
|
||||||
sheight = g_Font[font_small]->getHeight ();
|
sheight = g_Font[font_small]->getHeight ();
|
||||||
|
|
||||||
//max_height = SCREEN_Y - 1;
|
|
||||||
//max_width = SCREEN_X - 1;
|
|
||||||
|
|
||||||
max_width = frameBuffer->getScreenWidth(true);
|
max_width = frameBuffer->getScreenWidth(true);
|
||||||
max_height = frameBuffer->getScreenHeight(true);
|
max_height = frameBuffer->getScreenHeight(true);
|
||||||
|
|
||||||
@@ -79,9 +73,6 @@ CStreamInfo2::CStreamInfo2 ()
|
|||||||
x = frameBuffer->getScreenX();
|
x = frameBuffer->getScreenX();
|
||||||
y = frameBuffer->getScreenY();
|
y = frameBuffer->getScreenY();
|
||||||
|
|
||||||
//x = (((g_settings.screen_EndX - g_settings.screen_StartX) - width) / 2) + g_settings.screen_StartX;
|
|
||||||
//y = (((g_settings.screen_EndY - g_settings.screen_StartY) - height) / 2) + g_settings.screen_StartY;
|
|
||||||
|
|
||||||
sigBox_pos = 0;
|
sigBox_pos = 0;
|
||||||
paint_mode = 0;
|
paint_mode = 0;
|
||||||
|
|
||||||
@@ -120,7 +111,6 @@ int CStreamInfo2::exec (CMenuTarget * parent, const std::string &)
|
|||||||
paint (paint_mode);
|
paint (paint_mode);
|
||||||
int res = doSignalStrengthLoop ();
|
int res = doSignalStrengthLoop ();
|
||||||
hide ();
|
hide ();
|
||||||
//return menu_return::RETURN_REPAINT;
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,8 +127,6 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
uint64_t maxb, minb, lastb, tmp_rate;
|
uint64_t maxb, minb, lastb, tmp_rate;
|
||||||
unsigned int current_pmt_version= pmt_version;
|
unsigned int current_pmt_version= pmt_version;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
uint16_t ssig, ssnr;
|
|
||||||
uint32_t ber;
|
|
||||||
char tmp_str[150];
|
char tmp_str[150];
|
||||||
int delay_counter = 0;
|
int delay_counter = 0;
|
||||||
const int delay = 15;
|
const int delay = 15;
|
||||||
@@ -152,13 +140,9 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS (100);
|
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS (100);
|
||||||
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
|
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
|
||||||
|
|
||||||
ssig = frontend->getSignalStrength();
|
signal.sig = frontend->getSignalStrength() & 0xFFFF;
|
||||||
ssnr = frontend->getSignalNoiseRatio();
|
signal.snr = frontend->getSignalNoiseRatio() & 0xFFFF;
|
||||||
ber = frontend->getBitErrorRate();
|
signal.ber = frontend->getBitErrorRate();
|
||||||
|
|
||||||
signal.sig = ssig & 0xFFFF;
|
|
||||||
signal.snr = ssnr & 0xFFFF;
|
|
||||||
signal.ber = ber;
|
|
||||||
|
|
||||||
int ret = update_rate ();
|
int ret = update_rate ();
|
||||||
if (paint_mode == 0) {
|
if (paint_mode == 0) {
|
||||||
@@ -169,8 +153,9 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
int dx1 = x + 10;
|
int dx1 = x + 10;
|
||||||
|
|
||||||
if(delay_counter > delay + 1){
|
if(delay_counter > delay + 1){
|
||||||
CZapitClient::CCurrentServiceInfo si = g_Zapit->getCurrentServiceInfo ();
|
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
|
||||||
pmt_version = si.pmt_version;
|
if(channel)
|
||||||
|
pmt_version = channel->getPmtVersion();
|
||||||
if(pmt_version != current_pmt_version){
|
if(pmt_version != current_pmt_version){
|
||||||
delay_counter = 0;
|
delay_counter = 0;
|
||||||
}
|
}
|
||||||
@@ -192,8 +177,7 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_INFOBAR);
|
g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_INFOBAR);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(snrscale && sigscale)
|
showSNR ();
|
||||||
showSNR ();
|
|
||||||
if(pmt_version != current_pmt_version && delay_counter > delay){
|
if(pmt_version != current_pmt_version && delay_counter > delay){
|
||||||
current_pmt_version = pmt_version;
|
current_pmt_version = pmt_version;
|
||||||
paint_techinfo (x + 10, y+ hheight +5);
|
paint_techinfo (x + 10, y+ hheight +5);
|
||||||
@@ -201,25 +185,23 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
delay_counter++;
|
delay_counter++;
|
||||||
}
|
}
|
||||||
rate.short_average = abit_s;
|
rate.short_average = abit_s;
|
||||||
if (signal.max_ber < signal.ber) {
|
if (signal.max_ber < signal.ber)
|
||||||
signal.max_ber = signal.ber;
|
signal.max_ber = signal.ber;
|
||||||
}
|
|
||||||
if (signal.max_sig < signal.sig) {
|
|
||||||
signal.max_sig = signal.sig;
|
|
||||||
}
|
|
||||||
if (signal.max_snr < signal.snr) {
|
|
||||||
signal.max_snr = signal.snr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((signal.min_ber == 0) || (signal.min_ber > signal.ber)) {
|
if (signal.max_sig < signal.sig)
|
||||||
|
signal.max_sig = signal.sig;
|
||||||
|
|
||||||
|
if (signal.max_snr < signal.snr)
|
||||||
|
signal.max_snr = signal.snr;
|
||||||
|
|
||||||
|
if ((signal.min_ber == 0) || (signal.min_ber > signal.ber))
|
||||||
signal.min_ber = signal.ber;
|
signal.min_ber = signal.ber;
|
||||||
}
|
|
||||||
if ((signal.min_sig == 0) || (signal.min_sig > signal.sig)) {
|
if ((signal.min_sig == 0) || (signal.min_sig > signal.sig))
|
||||||
signal.min_sig = signal.sig;
|
signal.min_sig = signal.sig;
|
||||||
}
|
|
||||||
if ((signal.min_snr == 0) || (signal.min_snr > signal.snr)) {
|
if ((signal.min_snr == 0) || (signal.min_snr > signal.snr))
|
||||||
signal.min_snr = signal.snr;
|
signal.min_snr = signal.snr;
|
||||||
}
|
|
||||||
|
|
||||||
paint_signal_fe(rate, signal);
|
paint_signal_fe(rate, signal);
|
||||||
|
|
||||||
@@ -230,10 +212,8 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
// switch paint mode
|
// switch paint mode
|
||||||
if (msg == CRCInput::RC_red || msg == CRCInput::RC_blue || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow) {
|
if (msg == CRCInput::RC_red || msg == CRCInput::RC_blue || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow) {
|
||||||
hide ();
|
hide ();
|
||||||
if(sigscale)
|
sigscale->reset();
|
||||||
sigscale->reset();
|
snrscale->reset();
|
||||||
if(snrscale)
|
|
||||||
snrscale->reset();
|
|
||||||
lastsnr = lastsig = -1;
|
lastsnr = lastsig = -1;
|
||||||
paint_mode = !paint_mode;
|
paint_mode = !paint_mode;
|
||||||
paint (paint_mode);
|
paint (paint_mode);
|
||||||
@@ -254,37 +234,32 @@ int CStreamInfo2::doSignalStrengthLoop ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -- any key --> abort
|
// -- any key --> abort
|
||||||
if (msg <= CRCInput::RC_MaxRC) {
|
if (msg <= CRCInput::RC_MaxRC)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
// -- push other events
|
// -- push other events
|
||||||
if (msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout) {
|
if (msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout)
|
||||||
CNeutrinoApp::getInstance ()->handleMsg (msg, data);
|
CNeutrinoApp::getInstance ()->handleMsg (msg, data);
|
||||||
}
|
|
||||||
}
|
|
||||||
if(sigscale){
|
|
||||||
delete sigscale;
|
|
||||||
sigscale = NULL;
|
|
||||||
}
|
|
||||||
if(snrscale){
|
|
||||||
delete snrscale;
|
|
||||||
snrscale = NULL;
|
|
||||||
}
|
}
|
||||||
|
delete sigscale;
|
||||||
|
sigscale = NULL;
|
||||||
|
delete snrscale;
|
||||||
|
snrscale = NULL;
|
||||||
ts_close ();
|
ts_close ();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::hide ()
|
void CStreamInfo2::hide ()
|
||||||
{
|
{
|
||||||
videoDecoder->Pig(-1, -1, -1, -1);
|
videoDecoder->Pig(-1, -1, -1, -1);
|
||||||
frameBuffer->paintBackgroundBoxRel (0, 0, max_width, max_height);
|
frameBuffer->paintBackgroundBoxRel (0, 0, max_width, max_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::paint_pig (int px, int py, int w, int h)
|
void CStreamInfo2::paint_pig (int px, int py, int w, int h)
|
||||||
{
|
{
|
||||||
frameBuffer->paintBackgroundBoxRel (px,py, w, h);
|
frameBuffer->paintBackgroundBoxRel (px,py, w, h);
|
||||||
printf("CStreamInfo2::paint_pig x %d y %d w %d h %d\n", px, py, w, h);
|
printf("CStreamInfo2::paint_pig x %d y %d w %d h %d\n", px, py, w, h);
|
||||||
videoDecoder->Pig(px, py, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true));
|
videoDecoder->Pig(px, py, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
||||||
@@ -328,12 +303,11 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
|||||||
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_Font[font_small]->getWidth();
|
||||||
|
|
||||||
if (paint_mode == 0) {
|
if (paint_mode == 0)
|
||||||
maxmin_x = sig_text_ber_x-(fontW*4);
|
maxmin_x = sig_text_ber_x-(fontW*4);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
maxmin_x = _x + 40 + xd * 3 + (fontW*4);
|
maxmin_x = _x + 40 + xd * 3 + (fontW*4);
|
||||||
}
|
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR, 0, true);
|
g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR, 0, true);
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR, 0, true);
|
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR, 0, true);
|
||||||
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR, 0, true);
|
g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR, 0, true);
|
||||||
@@ -344,9 +318,6 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
|
|||||||
signal.old_sig = 1;
|
signal.old_sig = 1;
|
||||||
signal.old_snr = 1;
|
signal.old_snr = 1;
|
||||||
signal.old_ber = 1;
|
signal.old_ber = 1;
|
||||||
|
|
||||||
// feSignal s = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
|
||||||
// paint_signal_fe(rate, signal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::paint_signal_fe(struct bitrate br, struct feSignal s)
|
void CStreamInfo2::paint_signal_fe(struct bitrate br, struct feSignal s)
|
||||||
@@ -444,7 +415,6 @@ void CStreamInfo2::paint (int /*mode*/)
|
|||||||
int xpos = x + 10;
|
int xpos = x + 10;
|
||||||
|
|
||||||
if (paint_mode == 0) {
|
if (paint_mode == 0) {
|
||||||
|
|
||||||
// -- tech Infos, PIG, small signal graph
|
// -- tech Infos, PIG, small signal graph
|
||||||
head_string = g_Locale->getText (LOCALE_STREAMINFO_HEAD);
|
head_string = g_Locale->getText (LOCALE_STREAMINFO_HEAD);
|
||||||
CVFD::getInstance ()->setMode (CVFD::MODE_MENU_UTF8, head_string);
|
CVFD::getInstance ()->setMode (CVFD::MODE_MENU_UTF8, head_string);
|
||||||
@@ -454,16 +424,8 @@ void CStreamInfo2::paint (int /*mode*/)
|
|||||||
g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD, 0, true); // UTF-8
|
g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
ypos += hheight;
|
ypos += hheight;
|
||||||
|
|
||||||
// paint PIG
|
|
||||||
//paint_pig (width - 240, y + 10, 240, 190);
|
|
||||||
paint_pig (width - width/3 - 10, y + 10, width/3, height/3);
|
paint_pig (width - width/3 - 10, y + 10, width/3, height/3);
|
||||||
|
|
||||||
// Info Output
|
|
||||||
//ypos += (iheight >> 1);
|
|
||||||
//ypos += iheight;
|
|
||||||
paint_techinfo (xpos, ypos);
|
paint_techinfo (xpos, ypos);
|
||||||
|
|
||||||
//paint_signal_fe_box (width - 240, (y + 190 + hheight), 240, 190);
|
|
||||||
paint_signal_fe_box (width - width/3 - 10, (y + 10 + height/3 + hheight), width/3, height/3 + hheight);
|
paint_signal_fe_box (width - width/3 - 10, (y + 10 + height/3 + hheight), width/3, height/3 + hheight);
|
||||||
} else {
|
} else {
|
||||||
// -- small PIG, small signal graph
|
// -- small PIG, small signal graph
|
||||||
@@ -474,73 +436,70 @@ void CStreamInfo2::paint (int /*mode*/)
|
|||||||
paint_signal_fe_box (x, y, width, height-100);
|
paint_signal_fe_box (x, y, width, height-100);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
||||||
{
|
{
|
||||||
char buf[100];
|
char buf[100];
|
||||||
//, buf2[100];
|
int xres = 0, yres = 0, aspectRatio = 0, framerate = -1;
|
||||||
int xres = 0, yres = 0, aspectRatio = 0, framerate;
|
|
||||||
// paint labels
|
// paint labels
|
||||||
int spaceoffset = 0,i = 0;
|
int spaceoffset = 0,i = 0;
|
||||||
int ypos1 = ypos;
|
int ypos1 = ypos;
|
||||||
int box_width = width*2/3 - 10;
|
int box_width = width*2/3 - 10;
|
||||||
if(box_h > 0)
|
if(box_h > 0)
|
||||||
{
|
|
||||||
frameBuffer->paintBoxRel (0, ypos, box_width, box_h, COL_MENUHEAD_PLUS_0);
|
frameBuffer->paintBoxRel (0, ypos, box_width, box_h, COL_MENUHEAD_PLUS_0);
|
||||||
}
|
|
||||||
|
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
|
||||||
|
if(!channel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
transponder t;
|
||||||
|
CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), t);
|
||||||
|
|
||||||
int array[5]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)),
|
int array[5]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)),
|
||||||
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)),
|
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)),
|
||||||
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)),
|
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)),
|
||||||
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)),
|
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)),
|
||||||
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))};
|
g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))};
|
||||||
for(i=0 ; i<5; i++)
|
|
||||||
{
|
for(i=0 ; i<5; i++) {
|
||||||
if(spaceoffset < array[i])
|
if(spaceoffset < array[i])
|
||||||
spaceoffset = array[i];
|
spaceoffset = array[i];
|
||||||
}
|
}
|
||||||
average_bitrate_offset = spaceoffset+=4;
|
average_bitrate_offset = spaceoffset+=4;
|
||||||
CZapitClient::CCurrentServiceInfo si = g_Zapit->getCurrentServiceInfo ();
|
|
||||||
|
|
||||||
if(si.vpid && !(videoDecoder->getBlank())){
|
if(channel->getVideoPid() && !(videoDecoder->getBlank())){
|
||||||
videoDecoder->getPictureInfo(xres, yres, framerate);
|
videoDecoder->getPictureInfo(xres, yres, framerate);
|
||||||
aspectRatio = videoDecoder->getAspectRatio();
|
aspectRatio = videoDecoder->getAspectRatio();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Video RESOLUTION
|
//Video RESOLUTION
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION));
|
sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION));
|
||||||
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
sprintf ((char *) buf, "%dx%d", xres, yres);
|
sprintf (buf, "%dx%d", xres, yres);
|
||||||
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
#if 0
|
|
||||||
ypos += iheight;
|
|
||||||
sprintf ((char *) buf, "%s: %d bits/sec", g_Locale->getText (LOCALE_STREAMINFO_BITRATE), (int) bitInfo[4] * 50);
|
|
||||||
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
|
|
||||||
#endif
|
|
||||||
//audio rate
|
//audio rate
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO));
|
sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO));
|
||||||
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
switch (aspectRatio) {
|
switch (aspectRatio) {
|
||||||
case 0:
|
case 0:
|
||||||
sprintf ((char *) buf, "N/A");
|
sprintf (buf, "N/A");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
sprintf ((char *) buf, "4:3");
|
sprintf (buf, "4:3");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sprintf ((char *) buf, "14:9");
|
sprintf (buf, "14:9");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sprintf ((char *) buf, "16:9");
|
sprintf (buf, "16:9");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
sprintf ((char *) buf, "20:9");
|
sprintf (buf, "20:9");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf));
|
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf));
|
||||||
}
|
}
|
||||||
@@ -548,37 +507,36 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
|
|
||||||
//Video FRAMERATE
|
//Video FRAMERATE
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
sprintf ((char *) buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE));
|
sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE));
|
||||||
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
videoDecoder->getPictureInfo(xres, yres, framerate);
|
|
||||||
switch (framerate) {
|
switch (framerate) {
|
||||||
case 0:
|
case 0:
|
||||||
snprintf ((char *) buf,sizeof(buf), "23.976fps");
|
snprintf (buf,sizeof(buf), "23.976fps");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
snprintf ((char *) buf,sizeof(buf), "24fps");
|
snprintf (buf,sizeof(buf), "24fps");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
snprintf ((char *) buf,sizeof(buf), "25fps");
|
snprintf (buf,sizeof(buf), "25fps");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
snprintf ((char *) buf,sizeof(buf), "29,976fps");
|
snprintf (buf,sizeof(buf), "29,976fps");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
snprintf ((char *) buf,sizeof(buf), "30fps");
|
snprintf (buf,sizeof(buf), "30fps");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
snprintf ((char *) buf,sizeof(buf), "50fps");
|
snprintf (buf,sizeof(buf), "50fps");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
snprintf ((char *) buf,sizeof(buf), "50,94fps");
|
snprintf (buf,sizeof(buf), "50,94fps");
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
snprintf ((char *) buf,sizeof(buf), "60fps");
|
snprintf (buf,sizeof(buf), "60fps");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf));
|
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
// place for average bitrate
|
// place for average bitrate
|
||||||
@@ -587,112 +545,85 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
int type, layer, freq, mode, lbitrate;
|
int type, layer, freq, mode, lbitrate;
|
||||||
audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode);
|
audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode);
|
||||||
#if 0
|
|
||||||
const char *layernames[4] = { "res", "III", "II", "I" };
|
|
||||||
const char *sampfreqnames[4] = { "44,1k", "48k", "32k", "res" };
|
|
||||||
const char *modenames[4] = { "stereo", "joint_st", "dual_ch", "single_ch" };
|
|
||||||
|
|
||||||
sprintf ((char *) buf, "%s: %s (%s/%s) %s", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE), modenames[stereo], sampfreqnames[sampfreq], layernames[layer], copy ? "c" : "");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
const char *mpegmodes[4] = { "stereo", "joint_st", "dual_ch", "single_ch" };
|
const char *mpegmodes[4] = { "stereo", "joint_st", "dual_ch", "single_ch" };
|
||||||
const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" };
|
const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" };
|
||||||
|
|
||||||
sprintf ((char *) buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE));
|
sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE));
|
||||||
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
if(type == 0) {
|
if(type == 0) {
|
||||||
sprintf ((char *) buf, "MPEG %s (%d)", mpegmodes[mode], freq);
|
sprintf (buf, "MPEG %s (%d)", mpegmodes[mode], freq);
|
||||||
} else {
|
} else {
|
||||||
sprintf ((char *) buf, "DD %s (%d)", ddmodes[mode], freq);
|
sprintf (buf, "DD %s (%d)", ddmodes[mode], freq);
|
||||||
}
|
}
|
||||||
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
//satellite
|
//satellite
|
||||||
t_satellite_position satellitePosition = CNeutrinoApp::getInstance ()->channelList->getActiveSatellitePosition ();
|
|
||||||
|
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
if(frontend->getInfo()->type == FE_QPSK) {
|
if(t.type == FE_QPSK)
|
||||||
sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_SATSETUP_SATELLITE));//swiped locale
|
sprintf (buf, "%s:",g_Locale->getText (LOCALE_SATSETUP_SATELLITE));//swiped locale
|
||||||
}
|
else if(t.type == FE_QAM)
|
||||||
else if(frontend->getInfo()->type == FE_QAM) {
|
sprintf (buf, "%s:",g_Locale->getText (LOCALE_CHANNELLIST_PROVS));
|
||||||
sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_CHANNELLIST_PROVS));
|
|
||||||
}
|
|
||||||
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
sprintf ((char *) buf, "%s",
|
sprintf (buf, "%s",
|
||||||
CServiceManager::getInstance()->GetSatelliteName(satellitePosition).c_str());
|
CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str());
|
||||||
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList;
|
|
||||||
|
|
||||||
//channel
|
//channel
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
sprintf ((char *) buf, "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale
|
sprintf (buf, "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale
|
||||||
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
|
||||||
sprintf((char*) buf, "%s" ,channelList->getActiveChannelName().c_str());
|
sprintf(buf, "%s", channel->getName().c_str());
|
||||||
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
//tsfrequenz
|
//tsfrequenz
|
||||||
ypos += iheight;
|
ypos += iheight;
|
||||||
char * f=NULL, *s=NULL, *m=NULL;
|
|
||||||
if(frontend->getInfo()->type == FE_QPSK) {
|
|
||||||
frontend->getDelSys((fe_code_rate_t)si.fec, dvbs_get_modulation((fe_code_rate_t)si.fec), f, s, m);
|
|
||||||
if (!strncmp(s,const_cast<char *>("DVB-S2"),6)){
|
|
||||||
s=const_cast<char *>("S2");
|
|
||||||
scaling = 27000;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
s=const_cast<char *>("S1");
|
|
||||||
scaling = 15000;
|
|
||||||
}
|
|
||||||
sprintf ((char *) buf,"%d.%d (%c) %d %s %s %s", si.tsfrequency / 1000, si.tsfrequency % 1000, transponder::pol(si.polarisation), si.rate / 1000,f,m,s);
|
|
||||||
g_Font[font_info]->RenderString(xpos, ypos, box_width, "Tp. Freq.:" , COL_INFOBAR, 0, true); // UTF-8
|
|
||||||
g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
|
||||||
}
|
|
||||||
else if(frontend->getInfo()->type == FE_QAM) {
|
|
||||||
sprintf ((char *) buf, "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA));
|
|
||||||
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
|
|
||||||
sprintf((char*) buf, "%d.%d MHz", si.tsfrequency/1000, si.tsfrequency%1000);
|
|
||||||
g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
|
||||||
scaling = 27000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
scaling = 27000;
|
||||||
|
if (t.type == FE_QPSK && t.feparams.u.qpsk.fec_inner < FEC_S2_QPSK_1_2)
|
||||||
|
scaling = 15000;
|
||||||
|
|
||||||
|
sprintf (buf, "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA));
|
||||||
|
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, t.description().c_str(), COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
// paint labels
|
// paint labels
|
||||||
int fontW = g_Font[font_small]->getWidth();
|
int fontW = g_Font[font_small]->getWidth();
|
||||||
spaceoffset = 7 * fontW;
|
spaceoffset = 7 * fontW;
|
||||||
//onid
|
//onid
|
||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
sprintf((char*) buf, "0x%04X (%i)", si.onid, si.onid);
|
sprintf(buf, "0x%04X (%i)", channel->getOriginalNetworkId(), channel->getOriginalNetworkId());
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
//sid
|
//sid
|
||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
sprintf((char*) buf, "0x%04X (%i)", si.sid, si.sid);
|
sprintf(buf, "0x%04X (%i)", channel->getServiceId(), channel->getServiceId());
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
//tsid
|
//tsid
|
||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
sprintf((char*) buf, "0x%04X (%i)", si.tsid, si.tsid);
|
sprintf(buf, "0x%04X (%i)", channel->getTransportStreamId(), channel->getTransportStreamId());
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
//pmtpid
|
//pmtpid
|
||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
pmt_version = si.pmt_version;
|
pmt_version = channel->getPmtVersion();
|
||||||
sprintf((char*) buf, "0x%04X (%i) [%i]", si.pmtpid, si.pmtpid,pmt_version);
|
sprintf(buf, "0x%04X (%i) [0x%02X]", channel->getPmtPid(), channel->getPmtPid(), pmt_version);
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
|
|
||||||
|
|
||||||
//vpid
|
//vpid
|
||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
if ( g_RemoteControl->current_PIDs.PIDs.vpid > 0 ){
|
if ( g_RemoteControl->current_PIDs.PIDs.vpid > 0 ){
|
||||||
sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vpid, g_RemoteControl->current_PIDs.PIDs.vpid );
|
sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vpid, g_RemoteControl->current_PIDs.PIDs.vpid );
|
||||||
} else {
|
} else {
|
||||||
sprintf((char*) buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
||||||
}
|
}
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
@@ -701,12 +632,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
ypos+= sheight;
|
ypos+= sheight;
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
if (g_RemoteControl->current_PIDs.APIDs.empty()){
|
if (g_RemoteControl->current_PIDs.APIDs.empty()){
|
||||||
sprintf((char*) buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
||||||
} else {
|
} else {
|
||||||
unsigned int sw=spaceoffset;
|
unsigned int sw=spaceoffset;
|
||||||
for (unsigned int li= 0; (li<g_RemoteControl->current_PIDs.APIDs.size()) && (li<10); li++)
|
for (unsigned int li= 0; (li<g_RemoteControl->current_PIDs.APIDs.size()) && (li<10); li++)
|
||||||
{
|
{
|
||||||
sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid );
|
sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid );
|
||||||
if (li == g_RemoteControl->current_PIDs.PIDs.selected_apid){
|
if (li == g_RemoteControl->current_PIDs.PIDs.selected_apid){
|
||||||
g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
}
|
}
|
||||||
@@ -724,9 +655,9 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
|
|||||||
//vtxtpid
|
//vtxtpid
|
||||||
ypos += sheight;
|
ypos += sheight;
|
||||||
if ( g_RemoteControl->current_PIDs.PIDs.vtxtpid == 0 )
|
if ( g_RemoteControl->current_PIDs.PIDs.vtxtpid == 0 )
|
||||||
sprintf((char*) buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
|
||||||
else
|
else
|
||||||
sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid );
|
sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid );
|
||||||
g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR, 0, true); // UTF-8
|
||||||
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
|
||||||
if(box_h == 0)
|
if(box_h == 0)
|
||||||
@@ -955,7 +886,6 @@ void CStreamInfo2::showSNR ()
|
|||||||
{
|
{
|
||||||
char percent[10];
|
char percent[10];
|
||||||
int barwidth = 150;
|
int barwidth = 150;
|
||||||
// uint16_t ssig, ssnr;
|
|
||||||
int sig, snr;
|
int sig, snr;
|
||||||
int posx, posy;
|
int posx, posy;
|
||||||
int sw = g_Font[font_info]->getRenderWidth ("100%");
|
int sw = g_Font[font_info]->getRenderWidth ("100%");
|
||||||
|
Reference in New Issue
Block a user