add change blink

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@182 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 0efa0ba641
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2010-01-18 (Mon, 18 Jan 2010)



------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2010-01-18 15:37:10 +00:00
parent fdd0139676
commit aad921696c
19 changed files with 93 additions and 49 deletions

View File

@@ -50,7 +50,6 @@
#include <sys/sysinfo.h>
#include <sys/vfs.h>
extern bool pb_blink;
static const int FSHIFT = 16; /* nr of bits of precision */
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
@@ -279,7 +278,7 @@ void CDBoxInfoWidget::paint()
//fprintf(stderr, "width: %d offsetw: %d pbw: %d\n", width, offsetw, pbw);
if (pbw > 8) /* smaller progressbar is not useful ;) */
{
CProgressBar pb(pb_blink, -1, -1, 30, 100, 70, true);
CProgressBar pb(g_settings.progressbar_color, -1, -1, 30, 100, 70, true);
pb.paintProgressBarDefault(x+offsetw, ypos+3, pbw, mheight-10, blocks_percent_used, 100);
}
ypos+= mheight;

View File

@@ -52,7 +52,6 @@
#include <gui/customcolor.h>
#include <gui/pictureviewer.h>
extern bool pb_blink;
extern CPictureViewer * g_PicViewer;
#define PIC_W 52
#define PIC_H 39
@@ -627,7 +626,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
if ( epg_done!= -1 )
{
int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1);
CProgressBar pb(pb_blink, -1, -1, 30, 100, 70, true);
CProgressBar pb(g_settings.progressbar_color, -1, -1, 30, 100, 70, true);
pb.paintProgressBarDefault(pbx, sy+oy-height, 104, height-6, epg_done, 104);
}
@@ -667,7 +666,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
if (data == g_InfoViewer->lcdUpdateTimer) {
GetEPGData(channel_id, id, &startzeit, false);
if ( epg_done!= -1 ) {
CProgressBar pb(pb_blink, -1, -1, 30, 100, 70, true);
CProgressBar pb(g_settings.progressbar_color, -1, -1, 30, 100, 70, true);
int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1);
pb.paintProgressBarDefault(pbx, sy+oy-height, 104, height-6, epg_done, 104);
}

View File

@@ -107,7 +107,6 @@ bool newfreq = true;
char old_timestr[10];
static event_id_t last_curr_id = 0, last_next_id = 0;
extern bool pb_blink;
int bottom_bar_offset;
extern CZapitClient::SatelliteList satList;
@@ -169,26 +168,14 @@ void CInfoViewer::Init()
infobar_show_channellogo = atoi(tmp);
/* maybe we should not tie this to the blinkenlights settings? */
if (pb_blink)
if (g_settings.progressbar_color)
bottom_bar_offset = 22;
else
bottom_bar_offset = 0;
/* after font size changes, Init() might be called multiple times */
if (sigscale != NULL)
delete sigscale;
sigscale = new CProgressBar(pb_blink, BAR_WIDTH, 10, RED_BAR, GREEN_BAR, YELLOW_BAR);
if (snrscale != NULL)
delete snrscale;
snrscale = new CProgressBar(pb_blink, BAR_WIDTH, 10, RED_BAR, GREEN_BAR, YELLOW_BAR);
if (hddscale != NULL)
delete hddscale;
hddscale = new CProgressBar(pb_blink, 100, 6, 50, GREEN_BAR, 75, true);
if (varscale != NULL)
delete varscale;
varscale = new CProgressBar(pb_blink, 100, 6, 50, GREEN_BAR, 75, true);
if (timescale != NULL)
delete timescale;
timescale = new CProgressBar(pb_blink, -1, -1, 30, GREEN_BAR, 70, true);
changePB();
pbBlinkChange = g_settings.progressbar_color;
/* we need to calculate this only once */
info_time_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth("22:22") + 10;
@@ -261,6 +248,25 @@ void CInfoViewer::start ()
lcdUpdateTimer = g_RCInput->addTimer (LCD_UPDATE_TIME_TV_MODE, false, true);
}
void CInfoViewer::changePB()
{
if (sigscale != NULL)
delete sigscale;
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, 10, RED_BAR, GREEN_BAR, YELLOW_BAR);
if (snrscale != NULL)
delete snrscale;
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, 10, RED_BAR, GREEN_BAR, YELLOW_BAR);
if (hddscale != NULL)
delete hddscale;
hddscale = new CProgressBar(g_settings.progressbar_color, 100, 6, 50, GREEN_BAR, 75, true);
if (varscale != NULL)
delete varscale;
varscale = new CProgressBar(g_settings.progressbar_color, 100, 6, 50, GREEN_BAR, 75, true);
if (timescale != NULL)
delete timescale;
timescale = new CProgressBar(g_settings.progressbar_color, -1, -1, 30, GREEN_BAR, 70, true);
}
void CInfoViewer::paintTime (bool show_dot, bool firstPaint)
{
if (! gotTime)
@@ -370,6 +376,11 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
bool fadeIn = g_settings.widget_fade && (!is_visible) && showButtonBar;
if(pbBlinkChange != g_settings.progressbar_color){
pbBlinkChange = g_settings.progressbar_color;
changePB();
}
is_visible = true;
if (!calledFromNumZap && fadeIn)
fadeTimer = g_RCInput->addTimer (FADE_TIME, false);
@@ -1211,7 +1222,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
if (pb_p > pb_w)
pb_p = pb_w;
timescale->paintProgressBar(BoxEndX - pb_w - SHADOW_OFFSET, BoxStartY + 12, pb_w, pb_h, pb_p, pb_w,
0, 0, pb_blink ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0, COL_INFOBAR_SHADOW_PLUS_0, "", COL_INFOBAR);
0, 0, g_settings.progressbar_color ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0, COL_INFOBAR_SHADOW_PLUS_0, "", COL_INFOBAR);
}
int currTimeW = 0;

View File

@@ -94,6 +94,8 @@ class CInfoViewer
int lastsnr, lastsig, lasthdd, lastvar, lasttime;
CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale;
bool pbBlinkChange;
void changePB();
void paintBackground(int col_Numbox);
void show_Data( bool calledFromEvent = false );

View File

@@ -46,7 +46,6 @@
#include <zapit/frontend_c.h>
extern CFrontend * frontend;
extern bool pb_blink;
static int g_sig;
static int g_snr;
@@ -90,8 +89,9 @@ void CMotorControl::Init(void)
motorPosition = 1;
satellitePosition = 0;
stepDelay = 10;
sigscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
pbBlinkChange = g_settings.progressbar_color;
}
int CMotorControl::exec(CMenuTarget* parent, const std::string &)
@@ -107,6 +107,17 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
CZapitClient::commandSetScanSatelliteList sat;
sat_iterator_t sit;
if(pbBlinkChange != g_settings.progressbar_color){
pbBlinkChange = g_settings.progressbar_color;
if(sigscale){
delete sigscale;
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
}
if(snrscale){
delete snrscale;
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
}
}
sigscale->reset();
snrscale->reset();
lastsnr = lastsig = -1;

View File

@@ -67,7 +67,7 @@ class CMotorControl : public CMenuTarget
int satfindpid;
int lastsnr, lastsig;
CProgressBar *snrscale, *sigscale;
bool pbBlinkChange;
void paint();
void paintMenu(void);
void paintStatus(void);

View File

@@ -68,7 +68,6 @@
#include <gui/pictureviewer.h>
#include <gui/customcolor.h>
extern bool pb_blink;
extern CPictureViewer * g_PicViewer;
#define PIC_W 52
#define PIC_H 39
@@ -3893,7 +3892,7 @@ static off64_t cut_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie)
CFrameBuffer * frameBuffer = CFrameBuffer::getInstance();
if (! timescale)
timescale = new CProgressBar(pb_blink, 200, 15, 0, 100, 0);
timescale = new CProgressBar(g_settings.progressbar_color, 200, 15, 0, 100, 0);
int dx = 256;
int x = (((g_settings.screen_EndX- g_settings.screen_StartX)- dx) / 2) + g_settings.screen_StartX;
int y = g_settings.screen_EndY - 50;
@@ -4147,7 +4146,7 @@ printf("copy: len %d minute %lld second %lld\n", len, len ? size/len : 511040*60
CFrameBuffer * frameBuffer = CFrameBuffer::getInstance();
if (! timescale)
timescale = new CProgressBar(pb_blink, 200, 15, 0, 100, 0);
timescale = new CProgressBar(g_settings.progressbar_color, 200, 15, 0, 100, 0);
int dx = 256;
int x = (((g_settings.screen_EndX- g_settings.screen_StartX)- dx) / 2) + g_settings.screen_StartX;
int y = g_settings.screen_EndY - 50;

View File

@@ -60,7 +60,6 @@
#include <video_cs.h>
extern cVideo * videoDecoder;
extern CFrontend * frontend;
extern bool pb_blink;
#define NEUTRINO_SCAN_START_SCRIPT CONFIGDIR "/scan.start"
#define NEUTRINO_SCAN_STOP_SCRIPT CONFIGDIR "/scan.stop"
@@ -80,9 +79,9 @@ CScanTs::CScanTs()
total = done = 0;
freqready = 0;
sigscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
pbBlinkChange = g_settings.progressbar_color;
}
extern int scan_pids;
@@ -115,6 +114,18 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
if(scan_all)
scan_mode |= 0xFF00;
if(pbBlinkChange != g_settings.progressbar_color){
pbBlinkChange = g_settings.progressbar_color;
if(sigscale){
delete sigscale;
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
}
if(snrscale){
delete snrscale;
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
}
}
sigscale->reset();
snrscale->reset();
lastsig = lastsnr = -1;

View File

@@ -66,6 +66,7 @@ class CScanTs : public CMenuTarget
uint32_t done;
int lastsnr, lastsig;
CProgressBar *snrscale, *sigscale;
bool pbBlinkChange;
void paint(bool fortest = false);
void paintLineLocale(int x, int * y, int width, const neutrino_locale_t l);

View File

@@ -56,7 +56,6 @@ extern cAudio * audioDecoder;
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern CZapitClient::SatelliteList satList;
extern bool pb_blink;
#if 0
extern CPipSetup * g_Pip0;
@@ -138,8 +137,8 @@ int CStreamInfo2::doSignalStrengthLoop ()
{
#define BAR_WIDTH 150
#define BAR_HEIGHT 12
sigscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(pb_blink, BAR_WIDTH, BAR_HEIGHT);
sigscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
snrscale = new CProgressBar(g_settings.progressbar_color, BAR_WIDTH, BAR_HEIGHT);
lastsnr = lastsig = -1;
neutrino_msg_t msg;

View File

@@ -32,7 +32,6 @@
#include <gui/widget/progressbar.h>
static CProgressBar *timescale;
extern bool pb_blink;
#define TIMEOSD_FONT SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME
#define TIMEBARH 38
@@ -44,7 +43,7 @@ CTimeOSD::CTimeOSD()
m_mode=MODE_ASC;
GetDimensions();
if (! timescale)
timescale = new CProgressBar(pb_blink, 200, 32, 40, 100, 70, true);
timescale = new CProgressBar(g_settings.progressbar_color, 200, 32, 40, 100, 70, true);
}
CTimeOSD::~CTimeOSD()