mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 ());
|
||||||
|
|
||||||
|
@@ -473,7 +473,7 @@ int CChannelList::show()
|
|||||||
|
|
||||||
gettimeofday(&t2, NULL);
|
gettimeofday(&t2, NULL);
|
||||||
fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n",
|
fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n",
|
||||||
((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL);
|
((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL);
|
||||||
|
|
||||||
int oldselected = selected;
|
int oldselected = selected;
|
||||||
int zapOnExit = false;
|
int zapOnExit = false;
|
||||||
@@ -537,53 +537,57 @@ int CChannelList::show()
|
|||||||
paint();
|
paint();
|
||||||
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
|
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
|
||||||
{
|
{
|
||||||
int step = 0;
|
int step = 0;
|
||||||
int prev_selected = selected;
|
int prev_selected = selected;
|
||||||
|
|
||||||
step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1
|
step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1
|
||||||
selected -= step;
|
selected -= step;
|
||||||
if((prev_selected-step) < 0) // because of uint
|
if((prev_selected-step) < 0) // because of uint
|
||||||
selected = chanlist.size() - 1;
|
selected = chanlist.size() - 1;
|
||||||
|
|
||||||
paintItem(prev_selected - liststart);
|
paintItem(prev_selected - liststart);
|
||||||
unsigned int oldliststart = liststart;
|
unsigned int oldliststart = liststart;
|
||||||
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); }
|
|
||||||
//paintHead();
|
|
||||||
}
|
|
||||||
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
|
|
||||||
{
|
|
||||||
unsigned int step = 0;
|
|
||||||
int prev_selected = selected;
|
|
||||||
|
|
||||||
step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
|
|
||||||
selected += step;
|
|
||||||
|
|
||||||
if(selected >= chanlist.size()) {
|
|
||||||
if (((chanlist.size() / listmaxshow) + 1) * listmaxshow == chanlist.size() + listmaxshow) // last page has full entries
|
|
||||||
selected = 0;
|
|
||||||
else
|
|
||||||
selected = ((step == listmaxshow) && (selected < (((chanlist.size() / listmaxshow)+1) * listmaxshow))) ? (chanlist.size() - 1) : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paintItem(prev_selected - liststart);
|
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
||||||
unsigned int oldliststart = liststart;
|
//paintHead();
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
}
|
||||||
if(oldliststart!=liststart)
|
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
|
||||||
paint();
|
{
|
||||||
else
|
unsigned int step = 0;
|
||||||
paintItem(selected - liststart);
|
int prev_selected = selected;
|
||||||
|
|
||||||
|
step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
|
||||||
|
selected += step;
|
||||||
|
|
||||||
|
if(selected >= chanlist.size()) {
|
||||||
|
if (((chanlist.size() / listmaxshow) + 1) * listmaxshow == chanlist.size() + listmaxshow) // last page has full entries
|
||||||
|
selected = 0;
|
||||||
|
else
|
||||||
|
selected = ((step == listmaxshow) && (selected < (((chanlist.size() / listmaxshow)+1) * listmaxshow))) ? (chanlist.size() - 1) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
paintItem(prev_selected - liststart);
|
||||||
|
unsigned int oldliststart = liststart;
|
||||||
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
|
if(oldliststart!=liststart)
|
||||||
|
paint();
|
||||||
|
else {
|
||||||
|
paintItem(selected - liststart);
|
||||||
|
showChannelLogo();
|
||||||
|
}
|
||||||
|
|
||||||
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
||||||
//paintHead();
|
//paintHead();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((msg == (neutrino_msg_t)g_settings.key_bouquet_up) && (bouquetList != NULL)) {
|
else if ((msg == (neutrino_msg_t)g_settings.key_bouquet_up) && (bouquetList != NULL)) {
|
||||||
if (bouquetList->Bouquets.size() > 0) {
|
if (bouquetList->Bouquets.size() > 0) {
|
||||||
@@ -641,21 +645,21 @@ int CChannelList::show()
|
|||||||
}
|
}
|
||||||
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
||||||
if (this->historyMode) { //numeric zap
|
if (this->historyMode) { //numeric zap
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case CRCInput::RC_0:selected = 0;break;
|
case CRCInput::RC_0:selected = 0;break;
|
||||||
case CRCInput::RC_1:selected = 1;break;
|
case CRCInput::RC_1:selected = 1;break;
|
||||||
case CRCInput::RC_2:selected = 2;break;
|
case CRCInput::RC_2:selected = 2;break;
|
||||||
case CRCInput::RC_3:selected = 3;break;
|
case CRCInput::RC_3:selected = 3;break;
|
||||||
case CRCInput::RC_4:selected = 4;break;
|
case CRCInput::RC_4:selected = 4;break;
|
||||||
case CRCInput::RC_5:selected = 5;break;
|
case CRCInput::RC_5:selected = 5;break;
|
||||||
case CRCInput::RC_6:selected = 6;break;
|
case CRCInput::RC_6:selected = 6;break;
|
||||||
case CRCInput::RC_7:selected = 7;break;
|
case CRCInput::RC_7:selected = 7;break;
|
||||||
case CRCInput::RC_8:selected = 8;break;
|
case CRCInput::RC_8:selected = 8;break;
|
||||||
case CRCInput::RC_9:selected = 9;break;
|
case CRCInput::RC_9:selected = 9;break;
|
||||||
};
|
};
|
||||||
zapOnExit = true;
|
zapOnExit = true;
|
||||||
loop = false;
|
loop = false;
|
||||||
}
|
}
|
||||||
else if(g_settings.sms_channel) {
|
else if(g_settings.sms_channel) {
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
unsigned char smsKey = 0;
|
unsigned char smsKey = 0;
|
||||||
@@ -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
|
||||||
|
@@ -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 );
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user