Fix picture view move; Enable hw blit for picture/logo; Move channel logo display after all channellist shown

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


Origin commit data
------------------
Branch: ni/coolstream
Commit: 022509f24e
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-06 (Sat, 06 Feb 2010)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2010-02-06 15:13:12 +00:00
parent f86aebd4e7
commit 1d1f19bef9
5 changed files with 91 additions and 77 deletions

View File

@@ -1516,7 +1516,8 @@ void * CFrameBuffer::convertRGB2FB(unsigned char *rgbbuff, unsigned long x, unsi
unsigned int *fbbuff; unsigned int *fbbuff;
unsigned long count = x*y; unsigned long count = x*y;
fbbuff = (unsigned int *) malloc(count * sizeof(unsigned int)); //fbbuff = (unsigned int *) malloc(count * sizeof(unsigned int));
fbbuff = (unsigned int *) cs_malloc_uncached(count * sizeof(unsigned int));
if(fbbuff == NULL) if(fbbuff == NULL)
{ {
printf("convertRGB2FB: Error: malloc\n"); printf("convertRGB2FB: Error: malloc\n");
@@ -1608,6 +1609,5 @@ void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, in
CFrameBuffer::getInstance()->Clear(); CFrameBuffer::getInstance()->Clear();
blit2FB(fbbuff, x_size, y_size, x_offs, y_offs, x_pan, y_pan); blit2FB(fbbuff, x_size, y_size, x_offs, y_offs, x_pan, y_pan);
free(fbbuff); cs_free_uncached(fbbuff);
} }

View File

@@ -387,7 +387,7 @@ void CPictureViewer::showBusy (int sx, int sy, int width, char r, char g, char b
m_busy_y = sy; m_busy_y = sy;
m_busy_width = width; m_busy_width = width;
m_busy_cpp = cpp; m_busy_cpp = cpp;
free (fb_buffer); cs_free_uncached (fb_buffer);
// dbout("Show Busy}\n"); // dbout("Show Busy}\n");
} }
@@ -546,12 +546,10 @@ printf("getImage: resize %s to %d x %d \n", name.c_str (), width, height);
y = height; y = height;
} }
ret = (fb_pixel_t *) CFrameBuffer::getInstance()->convertRGB2FB(buffer, x, y, convertSetupAlpha2Alpha(g_settings.infobar_alpha)); ret = (fb_pixel_t *) CFrameBuffer::getInstance()->convertRGB2FB(buffer, x, y, convertSetupAlpha2Alpha(g_settings.infobar_alpha));
free(buffer);
} else { } else {
printf ("Error decoding file %s\n", name.c_str ()); printf ("Error decoding file %s\n", name.c_str ());
free (buffer);
buffer = NULL;
} }
free(buffer);
} else } else
printf("Error open file %s\n", name.c_str ()); printf("Error open file %s\n", name.c_str ());

View File

@@ -552,8 +552,10 @@ int CChannelList::show()
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart) if(oldliststart!=liststart)
paint(); paint();
else else {
paintItem(selected - liststart); paintItem(selected - liststart);
showChannelLogo();
}
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); } if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
//paintHead(); //paintHead();
@@ -578,8 +580,10 @@ int CChannelList::show()
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart) if(oldliststart!=liststart)
paint(); paint();
else else {
paintItem(selected - liststart); paintItem(selected - liststart);
showChannelLogo();
}
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); } if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
//paintHead(); //paintHead();
@@ -671,7 +675,7 @@ int CChannelList::show()
for(i = selected+1; i < chanlist.size(); i++) { for(i = selected+1; i < chanlist.size(); i++) {
char firstCharOfTitle = chanlist[i]->name.c_str()[0]; char firstCharOfTitle = chanlist[i]->name.c_str()[0];
if(tolower(firstCharOfTitle) == smsKey) { if(tolower(firstCharOfTitle) == smsKey) {
//printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->name.c_str()); //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->name.c_str());
break; break;
} }
} }
@@ -679,7 +683,7 @@ int CChannelList::show()
for(i = 0; i < chanlist.size(); i++) { for(i = 0; i < chanlist.size(); i++) {
char firstCharOfTitle = chanlist[i]->name.c_str()[0]; char firstCharOfTitle = chanlist[i]->name.c_str()[0];
if(tolower(firstCharOfTitle) == smsKey) { if(tolower(firstCharOfTitle) == smsKey) {
//printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->name.c_str()); //printf("SMS chan found was= %d selected= %d i= %d %s\n", was_sms, selected, i, chanlist[i]->channel->name.c_str());
break; break;
} }
} }
@@ -695,6 +699,7 @@ int CChannelList::show()
paint(); paint();
} else { } else {
paintItem(selected - liststart); paintItem(selected - liststart);
showChannelLogo();
} }
} }
c_SMSKeyInput->resetOldKey(); c_SMSKeyInput->resetOldKey();
@@ -729,7 +734,7 @@ int CChannelList::show()
hide(); hide();
if (bShowBouquetList) { if (bShowBouquetList) {
res = bouquetList->exec(true); res = bouquetList->exec(true);
printf("CChannelList:: bouquetList->exec res %d\n", res); printf("CChannelList:: bouquetList->exec res %d\n", res);
} }
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
new_mode_active = 0; new_mode_active = 0;
@@ -740,7 +745,7 @@ printf("CChannelList:: bouquetList->exec res %d\n", res);
if(zapOnExit) if(zapOnExit)
res = selected; res = selected;
printf("CChannelList::show *********** res %d\n", res); printf("CChannelList::show *********** res %d\n", res);
return(res); return(res);
} }
@@ -1432,6 +1437,15 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
} }
} }
void CChannelList::showChannelLogo()
{
frameBuffer->paintBoxRel(x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0);
std::string lname;
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname))
g_PicViewer->DisplayImage(lname, x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H);
}
void CChannelList::paintItem(int pos) void CChannelList::paintItem(int pos)
{ {
int ypos = y+ theight+0 + pos*fheight; int ypos = y+ theight+0 + pos*fheight;
@@ -1449,13 +1463,14 @@ void CChannelList::paintItem(int pos)
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
paintItem2DetailsLine (pos, curr); paintItem2DetailsLine (pos, curr);
paintDetails(curr); paintDetails(curr);
#if 0
frameBuffer->paintBoxRel(x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0); frameBuffer->paintBoxRel(x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0);
//g_PicViewer->DisplayLogo(chanlist[selected]->channel_id, x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H);
std::string lname; std::string lname;
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname)) if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname))
g_PicViewer->DisplayImage(lname, x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H); g_PicViewer->DisplayImage(lname, x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H);
#endif
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, ROUND_RADIUS); frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, ROUND_RADIUS);
} else { } else {
color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
@@ -1676,7 +1691,7 @@ void CChannelList::paint()
int sbs= (selected/listmaxshow); int sbs= (selected/listmaxshow);
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
showChannelLogo();
} }
int CChannelList::getSize() const int CChannelList::getSize() const

View File

@@ -84,6 +84,7 @@ class CChannelList
void paint(); void paint();
void paintHead(); void paintHead();
void hide(); void hide();
void showChannelLogo();
public: public:
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false ); CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false );

View File

@@ -397,7 +397,7 @@ int CPictureViewerGui::show()
} }
else if ( msg == CRCInput::RC_1 ) else if ( msg == CRCInput::RC_1 )
{ {
if (m_state != MENU) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Zoom(2.0/3); m_viewer->Zoom(2.0/3);
} }
@@ -405,14 +405,14 @@ int CPictureViewerGui::show()
} }
else if ( msg == CRCInput::RC_2 ) else if ( msg == CRCInput::RC_2 )
{ {
if (m_state != MENU) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Move(0,-50); m_viewer->Move(0,-50);
} }
} }
else if ( msg == CRCInput::RC_3 ) else if ( msg == CRCInput::RC_3 )
{ {
if (m_state != MENU) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Zoom(1.5); m_viewer->Zoom(1.5);
} }
@@ -420,7 +420,7 @@ int CPictureViewerGui::show()
} }
else if ( msg == CRCInput::RC_4 ) else if ( msg == CRCInput::RC_4 )
{ {
if (m_state != MENU) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Move(-50,0); m_viewer->Move(-50,0);
} }
@@ -447,14 +447,14 @@ int CPictureViewerGui::show()
} }
else if ( msg == CRCInput::RC_6 ) else if ( msg == CRCInput::RC_6 )
{ {
if (m_state != MENU && playlist.empty()) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Move(50,0); m_viewer->Move(50,0);
} }
} }
else if ( msg == CRCInput::RC_8 ) else if ( msg == CRCInput::RC_8 )
{ {
if (m_state != MENU && playlist.empty()) if (m_state != MENU && !playlist.empty())
{ {
m_viewer->Move(0,50); m_viewer->Move(0,50);
} }