neutrino: simplify streaminfo and make it scaling-aware

fb->paintLine() is aware of scaling, but fb->paintPixel() is not.
Use paintLine() in streaminfo to fix it for scaling FB mode.
Simplify the code while we are at it.


Origin commit data
------------------
Commit: 3ac9bb5388
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-03-10 (Sat, 10 Mar 2012)
This commit is contained in:
Stefan Seyfried
2012-03-10 16:26:04 +01:00
parent 0c7d737fd0
commit 458884bbae

View File

@@ -345,8 +345,10 @@ void CStreamInfo2::paint_signal_fe(struct bitrate br, struct feSignal s)
{
int x_now = sigBox_pos;
int yt = sig_text_y + (sheight *2)+4;
int yd;
static int old_x=0,old_y=0;
int yd[4];
const fb_pixel_t colors[4] = { COL_YELLOW, COL_RED, COL_GREEN, COL_BLUE };
static int old_x = 0, old_y[4] = { 0, 0, 0, 0 };
int i;
sigBox_pos++;
sigBox_pos %= sigBox_w;
@@ -356,27 +358,22 @@ void CStreamInfo2::paint_signal_fe(struct bitrate br, struct feSignal s)
long value = (long) (bit_s / 1000ULL);
if ( g_RemoteControl->current_PIDs.PIDs.vpid > 0 ){
yd = y_signal_fe (value, scaling, sigBox_h);// Video + Audio
yd[0] = y_signal_fe (value, scaling, sigBox_h);// Video + Audio
} else {
yd = y_signal_fe (value, 512, sigBox_h); // Audio only
yd[0] = y_signal_fe (value, 512, sigBox_h); // Audio only
}
if ((old_x == 0 && old_y == 0) || sigBox_pos == 1) {
old_x = sigBox_x+x_now;
old_y = sigBox_y+sigBox_h-yd;
} else {
frameBuffer->paintLine(old_x, old_y, sigBox_x+x_now, sigBox_y+sigBox_h-yd, COL_YELLOW); //yellow
old_x = sigBox_x+x_now;
old_y = sigBox_y+sigBox_h-yd;
yd[1] = y_signal_fe(s.ber, 4000, sigBox_h);
yd[2] = y_signal_fe(s.sig, 65000, sigBox_h);
yd[3] = y_signal_fe(s.snr, 65000, sigBox_h);
for (i = 0; i < 4; i++)
{
if (!((old_x == 0 && old_y[i] == 0) || sigBox_pos == 1))
frameBuffer->paintLine(old_x, old_y[i],
sigBox_x + x_now, sigBox_y + sigBox_h - yd[i], colors[i]);
old_y[i] = sigBox_y + sigBox_h - yd[i];
}
yd = y_signal_fe (s.ber, 4000, sigBox_h);
frameBuffer->paintPixel(sigBox_x+x_now, sigBox_y+sigBox_h-yd, COL_RED); //red
yd = y_signal_fe (s.sig, 65000, sigBox_h);
frameBuffer->paintPixel(sigBox_x+x_now, sigBox_y+sigBox_h-yd, COL_GREEN); //green
yd = y_signal_fe (s.snr, 65000, sigBox_h);
frameBuffer->paintPixel(sigBox_x+x_now, sigBox_y+sigBox_h-yd, COL_BLUE); //blue
old_x = sigBox_x + x_now;
if (s.max_ber != s_old.max_ber)
SignalRenderStr(s_old.max_ber, s.max_ber, sig_text_ber_x, yt);