-fix possible errors

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1069 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2011-01-26 19:13:05 +00:00
parent 4202fa903a
commit 27cd2c802f

View File

@@ -31,7 +31,7 @@
#include <system/settings.h>
#include <gui/widget/progressbar.h>
static CProgressBar *timescale;
static CProgressBar *timescale = 0;
#define TIMEOSD_FONT SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME
#define BARLEN 200
@@ -41,9 +41,12 @@ CTimeOSD::CTimeOSD()
visible=false;
m_mode=MODE_ASC;
GetDimensions();
if (! timescale)
if (! timescale ){
if(m_height < 5)
m_height = 10;
timescale = new CProgressBar(true, BARLEN, m_height -5, 40, 100, 70, true);
}
}
CTimeOSD::~CTimeOSD()
{
@@ -61,6 +64,7 @@ void CTimeOSD::show(time_t time_show)
m_time_dis = time(NULL);
m_time_show = time_show;
frameBuffer->paintBoxRel(m_xstart-2, m_y, 2+BARLEN+2, m_height, COL_INFOBAR_SHADOW_PLUS_0); //border
if(timescale)
timescale->reset();
update();
}
@@ -119,8 +123,13 @@ void CTimeOSD::update(time_t time_show)
void CTimeOSD::updatePos(short runningPercent)
{
if(timescale){
if(runningPercent > 100 || runningPercent < 0){
runningPercent = 0;
}
timescale->paintProgressBar2(m_xstart, m_y, runningPercent);
}
}
void CTimeOSD::hide()
{
@@ -129,6 +138,7 @@ void CTimeOSD::hide()
return;
frameBuffer->paintBackgroundBoxRel(m_xend - m_width - t1, m_y, m_width, m_height);
visible=false;
if(timescale)
timescale->reset();
frameBuffer->paintBackgroundBoxRel(m_xstart-2, m_y, 2+BARLEN+2, m_height); //clear border