port rounded corner code from tuxbox CVSuse getScreenStartX(),getScreenStartY(),h_max(),w_max() routines

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@87 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2009-12-17 09:58:55 +00:00
parent dfe40f9833
commit 49e009134b
11 changed files with 1109 additions and 1077 deletions

View File

@@ -1,21 +1,26 @@
/*
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.cpp,v 1.3 2004/03/17 22:56:08 rasc Exp $
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.cpp,v 1.4 2009/12/15 09:42:59 dbt Exp $
*
* -- some odd module to calc max. screen usage of an menue
* -- this should be somewhere else (neutrino needs redesign)
*
* (C) 2004 by rasc
*
*
*/
#include <config.h>
#include "global.h"
#include "driver/screen_max.h"
// -- this is a simple odd class provided for 'static' usage
// -- to calculate max. usage of a preferred menue size (x,y)
// -- this is due to 16:9 TV zoom functions, which are cutting menues.
// -- so using this function will make menues to obey max. screen settings.
//
//
// usage: e.g. try to paint menue h: 500 w, 400 (but screen is limited
// to (450 x 420)), functions will return 450 and 400
// the _add factor is for boundary...
@@ -24,6 +29,7 @@
//
// 2004-03-17 rasc
int w_max (int w_size, int w_add)
{
int dw;
@@ -37,6 +43,7 @@ int w_max (int w_size, int w_add)
return ret;
}
int h_max (int h_size, int h_add)
{
int dh;
@@ -49,3 +56,21 @@ int h_max (int h_size, int h_add)
return ret;
}
//some helpers to get x and y screen values vor menus and windows
int getScreenStartX (int width)
{
int w = width;
return (((g_settings.screen_EndX- g_settings.screen_StartX)-w) / 2) + g_settings.screen_StartX;
}
int getScreenStartY (int height)
{
int y = height;
return (((g_settings.screen_EndY- g_settings.screen_StartY)-y) / 2) + g_settings.screen_StartY;
}

View File

@@ -1,5 +1,5 @@
/*
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.h,v 1.1 2004/03/17 21:30:51 rasc Exp $
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.h,v 1.2 2009/12/15 09:42:59 dbt Exp $
*
*
* This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,8 @@
int w_max (int w_size, int w_add);
int h_max (int h_size, int h_add);
int getScreenStartX(int width);
int getScreenStartY(int height);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -35,7 +35,7 @@
#include <neutrino.h>
#include <system/settings.h>
#include <driver/screen_max.h>
#include <gui/widget/messagebox.h>
#include <gui/widget/hintbox.h>
#include <gui/widget/stringinput.h>
@@ -71,8 +71,8 @@ int CBookmarkManager::addBookmark (CBookmark inBookmark) {
bookmarksmodified = true;
return 0;
}
// TODO:show dialog to delete old bookmark
return -1;
// TODO:show dialog to delete old bookmark
return -1;
}
//------------------------------------------------------------------------
@@ -81,12 +81,12 @@ inline int CBookmarkManager::createBookmark (const std::string & name, const std
}
int CBookmarkManager::createBookmark (const std::string & url, const std::string & time) {
char bookmarkname[26]="";
CStringInputSMS bookmarkname_input(LOCALE_MOVIEPLAYER_BOOKMARKNAME, bookmarkname, 25, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-_");
bookmarkname_input.exec(NULL, "");
// TODO: return -1 if no name was entered
if(!strlen(bookmarkname)) return -1;
return createBookmark(std::string(bookmarkname), url, time);
char bookmarkname[26]="";
CStringInputSMS bookmarkname_input(LOCALE_MOVIEPLAYER_BOOKMARKNAME, bookmarkname, 25, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-_");
bookmarkname_input.exec(NULL, "");
// TODO: return -1 if no name was entered
if (!strlen(bookmarkname)) return -1;
return createBookmark(std::string(bookmarkname), url, time);
}
//------------------------------------------------------------------------
@@ -126,7 +126,7 @@ void CBookmarkManager::readBookmarkFile() {
{
char bookmarkstring[BOOKMARKSTRINGLENGTH];
strcpy(bookmarkstring, BOOKMARKSTRING);
bookmarksmodified = false;
bookmarks.clear();
@@ -146,7 +146,7 @@ void CBookmarkManager::readBookmarkFile() {
tmp = bookmarkstring;
tmp += "time";
std::string bookmarktime = bookmarkfile.getString(tmp, "");
bookmarks.push_back(CBookmark(bookmarkname, bookmarkurl, bookmarktime));
bookmarkstring[BOOKMARKSTRINGMODIFICATIONPOINT]++;
@@ -162,7 +162,7 @@ void CBookmarkManager::writeBookmarkFile() {
strcpy(bookmarkstring, BOOKMARKSTRING);
printf("CBookmarkManager: Writing bookmark file\n");
for (std::vector<CBookmark>::const_iterator it = bookmarks.begin(); it != bookmarks.end(); it++)
{
std::string tmp = bookmarkstring;
@@ -191,7 +191,7 @@ CBookmarkManager::CBookmarkManager() : bookmarkfile ('\t')
//------------------------------------------------------------------------
CBookmarkManager::~CBookmarkManager () {
flush();
flush();
}
//------------------------------------------------------------------------
@@ -203,68 +203,65 @@ int CBookmarkManager::getBookmarkCount(void) const {
//------------------------------------------------------------------------
int CBookmarkManager::getMaxBookmarkCount(void) const {
return MAXBOOKMARKS;
return MAXBOOKMARKS;
}
//------------------------------------------------------------------------
void CBookmarkManager::flush() {
if (bookmarksmodified) {
writeBookmarkFile();
}
if (bookmarksmodified) {
writeBookmarkFile();
}
}
//------------------------------------------------------------------------
const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
{
if(parent)
if (parent)
{
parent->hide();
}
frameBuffer = CFrameBuffer::getInstance();
visible = false;
selected = 0;
// Max
width = 720;
if(g_settings.screen_EndX-g_settings.screen_StartX < width)
width=g_settings.screen_EndX-g_settings.screen_StartX-10;
width = w_max( 720, 10 );
buttonHeight = 25;
theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
x=getScreenStartX( width );
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-( height+ info_height) ) / 2) + g_settings.screen_StartY;
listmaxshow = (height-theight-0)/(fheight*2);
liststart = 0;
height = (g_settings.screen_EndY-g_settings.screen_StartY)-(info_height+50);
listmaxshow = (height-theight-0)/(fheight*2);
height = theight+0+listmaxshow*fheight*2; // recalc height
if(bookmarks.size() < listmaxshow)
if (bookmarks.size() < listmaxshow)
{
listmaxshow=bookmarks.size();
height = theight+0+listmaxshow*fheight*2; // recalc height
}
if(selected==bookmarks.size() && !(bookmarks.empty()))
if (selected==bookmarks.size() && !(bookmarks.empty()))
{
selected=bookmarks.size()-1;
liststart = (selected/listmaxshow)*listmaxshow;
}
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-( height+ info_height) ) / 2) + g_settings.screen_StartY;
int res = -1;
unsigned long long timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
uint32_t msg; uint32_t data;
uint32_t msg;
uint32_t data;
bool loop=true;
bool update=true;
while(loop)
while (loop)
{
if(update)
if (update)
{
hide();
update=false;
@@ -272,11 +269,11 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
}
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd );
if( msg <= CRCInput::RC_MaxRC )
if ( msg <= CRCInput::RC_MaxRC )
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
if( ( msg == CRCInput::RC_timeout ) ||
( msg == CRCInput::RC_home) )
if ( ( msg == CRCInput::RC_timeout ) ||
( msg == CRCInput::RC_home) )
{ //Exit after timeout or cancel key
res = -1;
loop=false;
@@ -284,7 +281,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
else if ((msg == CRCInput::RC_up) && !(bookmarks.empty()))
{
int prevselected=selected;
if(selected==0)
if (selected==0)
{
selected = bookmarks.size()-1;
}
@@ -293,7 +290,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
paint();
}
@@ -309,7 +306,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
paint();
}
@@ -320,36 +317,36 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
}
else if ((msg == CRCInput::RC_ok) && !(bookmarks.empty()))
{
res = selected;
loop=false;
res = selected;
loop=false;
}
else if((msg == CRCInput::RC_red) && !(bookmarks.empty()))
else if ((msg == CRCInput::RC_red) && !(bookmarks.empty()))
{
removeBookmark(selected);
update=true;
}
else if((msg==CRCInput::RC_yellow) && !(bookmarks.empty()))
else if ((msg==CRCInput::RC_yellow) && !(bookmarks.empty()))
{
renameBookmark(selected);
update=true;
}
else if((msg==CRCInput::RC_blue)||(msg==CRCInput::RC_green)||
(CRCInput::isNumeric(msg)) )
else if ((msg==CRCInput::RC_blue)||(msg==CRCInput::RC_green)||
(CRCInput::isNumeric(msg)) )
{
//Ignore
}
else if(msg==CRCInput::RC_setup)
else if (msg==CRCInput::RC_setup)
{
res=-1;
loop=false;
}
else if( msg == CRCInput::RC_help )
else if ( msg == CRCInput::RC_help )
{
// TODO Add Help
}
else
{
if( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
{
loop = false;
res = menu_return::RETURN_EXIT_ALL;
@@ -368,7 +365,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
void CBookmarkManager::paintItem(int pos)
{
int ypos = y+ theight+0 + pos*fheight*2;
uint8_t color;
fb_pixel_t bgcolor;
@@ -390,20 +387,20 @@ void CBookmarkManager::paintItem(int pos)
}
int real_width=width;
if(bookmarks.size()>listmaxshow)
if (bookmarks.size()>listmaxshow)
{
real_width-=15; //scrollbar
}
frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor);
if(liststart+pos<bookmarks.size())
if (liststart+pos<bookmarks.size())
{
CBookmark theBookmark = bookmarks[liststart+pos];
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, real_width-10, theBookmark.getName(), color, fheight, true); // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, real_width-10, theBookmark.getUrl(), color, fheight, true); // UTF-8
// LCD Display
if(liststart+pos==selected)
if (liststart+pos==selected)
{
CVFD::getInstance()->showMenuText(0, theBookmark.getName(), -1, true); // UTF-8
CVFD::getInstance()->showMenuText(1, theBookmark.getUrl(), -1, true); // UTF-8
@@ -415,7 +412,7 @@ void CBookmarkManager::paintItem(int pos)
void CBookmarkManager::hide()
{
if(visible)
if (visible)
{
frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5);
visible = false;
@@ -424,7 +421,7 @@ void CBookmarkManager::hide()
//------------------------------------------------------------------------
void CBookmarkManager::paintHead()
{
{
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0);
frameBuffer->paintIcon("bookmarkmanager.raw",x+5,y+4);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+35,y+theight+0, width- 45, g_Locale->getText(LOCALE_BOOKMARKMANAGER_NAME), COL_MENUHEAD, 0, true); // UTF-8
@@ -447,7 +444,7 @@ void CBookmarkManager::paintFoot()
if (bookmarks.empty()) {
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+24 - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR, 0, true); // UTF-8
}
}
else
{
::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height + 4, ButtonWidth, 2, BookmarkmanagerButtons);
@@ -466,12 +463,12 @@ void CBookmarkManager::paint()
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_BOOKMARKMANAGER_NAME));
paintHead();
for(unsigned int count=0;count<listmaxshow;count++)
for (unsigned int count=0; count<listmaxshow; count++)
{
paintItem(count);
}
if(bookmarks.size()>listmaxshow)
if (bookmarks.size()>listmaxshow)
{
int ypos = y+ theight;
int sb = 2*fheight* listmaxshow;

View File

@@ -61,10 +61,9 @@ CDBoxInfoWidget::CDBoxInfoWidget()
// height = hheight+13*mheight+ 10;
width = w_max (600, 0);
height = h_max (hheight+14*mheight+ 10, 0);
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-height) / 2) + g_settings.screen_StartY;
x=getScreenStartX( width );
y=getScreenStartY( height );
}
@@ -104,16 +103,16 @@ void CDBoxInfoWidget::paint()
int power = 0;
int is_val = 0xdeadbabe;
int fp_ver = 0;
int fp = open("/dev/dbox/fp0", O_RDWR);
if(fp > 0) {
if (fp > 0) {
fp_ver = ioctl(fp, FP_IOCTL_GETID);
if(fp_ver < 0) fp_ver = 0;
if (fp_ver < 0) fp_ver = 0;
ioctl(fp, FP_IOCTL_UPGRADE_CTRL, &is_val);
if(is_val != 1) is_val = 0;
if (is_val != 1) is_val = 0;
ioctl(fp, FP_IOCTL_GET_LNB_CURRENT, &power);
close(fp);
}
}
else is_val = 0;
#endif
char buf[256];
@@ -123,12 +122,12 @@ void CDBoxInfoWidget::paint()
} else {
fgets(buf,255,fd);
while(!feof(fd)) {
if(fgets(buf,255,fd)!=NULL) {
while (!feof(fd)) {
if (fgets(buf,255,fd)!=NULL) {
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, buf, COL_MENUCONTENT);
ypos+= mheight;
i++;
if(i > 6) break;
if (i > 6) break;
}
}
fclose(fd);
@@ -152,9 +151,9 @@ void CDBoxInfoWidget::paint()
sysinfo(&info);
sprintf( ubuf, "%2d:%02d%s up ",
current_time->tm_hour%12 ? current_time->tm_hour%12 : 12,
current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am");
sprintf( ubuf, "%2d:%02d%s up ",
current_time->tm_hour%12 ? current_time->tm_hour%12 : 12,
current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am");
strcat(sbuf, ubuf);
updays = (int) info.uptime / (60*60*24);
if (updays) {
@@ -164,16 +163,16 @@ void CDBoxInfoWidget::paint()
upminutes = (int) info.uptime / 60;
uphours = (upminutes / 60) % 24;
upminutes %= 60;
if(uphours)
if (uphours)
sprintf(ubuf,"%2d:%02d, ", uphours, upminutes);
else
sprintf(ubuf,"%d min, ", upminutes);
strcat(sbuf, ubuf);
sprintf(ubuf, "load: %ld.%02ld, %ld.%02ld, %ld.%02ld\n",
LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]),
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
sprintf(ubuf, "load: %ld.%02ld, %ld.%02ld, %ld.%02ld\n",
LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]),
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
strcat(sbuf, ubuf);
ypos+= mheight/2;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, sbuf, COL_MENUCONTENT);
@@ -184,24 +183,24 @@ void CDBoxInfoWidget::paint()
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, ubuf, COL_MENUCONTENT);
ypos+= mheight;
struct statfs s;
//long blocks_used;
//long blocks_percent_used;
struct statfs s;
//long blocks_used;
//long blocks_percent_used;
if (::statfs("/var", &s) == 0) {
//printf("/var filesystem total %ldKb, free %ldKb\n", (long)s.f_blocks*s.f_bsize/1024, (long)s.f_bfree*s.f_bsize/1024);
sprintf(ubuf, "/var filesystem total %ldKb, free %ldKb", (long)s.f_blocks*s.f_bsize/1024, (long)s.f_bfree*s.f_bsize/1024);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, ubuf, COL_MENUCONTENT);
ypos+= mheight;
}
else
perror("/var statfs");
if (::statfs("/hdd", &s) == 0) {
if (::statfs("/var", &s) == 0) {
//printf("/var filesystem total %ldKb, free %ldKb\n", (long)s.f_blocks*s.f_bsize/1024, (long)s.f_bfree*s.f_bsize/1024);
sprintf(ubuf, "/var filesystem total %ldKb, free %ldKb", (long)s.f_blocks*s.f_bsize/1024, (long)s.f_bfree*s.f_bsize/1024);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, ubuf, COL_MENUCONTENT);
ypos+= mheight;
}
else
perror("/var statfs");
if (::statfs("/hdd", &s) == 0) {
//printf("STATFS: type %lX free: %ld\n", s.f_type, s.f_bfree);
if( (s.f_type != (int) 0xEF53) && (s.f_type != (int) 0x52654973) && (s.f_type != (int) 0x6969) && (s.f_type != (int) 0xFF534D42) && (s.f_type != (int) 0x517B) && (s.f_type != (int) 0x58465342) )
return;
//printf("/hdd filesystem total %ldKb, free %ldKb\n", (long)(s.f_blocks/1024)*s.f_bsize, (long)(s.f_bfree/1024)*s.f_bsize);
sprintf(ubuf, "/hdd filesystem total %ldKb, free %ldKb", (long)(s.f_blocks/1024)*s.f_bsize, (long)(s.f_bfree/1024)*s.f_bsize);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, ubuf, COL_MENUCONTENT);
}
if ( (s.f_type != (int) 0xEF53) && (s.f_type != (int) 0x52654973) && (s.f_type != (int) 0x6969) && (s.f_type != (int) 0xFF534D42) && (s.f_type != (int) 0x517B) && (s.f_type != (int) 0x58465342) )
return;
//printf("/hdd filesystem total %ldKb, free %ldKb\n", (long)(s.f_blocks/1024)*s.f_bsize, (long)(s.f_bfree/1024)*s.f_bsize);
sprintf(ubuf, "/hdd filesystem total %ldKb, free %ldKb", (long)(s.f_blocks/1024)*s.f_bsize, (long)(s.f_bfree/1024)*s.f_bsize);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width, ubuf, COL_MENUCONTENT);
}
}

View File

@@ -135,7 +135,7 @@ void CEpgData::start()
topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight();
topboxheight = topheight + 6;
if(topboxheight < PIC_H) topboxheight = PIC_H;
if (topboxheight < PIC_H) topboxheight = PIC_H;
botheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight();
botboxheight = botheight + 6;
@@ -144,7 +144,7 @@ void CEpgData::start()
sb = medlinecount* medlineheight;
oy = botboxheight+medlinecount*medlineheight; // recalculate //FIXME
sy = (((g_settings.screen_EndY-g_settings.screen_StartY)-(oy- topboxheight) ) / 2) + g_settings.screen_StartY;
sy = getScreenStartY(oy- topboxheight);
toph = topboxheight;
}
@@ -154,7 +154,7 @@ void CEpgData::addTextToArray(const std::string & text) // UTF-8
if (text==" ")
{
emptyLineCount ++;
if(emptyLineCount<2)
if (emptyLineCount<2)
{
epgText.push_back(text);
}
@@ -174,29 +174,29 @@ void CEpgData::processTextToArray(std::string text) // UTF-8
text += ' ';
char* text_= (char*) text.c_str();
while(*text_!=0)
while (*text_!=0)
{
if ( (*text_==' ') || (*text_=='\n') || (*text_=='-') || (*text_=='.') )
{
// Houdini: if there is a newline (especially in the Premiere Portal EPGs) do not forget to add aktWord to aktLine
// after width check, if width check failes do newline, add aktWord to next line
// Houdini: if there is a newline (especially in the Premiere Portal EPGs) do not forget to add aktWord to aktLine
// after width check, if width check failes do newline, add aktWord to next line
// and "reinsert" i.e. reloop for the \n
if(*text_!='\n')
if (*text_!='\n')
aktWord += *text_;
// check the wordwidth - add to this line if size ok
int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true);
if((aktWordWidth+aktWidth)<(ox- 20- 15))
if ((aktWordWidth+aktWidth)<(ox- 20- 15))
{//space ok, add
aktWidth += aktWordWidth;
aktLine += aktWord;
if(*text_=='\n')
if (*text_=='\n')
{ //enter-handler
addTextToArray( aktLine );
aktLine = "";
aktWidth= 0;
}
}
aktWord = "";
}
else
@@ -205,9 +205,9 @@ void CEpgData::processTextToArray(std::string text) // UTF-8
aktLine = aktWord;
aktWidth = aktWordWidth;
aktWord = "";
// Houdini: in this case where we skipped \n and space is too low, exec newline and rescan \n
// Houdini: in this case where we skipped \n and space is too low, exec newline and rescan \n
// otherwise next word comes direct after aktLine
if(*text_=='\n')
if (*text_=='\n')
continue;
}
}
@@ -232,7 +232,7 @@ void CEpgData::showText( int startPos, int ypos )
frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0);
for(int i=startPos; i<textCount && i<startPos+medlinecount; i++,y+=medlineheight)
for (int i=startPos; i<textCount && i<startPos+medlinecount; i++,y+=medlineheight)
{
if ( i< info1_lines )
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i], COL_MENUCONTENT, 0, true); // UTF-8
@@ -393,13 +393,13 @@ const neutrino_locale_t * genre_sub_classes_list[10] =
bool CEpgData::hasFollowScreenings(const t_channel_id channel_id, const std::string & title) {
time_t curtime = time(NULL);
for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e )
{
if (e->startTime > curtime && e->eventID && e->description == title)
return true;
}
return false;
return false;
}
const char * GetGenre(const unsigned char contentClassification) // UTF-8
@@ -468,8 +468,8 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
int res = menu_return::RETURN_REPAINT;
static unsigned long long id;
static time_t startzeit;
if(a_startzeit)
if (a_startzeit)
startzeit=*a_startzeit;
id=a_id;
@@ -480,7 +480,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
//start();
frameBuffer->paintBoxRel(g_settings.screen_StartX, g_settings.screen_StartY, 50, height+5, COL_INFOBAR_PLUS_0);
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(g_settings.screen_StartX+10, g_settings.screen_StartY+height, 40, "-@-", COL_INFOBAR);
if(!bigFonts && g_settings.bigFonts) {
if (!bigFonts && g_settings.bigFonts) {
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR));
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR));
}
@@ -495,7 +495,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
evtlist.clear();
sectionsd_getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL, evtlist);
// Houdini added for Private Premiere EPG start sorted by start date/time 2005-08-15
sort(evtlist.begin(),evtlist.end(),sortByDateTime);
sort(evtlist.begin(),evtlist.end(),sortByDateTime);
frameBuffer->paintBackgroundBoxRel(g_settings.screen_StartX, g_settings.screen_StartY, 50, height+5);
}
@@ -516,10 +516,10 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
std::string::size_type nPosDot = epgData.info1.find('.');
if (std::string::npos != nPosDot) {
nPosDot += 2; // Skip dot and first blank
/* Houdini: changed for safty reason (crashes with some events at WDR regional)
if (nPosDot < epgData.info2.length()) { // Make sure we don't overrun the buffer
*/
if (nPosDot < epgData.info2.length() && nPosDot < epgData.info1.length()) { // Make sure we don't overrun the buffer
/* Houdini: changed for safty reason (crashes with some events at WDR regional)
if (nPosDot < epgData.info2.length()) { // Make sure we don't overrun the buffer
*/
if (nPosDot < epgData.info2.length() && nPosDot < epgData.info1.length()) { // Make sure we don't overrun the buffer
// Check if the stuff after the dot equals the beginning of info2
if (0 == epgData.info2.find(epgData.info1.substr(nPosDot, epgData.info1.length() - nPosDot))) {
@@ -528,7 +528,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
}
}
}
// Compare strings normally if not positively found to be equal before
// Compare strings normally if not positively found to be equal before
if (false == bHide && false == (std::string::npos == epgData.info2.find(epgData.info1))) {
bHide = true;
}
@@ -548,7 +548,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
// 21.07.2005 - rainerk
// Show extended information
if(0 != epgData.itemDescriptions.size() && 0 != epgData.items.size()) {
if (0 != epgData.itemDescriptions.size() && 0 != epgData.items.size()) {
char line[256];
std::vector<std::string>::iterator description;
std::vector<std::string>::iterator item;
@@ -606,23 +606,23 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
// show Timer Event Buttons
showTimerEventBar (true);
//show Content&Component for Dolby & 16:9
CSectionsdClient::ComponentTagList tags;
//show Content&Component for Dolby & 16:9
CSectionsdClient::ComponentTagList tags;
//if ( g_Sectionsd->getComponentTagsUniqueKey( epgData.eventID, tags ) )
if ( sectionsd_getComponentTagsUniqueKey( epgData.eventID, tags ) )
{
for (unsigned int i=0; i< tags.size(); i++)
{
if( tags[i].streamContent == 1 && (tags[i].componentType == 2 || tags[i].componentType == 3) )
{
frameBuffer->paintIcon("16_9.raw" ,ox+sx-(ICON_LARGE_WIDTH+2)-(ICON_LARGE_WIDTH+2),sy + oy+5 );
}
else if( tags[i].streamContent == 2 && tags[i].componentType == 5 )
{
frameBuffer->paintIcon("dd.raw", ox+sx-(ICON_LARGE_WIDTH+2), sy + oy+5);
}
}
}
{
for (unsigned int i=0; i< tags.size(); i++)
{
if ( tags[i].streamContent == 1 && (tags[i].componentType == 2 || tags[i].componentType == 3) )
{
frameBuffer->paintIcon("16_9.raw" ,ox+sx-(ICON_LARGE_WIDTH+2)-(ICON_LARGE_WIDTH+2),sy + oy+5 );
}
else if ( tags[i].streamContent == 2 && tags[i].componentType == 5 )
{
frameBuffer->paintIcon("dd.raw", ox+sx-(ICON_LARGE_WIDTH+2), sy + oy+5);
}
}
}
//show progressbar
if ( epg_done!= -1 )
@@ -656,7 +656,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
unsigned long long timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
while(loop)
while (loop)
{
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd );
@@ -664,192 +664,192 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
switch ( msg )
{
case NeutrinoMessages::EVT_TIMER:
if (data == g_InfoViewer->lcdUpdateTimer) {
GetEPGData(channel_id, id, &startzeit );
if ( epg_done!= -1 ) {
int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1);
timescale->reset();
timescale->paint(pbx+2, sy+oy-height+2, epg_done);
}
case NeutrinoMessages::EVT_TIMER:
if (data == g_InfoViewer->lcdUpdateTimer) {
GetEPGData(channel_id, id, &startzeit );
if ( epg_done!= -1 ) {
int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1);
timescale->reset();
timescale->paint(pbx+2, sy+oy-height+2, epg_done);
}
CNeutrinoApp::getInstance()->handleMsg(msg, data);
break;
case NeutrinoMessages::EVT_CURRENTNEXT_EPG:
if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) {
show(channel_id);
showPos=0;
}
CNeutrinoApp::getInstance()->handleMsg(msg, data);
break;
case CRCInput::RC_left:
if (prev_id != 0)
{
frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT + 1);
}
CNeutrinoApp::getInstance()->handleMsg(msg, data);
break;
case NeutrinoMessages::EVT_CURRENTNEXT_EPG:
if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) {
show(channel_id);
showPos=0;
}
CNeutrinoApp::getInstance()->handleMsg(msg, data);
break;
case CRCInput::RC_left:
if (prev_id != 0)
{
frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT + 1);
show(channel_id, prev_id, &prev_zeit, false);
showPos=0;
}
break;
show(channel_id, prev_id, &prev_zeit, false);
showPos=0;
}
break;
case CRCInput::RC_right:
if (next_id != 0)
{
frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT + 1);
case CRCInput::RC_right:
if (next_id != 0)
{
frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT + 1);
show(channel_id, next_id, &next_zeit, false);
showPos=0;
}
break;
show(channel_id, next_id, &next_zeit, false);
showPos=0;
}
break;
case CRCInput::RC_down:
if(showPos+scrollCount<textCount)
{
showPos += scrollCount;
showText(showPos,textypos);
}
break;
case CRCInput::RC_down:
if (showPos+scrollCount<textCount)
{
showPos += scrollCount;
showText(showPos,textypos);
}
break;
case CRCInput::RC_up:
showPos -= scrollCount;
if(showPos<0)
showPos = 0;
else
showText(showPos,textypos);
break;
case CRCInput::RC_up:
showPos -= scrollCount;
if (showPos<0)
showPos = 0;
else
showText(showPos,textypos);
break;
// 31.05.2002 dirch record timer
case CRCInput::RC_red:
if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF))
{
//CTimerdClient timerdclient;
if(g_Timerd->isTimerdAvailable())
{
bool doRecord = true;
//char *recDir = g_settings.network_nfs_recordingdir;
strcpy(recDir, g_settings.network_nfs_recordingdir);
if (g_settings.recording_choose_direct_rec_dir == 2) {
CFileBrowser b;
b.Dir_Mode=true;
hide();
if (b.exec(g_settings.network_nfs_recordingdir)) {
strcpy(recDir, b.getSelectedFile()->Name.c_str());
} else
doRecord = false;
show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false);
}
else if (g_settings.recording_choose_direct_rec_dir == 1)
{
int id = -1;
CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,&id,NULL,g_settings.network_nfs_recordingdir);
if (recDirs.hasItem())
{
hide();
recDirs.exec(NULL,"");
show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false);
} else
{
printf("no network devices available\n");
}
if (id != -1)
strcpy(recDir, g_settings.network_nfs_local_dir[id]);
//recDir = g_settings.network_nfs_local_dir[id];
//else
//recDir = NULL;
}
//if (recDir != NULL)
if (doRecord)
{
if (g_Timerd->addRecordTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit + epgData.epg_times.dauer,
epgData.eventID, epgData.epg_times.startzeit,
epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ),
TIMERD_APIDS_CONF, true, recDir,false) == -1)
{
if(askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120),
epgData.epg_times.startzeit + epgData.epg_times.dauer))
{
g_Timerd->addRecordTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit + epgData.epg_times.dauer,
epgData.eventID, epgData.epg_times.startzeit,
epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ),
TIMERD_APIDS_CONF, true, recDir,true);
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
}
} else {
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
}
}
}
else
printf("timerd not available\n");
}
break;
// 31.05.2002 dirch zapto timer
case CRCInput::RC_yellow:
case CRCInput::RC_red:
if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF))
{
//CTimerdClient timerdclient;
if(g_Timerd->isTimerdAvailable())
if (g_Timerd->isTimerdAvailable())
{
g_Timerd->addZaptoTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit - ANNOUNCETIME, 0,
epgData.eventID, epgData.epg_times.startzeit, 0);
ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
bool doRecord = true;
//char *recDir = g_settings.network_nfs_recordingdir;
strcpy(recDir, g_settings.network_nfs_recordingdir);
if (g_settings.recording_choose_direct_rec_dir == 2) {
CFileBrowser b;
b.Dir_Mode=true;
hide();
if (b.exec(g_settings.network_nfs_recordingdir)) {
strcpy(recDir, b.getSelectedFile()->Name.c_str());
} else
doRecord = false;
show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false);
}
else if (g_settings.recording_choose_direct_rec_dir == 1)
{
int id = -1;
CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,&id,NULL,g_settings.network_nfs_recordingdir);
if (recDirs.hasItem())
{
hide();
recDirs.exec(NULL,"");
show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false);
} else
{
printf("no network devices available\n");
}
if (id != -1)
strcpy(recDir, g_settings.network_nfs_local_dir[id]);
//recDir = g_settings.network_nfs_local_dir[id];
//else
//recDir = NULL;
}
//if (recDir != NULL)
if (doRecord)
{
if (g_Timerd->addRecordTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit + epgData.epg_times.dauer,
epgData.eventID, epgData.epg_times.startzeit,
epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ),
TIMERD_APIDS_CONF, true, recDir,false) == -1)
{
if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120),
epgData.epg_times.startzeit + epgData.epg_times.dauer))
{
g_Timerd->addRecordTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit + epgData.epg_times.dauer,
epgData.eventID, epgData.epg_times.startzeit,
epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ),
TIMERD_APIDS_CONF, true, recDir,true);
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
}
} else {
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
}
}
}
else
printf("timerd not available\n");
break;
}
break;
case CRCInput::RC_info:
case CRCInput::RC_help:
bigFonts = bigFonts ? false : true;
frameBuffer->paintBackgroundBox (sx, sy- toph, sx+ ox, sy+ oy);
showTimerEventBar (false);
start();
// 31.05.2002 dirch zapto timer
case CRCInput::RC_yellow:
{
//CTimerdClient timerdclient;
if (g_Timerd->isTimerdAvailable())
{
g_Timerd->addZaptoTimerEvent(channel_id,
epgData.epg_times.startzeit,
epgData.epg_times.startzeit - ANNOUNCETIME, 0,
epgData.eventID, epgData.epg_times.startzeit, 0);
ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
}
else
printf("timerd not available\n");
break;
}
case CRCInput::RC_info:
case CRCInput::RC_help:
bigFonts = bigFonts ? false : true;
frameBuffer->paintBackgroundBox (sx, sy- toph, sx+ ox, sy+ oy);
showTimerEventBar (false);
start();
//printf("bigFonts %d\n", bigFonts);
if(bigFonts)
{
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR));
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR));
}else
{
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIG_FONT_FAKTOR));
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR));
}
g_settings.bigFonts = bigFonts;
show(channel_id, id, &startzeit, false);
showPos=0;
break;
if (bigFonts)
{
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR));
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR));
} else
{
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIG_FONT_FAKTOR));
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR));
}
g_settings.bigFonts = bigFonts;
show(channel_id, id, &startzeit, false);
showPos=0;
break;
case CRCInput::RC_ok:
case CRCInput::RC_timeout:
loop = false;
break;
case CRCInput::RC_favorites:
case CRCInput::RC_sat:
g_RCInput->postMsg (msg, 0);
loop = false;
break;
case CRCInput::RC_ok:
case CRCInput::RC_timeout:
loop = false;
break;
case CRCInput::RC_favorites:
case CRCInput::RC_sat:
g_RCInput->postMsg (msg, 0);
loop = false;
break;
default:
// konfigurierbare Keys handlen...
if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)
default:
// konfigurierbare Keys handlen...
if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)
loop = false;
else
{
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
{
loop = false;
else
{
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
{
loop = false;
res = menu_return::RETURN_EXIT_ALL;
}
res = menu_return::RETURN_EXIT_ALL;
}
}
}
}
hide();
@@ -859,7 +859,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
void CEpgData::hide()
{
// 2004-09-10 rasc (bugfix, scale large font settings back to normal)
// 2004-09-10 rasc (bugfix, scale large font settings back to normal)
if (bigFonts) {
bigFonts = false;
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() / BIG_FONT_FAKTOR));
@@ -867,7 +867,7 @@ void CEpgData::hide()
}
frameBuffer->paintBackgroundBox (sx, sy- toph, sx+ ox, sy+ oy);
showTimerEventBar (false);
showTimerEventBar (false);
}
bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata);
@@ -898,7 +898,7 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, unsigned long long id,
reformatExtendedEvents("Guests", g_Locale->getText(LOCALE_EPGEXTENDED_GUESTS), false, epgData);
reformatExtendedEvents("Presenter", g_Locale->getText(LOCALE_EPGEXTENDED_PRESENTER), false, epgData);
}
struct tm *pStartZeit = localtime(&(epgData.epg_times).startzeit);
char temp[11];
strftime( temp, sizeof(temp), "%d.%m.%Y", pStartZeit);
@@ -924,39 +924,39 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, unsigned long long id,
void CEpgData::GetPrevNextEPGData( unsigned long long id, time_t* startzeit )
{
prev_id= 0;
next_id= 0;
unsigned int i;
prev_id= 0;
next_id= 0;
unsigned int i;
for ( i= 0; i< evtlist.size(); i++ )
{
//printf("%d %llx/%llx - %x %x\n", i, evtlist[i].eventID, id, evtlist[i].startTime, *startzeit);
if ( ( evtlist[i].eventID == id ) && ( evtlist[i].startTime == *startzeit ) )
{
if ( i > 0 )
{
prev_id= evtlist[i- 1].eventID;
prev_zeit= evtlist[i- 1].startTime;
}
if ( i < ( evtlist.size()- 1 ) )
{
next_id= evtlist[i+ 1].eventID;
next_zeit= evtlist[i+ 1].startTime;
}
break;
}
}
/* Houdini: dirty RTL double event workaround, if prev/next event has same starttime as actual event skip it */
if ((prev_zeit == *startzeit) && ((i-1) > 0))
{
prev_id = evtlist[i- 2].eventID;
prev_zeit = evtlist[i- 2].startTime;
}
if ((next_zeit == *startzeit) && ((i+1) < (evtlist.size()- 1)))
{
next_id = evtlist[i+ 2].eventID;
next_zeit = evtlist[i+ 2].startTime;
}
for ( i= 0; i< evtlist.size(); i++ )
{
//printf("%d %llx/%llx - %x %x\n", i, evtlist[i].eventID, id, evtlist[i].startTime, *startzeit);
if ( ( evtlist[i].eventID == id ) && ( evtlist[i].startTime == *startzeit ) )
{
if ( i > 0 )
{
prev_id= evtlist[i- 1].eventID;
prev_zeit= evtlist[i- 1].startTime;
}
if ( i < ( evtlist.size()- 1 ) )
{
next_id= evtlist[i+ 1].eventID;
next_zeit= evtlist[i+ 1].startTime;
}
break;
}
}
/* Houdini: dirty RTL double event workaround, if prev/next event has same starttime as actual event skip it */
if ((prev_zeit == *startzeit) && ((i-1) > 0))
{
prev_id = evtlist[i- 2].eventID;
prev_zeit = evtlist[i- 2].startTime;
}
if ((next_zeit == *startzeit) && ((i+1) < (evtlist.size()- 1)))
{
next_id = evtlist[i+ 2].eventID;
next_zeit = evtlist[i+ 2].startTime;
}
}
@@ -971,22 +971,22 @@ void CEpgData::GetPrevNextEPGData( unsigned long long id, time_t* startzeit )
int CEpgData::FollowScreenings (const t_channel_id channel_id, const std::string & title)
{
CChannelEventList::iterator e;
time_t curtime;
struct tm *tmStartZeit;
std::string screening_dates,screening_nodual;
int count;
char tmpstr[256];
CChannelEventList::iterator e;
time_t curtime;
struct tm *tmStartZeit;
std::string screening_dates,screening_nodual;
int count;
char tmpstr[256];
count = 0;
count = 0;
screening_dates = screening_nodual = "";
// alredy read: evtlist = g_Sectionsd->getEventsServiceKey( channel_id&0xFFFFFFFFFFFFULL );
curtime = time(NULL);
curtime = time(NULL);
for ( e= evtlist.begin(); e != evtlist.end(); ++e )
{
if (e->startTime <= curtime) continue;
if (e->startTime <= curtime) continue;
if (! e->eventID) continue;
if (e->description == title) {
count++;
@@ -1004,9 +1004,9 @@ int CEpgData::FollowScreenings (const t_channel_id channel_id, const std::string
strftime(tmpstr, sizeof(tmpstr), ". %H:%M ", tmStartZeit );
screening_dates += tmpstr;
if (screening_dates != screening_nodual){
screening_nodual=screening_dates;
processTextToArray(screening_dates ); // UTF-8
if (screening_dates != screening_nodual) {
screening_nodual=screening_dates;
processTextToArray(screening_dates ); // UTF-8
}
}
}

View File

@@ -66,8 +66,8 @@ void CImageInfo::Init(void)
width = frameBuffer->getScreenWidth() - 10;
height = frameBuffer->getScreenHeight() - 10;
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-height) / 2) + g_settings.screen_StartY;
x=getScreenStartX( width );
y=getScreenStartY( height );
}
CImageInfo::~CImageInfo()
@@ -78,7 +78,7 @@ CImageInfo::~CImageInfo()
int CImageInfo::exec(CMenuTarget* parent, const std::string &)
{
if (parent)
parent->hide();
parent->hide();
width = frameBuffer->getScreenWidth() - 10;
height = frameBuffer->getScreenHeight() - 10;
@@ -87,8 +87,8 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &)
paint();
//paint_pig( width-170, y, 215, 170);
paint_pig (width - width/3 - 10, y + 10, width/3, height/3);
//paint_pig( width-170, y, 215, 170);
paint_pig (width - width/3 - 10, y + 10, width/3, height/3);
neutrino_msg_t msg;
@@ -123,8 +123,8 @@ void CImageInfo::hide()
void CImageInfo::paint_pig(int x, int y, int w, int h)
{
//frameBuffer->paintBoxRel(x,y,w,h, COL_BACKGROUND);
frameBuffer->paintBackgroundBoxRel(x,y,w,h);
//frameBuffer->paintBoxRel(x,y,w,h, COL_BACKGROUND);
frameBuffer->paintBackgroundBoxRel(x,y,w,h);
videoDecoder->Pig(x, y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true));
}
@@ -140,7 +140,7 @@ void CImageInfo::paint()
{
const char * head_string;
char imagedate[18] = "";
int xpos = x+10;
int xpos = x+10;
ypos = y+5;

View File

@@ -2,7 +2,7 @@
Neutrino-GUI - DBoxII-Project
MP3Player by Dirch
Homepage: http://dbox.cyberphoria.org/
Kommentar:
@@ -56,6 +56,7 @@
#include <gui/widget/helpbox.h>
#include <gui/widget/stringinput.h>
#include <driver/screen_max.h>
#include <system/settings.h>
@@ -87,7 +88,7 @@ CPictureViewerGui::CPictureViewerGui()
selected = 0;
m_sort = FILENAME;
m_viewer = new CPictureViewer();
if(strlen(g_settings.network_nfs_picturedir)!=0)
if (strlen(g_settings.network_nfs_picturedir)!=0)
Path = g_settings.network_nfs_picturedir;
else
Path = "/";
@@ -112,13 +113,8 @@ CPictureViewerGui::~CPictureViewerGui()
int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
{
selected = 0;
width = 710;
height = 570;
if((g_settings.screen_EndX- g_settings.screen_StartX) < width)
width=(g_settings.screen_EndX- g_settings.screen_StartX);
if((g_settings.screen_EndY- g_settings.screen_StartY) < height)
height=(g_settings.screen_EndY- g_settings.screen_StartY);
width = w_max (710, 0);
height = h_max (570, 0);
sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
buttonHeight = std::min(25, sheight);
@@ -127,18 +123,18 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
listmaxshow = (height-theight-2*buttonHeight)/(fheight);
height = theight+2*buttonHeight+listmaxshow*fheight; // recalc height
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-height)/ 2) + g_settings.screen_StartY;
x=getScreenStartX( width );
y=getScreenStartY( height );
m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling);
m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY);
if(g_settings.video_Format == 3)
if (g_settings.video_Format == 3)
m_viewer->SetAspectRatio(16.0/9);
else
m_viewer->SetAspectRatio(4.0/3);
if(parent)
if (parent)
parent->hide();
// tell neutrino we're in pic_mode
@@ -146,7 +142,7 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
// remember last mode
m_LastMode=(CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap);
g_Sectionsd->setPauseScanning(true);
g_Sectionsd->setPauseScanning(true);
show();
@@ -159,7 +155,7 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
// Restore last mode
CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode );
// always exit all
// always exit all
return menu_return::RETURN_REPAINT;
}
@@ -179,29 +175,29 @@ int CPictureViewerGui::show()
bool loop=true;
bool update=true;
while(loop)
while (loop)
{
if(update)
if (update)
{
hide();
update=false;
paint();
}
if(m_state!=SLIDESHOW)
if (m_state!=SLIDESHOW)
timeout=50; // egal
else
{
timeout=(m_time+atoi(g_settings.picviewer_slide_time)-(long)time(NULL))*10;
if(timeout <0 )
if (timeout <0 )
timeout=1;
}
g_RCInput->getMsg( &msg, &data, timeout );
if( msg == CRCInput::RC_home)
if ( msg == CRCInput::RC_home)
{ //Exit after cancel key
if(m_state!=MENU)
if (m_state!=MENU)
{
endView();
update=true;
@@ -211,7 +207,7 @@ int CPictureViewerGui::show()
}
else if (msg == CRCInput::RC_timeout)
{
if(m_state == SLIDESHOW)
if (m_state == SLIDESHOW)
{
m_time=(long)time(NULL);
unsigned int next = selected + 1;
@@ -269,7 +265,7 @@ int CPictureViewerGui::show()
if ((m_state == MENU) && (!playlist.empty()))
{
int prevselected=selected;
if(selected==0)
if (selected==0)
{
selected = playlist.size()-1;
}
@@ -278,7 +274,7 @@ int CPictureViewerGui::show()
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
update=true;
}
@@ -297,12 +293,12 @@ int CPictureViewerGui::show()
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
update=true;
}
else
{
{
paintItem(selected - liststart);
}
}
@@ -326,7 +322,7 @@ int CPictureViewerGui::show()
}
}
}
else if(msg==CRCInput::RC_green)
else if (msg==CRCInput::RC_green)
{
if (m_state == MENU)
{
@@ -342,9 +338,9 @@ int CPictureViewerGui::show()
{
Path = filebrowser.getCurrentDir();
CFileList::const_iterator files = filebrowser.getSelectedFiles().begin();
for(; files != filebrowser.getSelectedFiles().end();files++)
for (; files != filebrowser.getSelectedFiles().end(); files++)
{
if(files->getType() == CFile::FILE_PICTURE)
if (files->getType() == CFile::FILE_PICTURE)
{
CPicture pic;
pic.Filename = files->Name;
@@ -352,7 +348,7 @@ int CPictureViewerGui::show()
pic.Name = tmp.substr(0,tmp.rfind('.'));
pic.Type = tmp.substr(tmp.rfind('.')+1);
struct stat statbuf;
if(stat(pic.Filename.c_str(),&statbuf) != 0)
if (stat(pic.Filename.c_str(),&statbuf) != 0)
printf("stat error");
pic.Date = statbuf.st_mtime;
playlist.push_back(pic);
@@ -368,7 +364,7 @@ int CPictureViewerGui::show()
update=true;
}
}
else if(msg==CRCInput::RC_yellow)
else if (msg==CRCInput::RC_yellow)
{
if (m_state == MENU && !playlist.empty())
{
@@ -377,7 +373,7 @@ int CPictureViewerGui::show()
update=true;
}
}
else if(msg==CRCInput::RC_blue)
else if (msg==CRCInput::RC_blue)
{
if ((m_state == MENU) && (!playlist.empty()))
{
@@ -385,13 +381,13 @@ int CPictureViewerGui::show()
view(selected);
m_state=SLIDESHOW;
} else {
if(m_state == SLIDESHOW)
if (m_state == SLIDESHOW)
m_state = VIEW;
else
m_state = SLIDESHOW;
}
}
else if(msg==CRCInput::RC_help)
else if (msg==CRCInput::RC_help)
{
if (m_state == MENU)
{
@@ -399,31 +395,31 @@ int CPictureViewerGui::show()
paint();
}
}
else if( msg == CRCInput::RC_1 )
{
else if ( msg == CRCInput::RC_1 )
{
if (m_state != MENU)
{
m_viewer->Zoom(2.0/3);
}
}
else if( msg == CRCInput::RC_2 )
{
else if ( msg == CRCInput::RC_2 )
{
if (m_state != MENU)
{
m_viewer->Move(0,-50);
}
}
else if( msg == CRCInput::RC_3 )
{
else if ( msg == CRCInput::RC_3 )
{
if (m_state != MENU)
{
m_viewer->Zoom(1.5);
}
}
else if( msg == CRCInput::RC_4 )
{
else if ( msg == CRCInput::RC_4 )
{
if (m_state != MENU)
{
m_viewer->Move(-50,0);
@@ -431,16 +427,16 @@ int CPictureViewerGui::show()
}
else if ( msg == CRCInput::RC_5 )
{
if(m_state==MENU)
if (m_state==MENU)
{
if (!playlist.empty())
{
if(m_sort==FILENAME)
if (m_sort==FILENAME)
{
m_sort=DATE;
std::sort(playlist.begin(),playlist.end(),comparePictureByDate);
}
else if(m_sort==DATE)
else if (m_sort==DATE)
{
m_sort=FILENAME;
std::sort(playlist.begin(),playlist.end(),comparePictureByFilename);
@@ -449,28 +445,28 @@ int CPictureViewerGui::show()
}
}
}
else if( msg == CRCInput::RC_6 )
{
else if ( msg == CRCInput::RC_6 )
{
if (m_state != MENU && playlist.empty())
{
m_viewer->Move(50,0);
}
}
else if( msg == CRCInput::RC_8 )
{
else if ( msg == CRCInput::RC_8 )
{
if (m_state != MENU && playlist.empty())
{
m_viewer->Move(0,50);
}
}
else if(msg==CRCInput::RC_0)
else if (msg==CRCInput::RC_0)
{
if (!playlist.empty())
view(selected, true);
}
else if(msg==CRCInput::RC_setup)
else if (msg==CRCInput::RC_setup)
{
if(m_state==MENU)
if (m_state==MENU)
{
CNFSSmallMenu nfsMenu;
nfsMenu.exec(this, "");
@@ -478,19 +474,19 @@ int CPictureViewerGui::show()
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD));
}
}
else if(msg == NeutrinoMessages::CHANGEMODE)
else if (msg == NeutrinoMessages::CHANGEMODE)
{
if((data & NeutrinoMessages::mode_mask) !=NeutrinoMessages::mode_pic)
if ((data & NeutrinoMessages::mode_mask) !=NeutrinoMessages::mode_pic)
{
loop = false;
m_LastMode=data;
}
}
else if(msg == NeutrinoMessages::RECORD_START ||
msg == NeutrinoMessages::ZAPTO ||
msg == NeutrinoMessages::STANDBY_ON ||
msg == NeutrinoMessages::SHUTDOWN ||
msg == NeutrinoMessages::SLEEPTIMER)
else if (msg == NeutrinoMessages::RECORD_START ||
msg == NeutrinoMessages::ZAPTO ||
msg == NeutrinoMessages::STANDBY_ON ||
msg == NeutrinoMessages::SHUTDOWN ||
msg == NeutrinoMessages::SLEEPTIMER)
{
// Exit for Record/Zapto Timers
if (m_state != MENU)
@@ -498,11 +494,11 @@ int CPictureViewerGui::show()
loop = false;
g_RCInput->postMsg(msg, data);
}
else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) {
else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) {
}
else
{
if( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
{
loop = false;
}
@@ -517,7 +513,7 @@ int CPictureViewerGui::show()
void CPictureViewerGui::hide()
{
if(visible) {
if (visible) {
frameBuffer->paintBackground();
visible = false;
}
@@ -552,7 +548,7 @@ void CPictureViewerGui::paintItem(int pos)
}
frameBuffer->paintBoxRel(x, ypos, width-15, fheight, bgcolor, liststart+pos == selected ? ROUND_RADIUS : 0);
if(liststart+pos<playlist.size())
if (liststart+pos<playlist.size())
{
std::string tmp = playlist[liststart+pos].Name;
tmp += " (";
@@ -578,7 +574,7 @@ void CPictureViewerGui::paintHead()
frameBuffer->paintIcon("mp3.raw",x+7,y+10);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+35,y+theight+0, width- 45, strCaption, COL_MENUHEAD, 0, true); // UTF-8
int ypos=y+0;
if(theight > 26)
if (theight > 26)
ypos = (theight-26) / 2 + y ;
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 60, ypos );
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- 30, ypos );
@@ -610,9 +606,9 @@ void CPictureViewerGui::paintFoot()
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+(height-buttonHeight)-3);
std::string tmp = g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER);
tmp += ' ';
if(m_sort==FILENAME)
if (m_sort==FILENAME)
tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_DATE);
else if(m_sort==DATE)
else if (m_sort==DATE)
tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_FILENAME);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8
@@ -634,7 +630,7 @@ void CPictureViewerGui::paint()
liststart = (selected/listmaxshow)*listmaxshow;
paintHead();
for(unsigned int count=0;count<listmaxshow;count++)
for (unsigned int count=0; count<listmaxshow; count++)
{
paintItem(count);
}
@@ -651,30 +647,30 @@ void CPictureViewerGui::paint()
paintFoot();
paintInfo();
visible = true;
}
void CPictureViewerGui::view(unsigned int index, bool unscaled)
{
selected=index;
CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str());
char timestring[19];
strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[index].Date));
//CVFD::getInstance()->showMenuText(1, timestring); //FIXME
if(unscaled)
if (unscaled)
m_viewer->DecodeImage(playlist[index].Filename, true, unscaled);
m_viewer->ShowImage(playlist[index].Filename, unscaled);
//Decode next
unsigned int next=selected+1;
if(next > playlist.size()-1)
if (next > playlist.size()-1)
next=0;
if(m_state==MENU)
if (m_state==MENU)
m_state=VIEW;
if(m_state==VIEW)
if (m_state==VIEW)
m_viewer->DecodeImage(playlist[next].Filename,true);
else
m_viewer->DecodeImage(playlist[next].Filename,false);
@@ -682,7 +678,7 @@ void CPictureViewerGui::view(unsigned int index, bool unscaled)
void CPictureViewerGui::endView()
{
if(m_state != MENU)
if (m_state != MENU)
m_state=MENU;
}

View File

@@ -54,6 +54,7 @@
#include <neutrino.h>
#include <plugins.h>
#include <driver/encoding.h>
#include <driver/screen_max.h>
#include <zapit/client/zapittools.h>
@@ -76,12 +77,8 @@ CPluginList::CPluginList(const neutrino_locale_t Name, const uint32_t listtype)
name = Name;
pluginlisttype = listtype;
selected = 0;
width = 500;
if(width>(g_settings.screen_EndX-g_settings.screen_StartX))
width=(g_settings.screen_EndX-g_settings.screen_StartX);
height = 526;
if((height+50)>(g_settings.screen_EndY-g_settings.screen_StartY))
height=(g_settings.screen_EndY-g_settings.screen_StartY) - 50; // 2*25 pixel frei
width = w_max( 500, 0 );
height = h_max( 526, 50 ); // 2*25 pixel frei
theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
//
fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMLARGE]->getHeight();
@@ -90,8 +87,8 @@ CPluginList::CPluginList(const neutrino_locale_t Name, const uint32_t listtype)
//
listmaxshow = (height-theight-0)/fheight;
height = theight+0+listmaxshow*fheight; // recalc height
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-height) / 2) + g_settings.screen_StartY;
x=getScreenStartX( width );
y=getScreenStartY( height );
liststart = 0;
}
@@ -310,16 +307,12 @@ void CPluginList::paintHead()
void CPluginList::paint()
{
hide();
width = 500;
if(width>(g_settings.screen_EndX-g_settings.screen_StartX))
width=(g_settings.screen_EndX-g_settings.screen_StartX);
height = 526;
if((height+50)>(g_settings.screen_EndY-g_settings.screen_StartY))
height=(g_settings.screen_EndY-g_settings.screen_StartY) - 50; // 2*25 pixel frei
width = w_max( 500, 0 );
height = h_max( 526, 50 ); // 2*25 pixel frei
listmaxshow = (height-theight-0)/fheight;
height = theight+0+listmaxshow*fheight; // recalc height
x=(((g_settings.screen_EndX- g_settings.screen_StartX)-width) / 2) + g_settings.screen_StartX;
y=(((g_settings.screen_EndY- g_settings.screen_StartY)-height) / 2) + g_settings.screen_StartY;
x=getScreenStartX( width );
y=getScreenStartY( height );
liststart = (selected/listmaxshow)*listmaxshow;

View File

@@ -52,13 +52,13 @@
#include <zapit/client/zapittools.h>
/* for alexW images with old drivers:
/* for alexW images with old drivers:
* #define USE_VBI_INTERFACE 1
*/
#ifdef USE_VBI_INTERFACE
#define AVIA_VBI_START_VTXT 1
#define AVIA_VBI_STOP_VTXT 2
#define AVIA_VBI_START_VTXT 1
#define AVIA_VBI_STOP_VTXT 2
#endif
#include <daemonc/remotecontrol.h>
@@ -76,9 +76,9 @@ bool CPlugins::plugin_exists(const std::string & filename)
int CPlugins::find_plugin(const std::string & filename)
{
for(int i = 0; i < (int) plugin_list.size();i++)
for (int i = 0; i < (int) plugin_list.size(); i++)
{
if( (filename.compare(plugin_list[i].filename) == 0) || (filename.compare(plugin_list[i].filename + ".cfg") == 0) )
if ( (filename.compare(plugin_list[i].filename) == 0) || (filename.compare(plugin_list[i].filename + ".cfg") == 0) )
return i;
}
return -1;
@@ -130,13 +130,13 @@ void CPlugins::scanDir(const char *dir)
}
// We do not check if new_plugin.pluginfile exists since .cfg in
// PLUGINDIR_VAR can overwrite settings in read only dir
// PLUGINDIR. This needs PLUGINDIR_VAR to be scanned at
// PLUGINDIR. This needs PLUGINDIR_VAR to be scanned at
// first -> .cfg in PLUGINDIR will be skipped since plugin
// already exists in the list.
// This behavior is used to make sure plugins can be disabled
// by creating a .cfg in PLUGINDIR_VAR (PLUGINDIR often is read only).
if(!plugin_exists(new_plugin.filename))
if (!plugin_exists(new_plugin.filename))
{
plugin_list.push_back(new_plugin);
number_of_plugins++;
@@ -175,7 +175,7 @@ bool CPlugins::parseCfg(plugin *plugin_data)
inFile.open(plugin_data->cfgfile.c_str());
while(linecount < 20 && getline(inFile, line[linecount++]));
while (linecount < 20 && getline(inFile, line[linecount++]));
plugin_data->fb = false;
plugin_data->rc = false;
@@ -244,9 +244,9 @@ bool CPlugins::parseCfg(plugin *plugin_data)
plugin_data->hide = ((parm == "1")?true:false);
}
else if (cmd == "needenigma")
{
reject = ((parm == "1")?true:false);
}
{
reject = ((parm == "1")?true:false);
}
}
@@ -276,9 +276,9 @@ PluginParam * CPlugins::makeParam(const char * const id, const int value, Plugin
void CPlugins::start_plugin_by_name(const std::string & filename,int param)
{
for(int i = 0; i < (int) plugin_list.size();i++)
for (int i = 0; i < (int) plugin_list.size(); i++)
{
if(filename.compare(g_PluginList->getName(i))==0)
if (filename.compare(g_PluginList->getName(i))==0)
{
startPlugin(i,param);
return;
@@ -291,7 +291,7 @@ void CPlugins::startPlugin(const char * const name)
int pluginnr = find_plugin(name);
if (pluginnr > -1)
startPlugin(pluginnr,0);
else
else
printf("[CPlugins] could not find %s\n", name);
}
@@ -303,7 +303,7 @@ void CPlugins::startScriptPlugin(int number)
if (!pluginfile_exists(plugin_list[number].pluginfile))
{
printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n",
script, plugin_list[number].cfgfile.c_str());
script, plugin_list[number].cfgfile.c_str());
return;
}
@@ -313,12 +313,12 @@ void CPlugins::startScriptPlugin(int number)
char output[1024];
while (fgets(output,1024,f))
{
scriptOutput += output;
scriptOutput += output;
}
pclose(f);
}
else
{
}
else
{
printf("[CPlugins] can't execute %s\n",script);
}
}
@@ -332,7 +332,7 @@ void CPlugins::startPlugin(int number,int param)
//bool ispip = strncmp(plugin_list[number].pluginfile.c_str(), "pip", 3) ? false : true;
bool ispip = strstr(plugin_list[number].pluginfile.c_str(), "pip") != 0;
//printf("exec: %s pip: %d\n", plugin_list[number].pluginfile.c_str(), ispip);
if(ispip && !g_RemoteControl->is_video_started)
if (ispip && !g_RemoteControl->is_video_started)
return;
if (plugin_list[number].type == CPlugins::P_TYPE_SCRIPT)
{
@@ -342,7 +342,7 @@ void CPlugins::startPlugin(int number,int param)
if (!pluginfile_exists(plugin_list[number].pluginfile))
{
printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n",
plugin_list[number].pluginfile.c_str(), plugin_list[number].cfgfile.c_str());
plugin_list[number].pluginfile.c_str(), plugin_list[number].cfgfile.c_str());
return;
}
@@ -394,7 +394,7 @@ void CPlugins::startPlugin(int number,int param)
close(fd);
}
#endif
if(param>0)
if (param>0)
vtpid=param;
startparam = makeParam(P_ID_VTXTPID, vtpid, startparam);
}
@@ -408,7 +408,7 @@ void CPlugins::startPlugin(int number,int param)
}
PluginParam *par = startparam;
for( ; par; par=par->next )
for ( ; par; par=par->next )
{
printf("[CPlugins] (id,val):(%s,%s)\n", par->id, par->val);
}
@@ -420,7 +420,7 @@ void CPlugins::startPlugin(int number,int param)
if ( depstring[0] )
{
p=depstring;
while( 1 )
while ( 1 )
{
argv[ argc ] = p;
argc++;
@@ -434,13 +434,13 @@ void CPlugins::startPlugin(int number,int param)
break;
}
}
for( i=0; i<argc; i++ )
for ( i=0; i<argc; i++ )
{
std::string libname = argv[i];
printf("[CPlugins] try load shared lib : %s\n",argv[i]);
libhandle[i] = dlopen ( *argv[i] == '/' ?
argv[i] : (PLUGINDIR "/"+libname).c_str(),
RTLD_NOW | RTLD_GLOBAL );
argv[i] : (PLUGINDIR "/"+libname).c_str(),
RTLD_NOW | RTLD_GLOBAL );
if ( !libhandle[i] )
{
fputs (dlerror(), stderr);
@@ -462,14 +462,14 @@ void CPlugins::startPlugin(int number,int param)
dlclose(handle);
} else {
printf("[CPlugins] try exec...\n");
if(ispip) {
if (ispip) {
g_Sectionsd->setPauseScanning (true);
g_Zapit->setEventMode(false);
#if 0
//g_Controld->setEventMode(false);
#endif
if(g_Zapit->isPlayBackActive()) {
if(!CNeutrinoApp::getInstance()->recordingstatus)
if (g_Zapit->isPlayBackActive()) {
if (!CNeutrinoApp::getInstance()->recordingstatus)
g_Zapit->setRecordMode(true);
} else {
/* no playback, we playing file ? zap to channel */
@@ -496,15 +496,15 @@ void CPlugins::startPlugin(int number,int param)
//#endif
//if (!plugin_list[number].rc)
g_RCInput->restartInput();
g_RCInput->restartInput();
g_RCInput->clearRCMsg();
if (plugin_list[number].lcd)
{
if(lcd_fd != -1)
{
if (lcd_fd != -1)
close(lcd_fd);
CLCD::getInstance()->resume();
}
}
if (plugin_list[number].fb)
{
@@ -515,8 +515,8 @@ void CPlugins::startPlugin(int number,int param)
#endif
}
frameBuffer->paintBackgroundBox(0,0,720,576);
if(ispip) {
if(!CNeutrinoApp::getInstance()->recordingstatus) {
if (ispip) {
if (!CNeutrinoApp::getInstance()->recordingstatus) {
g_Zapit->setRecordMode(false);
}
#if 0
@@ -544,7 +544,7 @@ void CPlugins::startPlugin(int number,int param)
}
/* unload shared libs */
for( i=0; i<argc; i++ )
for ( i=0; i<argc; i++ )
{
if ( libhandle[i] )
dlclose(libhandle[i]);
@@ -552,7 +552,7 @@ void CPlugins::startPlugin(int number,int param)
break;
}
for(par = startparam ; par; )
for (par = startparam ; par; )
{
/* we must not free par->id, since it is the original */
free(par->val);
@@ -565,19 +565,19 @@ void CPlugins::startPlugin(int number,int param)
g_RCInput->clearRCMsg();
g_RCInput->stopInput();
//frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t));
printf("Starting %s\n", plugin_list[number].pluginfile.c_str());
printf("Starting %s\n", plugin_list[number].pluginfile.c_str());
mysystem((char *) plugin_list[number].pluginfile.c_str(), NULL, NULL);
//frameBuffer->setMode(720, 576, 8 * sizeof(fb_pixel_t));
frameBuffer->paintBackground();
g_RCInput->restartInput();
g_RCInput->clearRCMsg();
#endif
#endif
}
bool CPlugins::hasPlugin(CPlugins::p_type_t type)
{
for (std::vector<plugin>::iterator it=plugin_list.begin();
it!=plugin_list.end();it++)
it!=plugin_list.end(); it++)
{
if (it->type == type && !it->hide)
return true;
@@ -599,20 +599,20 @@ CPlugins::p_type_t CPlugins::getPluginType(int type)
{
switch (type)
{
case PLUGIN_TYPE_DISABLED:
return P_TYPE_DISABLED;
break;
case PLUGIN_TYPE_GAME:
return P_TYPE_GAME;
break;
case PLUGIN_TYPE_TOOL:
return P_TYPE_TOOL;
break;
case PLUGIN_TYPE_SCRIPT:
return P_TYPE_SCRIPT;
break;
default:
return P_TYPE_DISABLED;
case PLUGIN_TYPE_DISABLED:
return P_TYPE_DISABLED;
break;
case PLUGIN_TYPE_GAME:
return P_TYPE_GAME;
break;
case PLUGIN_TYPE_TOOL:
return P_TYPE_TOOL;
break;
case PLUGIN_TYPE_SCRIPT:
return P_TYPE_SCRIPT;
break;
default:
return P_TYPE_DISABLED;
}
}

View File

@@ -106,13 +106,13 @@ public:
bool changeNotify(const neutrino_locale_t OptionName, void *)
{
CTimerd::CTimerEventTypes type = (CTimerd::CTimerEventTypes) *iType;
if(type == CTimerd::TIMER_RECORD)
if (type == CTimerd::TIMER_RECORD)
{
*stopTime=(time(NULL)/60)*60;
struct tm *tmTime2 = localtime(stopTime);
sprintf( display, "%02d.%02d.%04d %02d:%02d", tmTime2->tm_mday, tmTime2->tm_mon+1,
tmTime2->tm_year+1900,
tmTime2->tm_hour, tmTime2->tm_min);
tmTime2->tm_year+1900,
tmTime2->tm_hour, tmTime2->tm_min);
m1->setActive(true);
m6->setActive((g_settings.recording_type == RECORDING_FILE));
}
@@ -123,9 +123,9 @@ public:
m1->setActive (false);
m6->setActive(false);
}
if(type == CTimerd::TIMER_RECORD ||
type == CTimerd::TIMER_ZAPTO ||
type == CTimerd::TIMER_NEXTPROGRAM)
if (type == CTimerd::TIMER_RECORD ||
type == CTimerd::TIMER_ZAPTO ||
type == CTimerd::TIMER_NEXTPROGRAM)
{
m2->setActive(true);
}
@@ -133,15 +133,15 @@ public:
{
m2->setActive(false);
}
if(type == CTimerd::TIMER_STANDBY)
if (type == CTimerd::TIMER_STANDBY)
m3->setActive(true);
else
m3->setActive(false);
if(type == CTimerd::TIMER_REMIND)
if (type == CTimerd::TIMER_REMIND)
m4->setActive(true);
else
m4->setActive(false);
if(type == CTimerd::TIMER_EXEC_PLUGIN)
if (type == CTimerd::TIMER_EXEC_PLUGIN)
m5->setActive(true);
else
m5->setActive(false);
@@ -166,7 +166,7 @@ public:
bool changeNotify(const neutrino_locale_t OptionName, void *)
{
if(*iRepeat >= (int)CTimerd::TIMERREPEAT_WEEKDAYS)
if (*iRepeat >= (int)CTimerd::TIMERREPEAT_WEEKDAYS)
m1->setActive (true);
else
m1->setActive (false);
@@ -208,9 +208,9 @@ public:
bool changeNotify(const neutrino_locale_t OptionName, void *)
{
if(OptionName == LOCALE_TIMERLIST_APIDS_DFLT)
if (OptionName == LOCALE_TIMERLIST_APIDS_DFLT)
{
if(*o_dflt==0)
if (*o_dflt==0)
{
m_std->setActive(true);
m_alt->setActive(true);
@@ -228,8 +228,8 @@ public:
}
else
{
if(*o_std || *o_alt || *o_ac3)
*o_dflt=0;
if (*o_std || *o_alt || *o_ac3)
*o_dflt=0;
}
return true;
}
@@ -260,16 +260,16 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
if (strcmp(key, "modifytimer") == 0)
{
timerlist[selected].announceTime = timerlist[selected].alarmTime -60;
if(timerlist[selected].eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS)
if (timerlist[selected].eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS)
Timer->getWeekdaysFromStr(&timerlist[selected].eventRepeat, m_weekdaysStr);
if(timerlist[selected].eventType == CTimerd::TIMER_RECORD)
if (timerlist[selected].eventType == CTimerd::TIMER_RECORD)
{
timerlist[selected].announceTime -= 120; // 2 more mins for rec timer
if (timer_apids_dflt)
timerlist[selected].apids = TIMERD_APIDS_CONF;
else
timerlist[selected].apids = (timer_apids_std * TIMERD_APIDS_STD) | (timer_apids_ac3 * TIMERD_APIDS_AC3) |
(timer_apids_alt * TIMERD_APIDS_ALT);
(timer_apids_alt * TIMERD_APIDS_ALT);
Timer->modifyTimerAPid(timerlist[selected].eventID,timerlist[selected].apids);
Timer->modifyRecordTimerEvent(timerlist[selected].eventID, timerlist[selected].announceTime,
timerlist[selected].alarmTime,
@@ -296,11 +296,11 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
eventinfo.recordingSafety = false;
timerNew.standby_on = (timerNew_standby_on == 1);
void *data=NULL;
if(timerNew.eventType == CTimerd::TIMER_STANDBY)
if (timerNew.eventType == CTimerd::TIMER_STANDBY)
data=&(timerNew.standby_on);
else if(timerNew.eventType==CTimerd::TIMER_NEXTPROGRAM ||
timerNew.eventType==CTimerd::TIMER_ZAPTO ||
timerNew.eventType==CTimerd::TIMER_RECORD)
else if (timerNew.eventType==CTimerd::TIMER_NEXTPROGRAM ||
timerNew.eventType==CTimerd::TIMER_ZAPTO ||
timerNew.eventType==CTimerd::TIMER_RECORD)
{
if (strcmp(timerNew_channel_name, "---")==0)
return menu_return::RETURN_REPAINT;
@@ -318,7 +318,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
} else
data= &eventinfo;
}
else if(timerNew.eventType==CTimerd::TIMER_REMIND)
else if (timerNew.eventType==CTimerd::TIMER_REMIND)
data= timerNew.message;
else if (timerNew.eventType==CTimerd::TIMER_EXEC_PLUGIN)
{
@@ -326,7 +326,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
return menu_return::RETURN_REPAINT;
data= timerNew.pluginName;
}
if(timerNew.eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS)
if (timerNew.eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS)
Timer->getWeekdaysFromStr(&timerNew.eventRepeat, m_weekdaysStr);
if (Timer->addTimerEvent(timerNew.eventType,data,timerNew.announceTime,timerNew.alarmTime,
@@ -356,7 +356,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
return menu_return::RETURN_EXIT;
}
if(parent)
if (parent)
{
parent->hide();
}
@@ -364,21 +364,21 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
int ret = show();
return ret;
/*
if( ret > -1)
{
return menu_return::RETURN_REPAINT;
}
else if( ret == -1)
{
// -1 bedeutet nur REPAINT
return menu_return::RETURN_REPAINT;
}
else
{
// -2 bedeutet EXIT_ALL
return menu_return::RETURN_EXIT_ALL;
}*/
/*
if( ret > -1)
{
return menu_return::RETURN_REPAINT;
}
else if( ret == -1)
{
// -1 bedeutet nur REPAINT
return menu_return::RETURN_REPAINT;
}
else
{
// -2 bedeutet EXIT_ALL
return menu_return::RETURN_EXIT_ALL;
}*/
}
void CTimerList::updateEvents(void)
@@ -387,9 +387,9 @@ void CTimerList::updateEvents(void)
Timer->getTimerList (timerlist);
//Remove last deleted event from List
CTimerd::TimerList::iterator timer = timerlist.begin();
for(; timer != timerlist.end();timer++)
for (; timer != timerlist.end(); timer++)
{
if(timer->eventID==skipEventID)
if (timer->eventID==skipEventID)
{
timerlist.erase(timer);
break;
@@ -405,18 +405,18 @@ void CTimerList::updateEvents(void)
listmaxshow = (height-theight-0)/(fheight*2);
height = theight+0+listmaxshow*fheight*2; // recalc height
if(timerlist.size() < listmaxshow)
if (timerlist.size() < listmaxshow)
{
listmaxshow=timerlist.size();
height = theight+0+listmaxshow*fheight*2; // recalc height
}
if(selected==timerlist.size() && !(timerlist.empty()))
if (selected==timerlist.size() && !(timerlist.empty()))
{
selected=timerlist.size()-1;
liststart = (selected/listmaxshow)*listmaxshow;
}
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2;
x=getScreenStartX( width );
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2;
}
@@ -428,13 +428,13 @@ int CTimerList::show()
int res = menu_return::RETURN_REPAINT;
unsigned long long timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings
::TIMING_MENU]);
::TIMING_MENU]);
bool loop=true;
bool update=true;
while(loop)
while (loop)
{
if(update)
if (update)
{
hide();
updateEvents();
@@ -443,19 +443,19 @@ int CTimerList::show()
}
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd );
if( msg <= CRCInput::RC_MaxRC )
if ( msg <= CRCInput::RC_MaxRC )
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings
::TIMING_MENU]);
::TIMING_MENU]);
if( ( msg == CRCInput::RC_timeout ) ||
( msg == CRCInput::RC_home) )
if ( ( msg == CRCInput::RC_timeout ) ||
( msg == CRCInput::RC_home) )
{ //Exit after timeout or cancel key
loop=false;
}
else if ((msg == CRCInput::RC_up) && !(timerlist.empty()))
{
int prevselected=selected;
if(selected==0)
if (selected==0)
{
selected = timerlist.size()-1;
}
@@ -464,7 +464,7 @@ int CTimerList::show()
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
paint();
}
@@ -480,7 +480,7 @@ int CTimerList::show()
paintItem(prevselected - liststart);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
if (oldliststart!=liststart)
{
paint();
}
@@ -499,13 +499,13 @@ int CTimerList::show()
else
update=true;
}
else if((msg == CRCInput::RC_red) && !(timerlist.empty()))
else if ((msg == CRCInput::RC_red) && !(timerlist.empty()))
{
Timer->removeTimerEvent(timerlist[selected].eventID);
skipEventID=timerlist[selected].eventID;
update=true;
}
else if(msg==CRCInput::RC_green)
else if (msg==CRCInput::RC_green)
{
if (newTimer()==menu_return::RETURN_EXIT_ALL)
{
@@ -515,32 +515,32 @@ int CTimerList::show()
else
update=true;
}
else if(msg==CRCInput::RC_yellow)
else if (msg==CRCInput::RC_yellow)
{
update=true;
}
else if((msg==CRCInput::RC_blue)||
(CRCInput::isNumeric(msg)) )
else if ((msg==CRCInput::RC_blue)||
(CRCInput::isNumeric(msg)) )
{
//pushback key if...
g_RCInput->postMsg( msg, data );
loop=false;
}
else if(msg==CRCInput::RC_setup)
else if (msg==CRCInput::RC_setup)
{
res=menu_return::RETURN_EXIT_ALL;
loop=false;
}
else if( msg == CRCInput::RC_help || msg == CRCInput::RC_info)
else if ( msg == CRCInput::RC_help || msg == CRCInput::RC_info)
{
CTimerd::responseGetTimer* timer=&timerlist[selected];
if(timer!=NULL)
if (timer!=NULL)
{
if(timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO)
if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO)
{
hide();
res = g_EpgData->show(timer->channel_id, timer->epgID, &timer->epg_starttime);
if(res==menu_return::RETURN_EXIT_ALL)
if (res==menu_return::RETURN_EXIT_ALL)
loop=false;
else
paint();
@@ -555,7 +555,7 @@ int CTimerList::show()
}
else
{
if( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
{
loop = false;
res = menu_return::RETURN_EXIT_ALL;
@@ -569,7 +569,7 @@ int CTimerList::show()
void CTimerList::hide()
{
if(visible)
if (visible)
{
frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5);
visible = false;
@@ -602,13 +602,13 @@ void CTimerList::paintItem(int pos)
}
int real_width=width;
if(timerlist.size()>listmaxshow)
if (timerlist.size()>listmaxshow)
{
real_width-=15; //scrollbar
}
frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor);
if(liststart+pos<timerlist.size())
if (liststart+pos<timerlist.size())
{
CTimerd::responseGetTimer & timer = timerlist[liststart+pos];
char zAlarmTime[25] = {0};
@@ -618,7 +618,7 @@ void CTimerList::paintItem(int pos)
struct tm *stopTime = localtime(&(timer.stopTime));
strftime(zStopTime,20,"%d.%m. %H:%M",stopTime);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, 150, zAlarmTime, color, fheight, true); // UTF-8
if(timer.stopTime != 0)
if (timer.stopTime != 0)
{
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, 150, zStopTime, color, fheight, true); // UTF-8
}
@@ -637,102 +637,103 @@ void CTimerList::paintItem(int pos)
}
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+160+(real_width-160)/2,ypos+fheight, (real_width-160)/2-5, convertTimerType2String(timer.eventType), color, fheight, true); // UTF-8
std::string zAddData("");
switch(timer.eventType)
switch (timer.eventType)
{
case CTimerd::TIMER_NEXTPROGRAM :
case CTimerd::TIMER_ZAPTO :
case CTimerd::TIMER_RECORD :
{
zAddData = convertChannelId2String(timer.channel_id); // UTF-8
if(timer.apids != TIMERD_APIDS_CONF)
{
std::string sep = "";
zAddData += " (";
if(timer.apids & TIMERD_APIDS_STD)
{
zAddData += "STD";
sep = "/";
}
if(timer.apids & TIMERD_APIDS_ALT)
{
zAddData += sep;
zAddData += "ALT";
sep = "/";
}
if(timer.apids & TIMERD_APIDS_AC3)
{
zAddData += sep;
zAddData += "AC3";
sep = "/";
}
zAddData += ')';
}
if(timer.epgID!=0)
{
CEPGData epgdata;
//if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata))
if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata))
{
zAddData += " : ";
zAddData += epgdata.title;
}
else if(strlen(timer.epgTitle)!=0)
{
zAddData += " : ";
zAddData += timer.epgTitle;
}
}
else if(strlen(timer.epgTitle)!=0)
{
zAddData += " : ";
zAddData += timer.epgTitle;
}
}
break;
case CTimerd::TIMER_STANDBY:
{
zAddData = g_Locale->getText(timer.standby_on ? LOCALE_TIMERLIST_STANDBY_ON : LOCALE_TIMERLIST_STANDBY_OFF);
break;
}
case CTimerd::TIMER_REMIND :
{
zAddData = timer.message; // must be UTF-8 encoded !
}
break;
case CTimerd::TIMER_EXEC_PLUGIN :
case CTimerd::TIMER_NEXTPROGRAM :
case CTimerd::TIMER_ZAPTO :
case CTimerd::TIMER_RECORD :
{
zAddData = convertChannelId2String(timer.channel_id); // UTF-8
if (timer.apids != TIMERD_APIDS_CONF)
{
zAddData = timer.pluginName;
std::string sep = "";
zAddData += " (";
if (timer.apids & TIMERD_APIDS_STD)
{
zAddData += "STD";
sep = "/";
}
if (timer.apids & TIMERD_APIDS_ALT)
{
zAddData += sep;
zAddData += "ALT";
sep = "/";
}
if (timer.apids & TIMERD_APIDS_AC3)
{
zAddData += sep;
zAddData += "AC3";
sep = "/";
}
zAddData += ')';
}
if (timer.epgID!=0)
{
CEPGData epgdata;
//if (g_Sectionsd->getEPGid(timer.epgID, timer.epg_starttime, &epgdata))
if (sectionsd_getEPGid(timer.epgID, timer.epg_starttime, &epgdata))
{
zAddData += " : ";
zAddData += epgdata.title;
}
else if (strlen(timer.epgTitle)!=0)
{
zAddData += " : ";
zAddData += timer.epgTitle;
}
}
else if (strlen(timer.epgTitle)!=0)
{
zAddData += " : ";
zAddData += timer.epgTitle;
}
}
break;
case CTimerd::TIMER_STANDBY:
{
zAddData = g_Locale->getText(timer.standby_on ? LOCALE_TIMERLIST_STANDBY_ON : LOCALE_TIMERLIST_STANDBY_OFF);
break;
default:{}
}
case CTimerd::TIMER_REMIND :
{
zAddData = timer.message; // must be UTF-8 encoded !
}
break;
case CTimerd::TIMER_EXEC_PLUGIN :
{
zAddData = timer.pluginName;
}
break;
default: {}
}
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+160,ypos+2*fheight, real_width-165, zAddData, color, fheight, true); // UTF-8
// LCD Display
if(liststart+pos==selected)
if (liststart+pos==selected)
{
std::string line1 = convertTimerType2String(timer.eventType); // UTF-8
std::string line2 = zAlarmTime;
switch(timer.eventType)
switch (timer.eventType)
{
case CTimerd::TIMER_RECORD :
line2+= " -";
line2+= zStopTime+6;
case CTimerd::TIMER_NEXTPROGRAM :
case CTimerd::TIMER_ZAPTO :
{
line1 += ' ';
line1 += convertChannelId2String(timer.channel_id); // UTF-8
}
break;
case CTimerd::TIMER_STANDBY :
{
if(timer.standby_on)
line1+=" ON";
else
line1+=" OFF";
}
break;
default:;
case CTimerd::TIMER_RECORD :
line2+= " -";
line2+= zStopTime+6;
case CTimerd::TIMER_NEXTPROGRAM :
case CTimerd::TIMER_ZAPTO :
{
line1 += ' ';
line1 += convertChannelId2String(timer.channel_id); // UTF-8
}
break;
case CTimerd::TIMER_STANDBY :
{
if (timer.standby_on)
line1+=" ON";
else
line1+=" OFF";
}
break;
default:
;
}
CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); // UTF-8
//CVFD::getInstance()->showMenuText(1, line2.c_str(), -1, true); // UTF-8
@@ -747,8 +748,8 @@ void CTimerList::paintHead()
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+35,y+theight+0, width- 45, g_Locale->getText(LOCALE_TIMERLIST_NAME), COL_MENUHEAD, 0, true); // UTF-8
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 30, y+ 5 );
/* if (bouquetList!=NULL)
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- 60, y+ 5 );*/
/* if (bouquetList!=NULL)
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- 60, y+ 5 );*/
}
const struct button_label TimerListButtons[3] =
@@ -783,12 +784,12 @@ void CTimerList::paint()
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_TIMERLIST_NAME));
paintHead();
for(unsigned int count=0;count<listmaxshow;count++)
for (unsigned int count=0; count<listmaxshow; count++)
{
paintItem(count);
}
if(timerlist.size()>listmaxshow)
if (timerlist.size()>listmaxshow)
{
int ypos = y+ theight;
int sb = 2*fheight* listmaxshow;
@@ -806,60 +807,76 @@ void CTimerList::paint()
const char * CTimerList::convertTimerType2String(const CTimerd::CTimerEventTypes type) // UTF-8
{
switch(type)
switch (type)
{
case CTimerd::TIMER_SHUTDOWN : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SHUTDOWN );
case CTimerd::TIMER_NEXTPROGRAM : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_NEXTPROGRAM);
case CTimerd::TIMER_ZAPTO : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_ZAPTO );
case CTimerd::TIMER_STANDBY : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_STANDBY );
case CTimerd::TIMER_RECORD : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_RECORD );
case CTimerd::TIMER_REMIND : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_REMIND );
case CTimerd::TIMER_SLEEPTIMER : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SLEEPTIMER );
case CTimerd::TIMER_EXEC_PLUGIN : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_EXECPLUGIN );
default : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_UNKNOWN );
case CTimerd::TIMER_SHUTDOWN :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SHUTDOWN );
case CTimerd::TIMER_NEXTPROGRAM :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_NEXTPROGRAM);
case CTimerd::TIMER_ZAPTO :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_ZAPTO );
case CTimerd::TIMER_STANDBY :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_STANDBY );
case CTimerd::TIMER_RECORD :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_RECORD );
case CTimerd::TIMER_REMIND :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_REMIND );
case CTimerd::TIMER_SLEEPTIMER :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SLEEPTIMER );
case CTimerd::TIMER_EXEC_PLUGIN :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_EXECPLUGIN );
default :
return g_Locale->getText(LOCALE_TIMERLIST_TYPE_UNKNOWN );
}
}
std::string CTimerList::convertTimerRepeat2String(const CTimerd::CTimerEventRepeat rep) // UTF-8
{
switch(rep)
switch (rep)
{
case CTimerd::TIMERREPEAT_ONCE : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_ONCE );
case CTimerd::TIMERREPEAT_DAILY : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_DAILY );
case CTimerd::TIMERREPEAT_WEEKLY : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_WEEKLY );
case CTimerd::TIMERREPEAT_BIWEEKLY : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_BIWEEKLY );
case CTimerd::TIMERREPEAT_FOURWEEKLY : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_FOURWEEKLY );
case CTimerd::TIMERREPEAT_MONTHLY : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_MONTHLY );
case CTimerd::TIMERREPEAT_BYEVENTDESCRIPTION : return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_BYEVENTDESCRIPTION);
default:
if(rep >=CTimerd::TIMERREPEAT_WEEKDAYS)
{
int weekdays = (((int)rep) >> 9);
std::string weekdayStr="";
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_MONDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_TUESDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_WEDNESDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_THURSDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_FRIDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_SATURDAY);
weekdays >>= 1;
if(weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_SUNDAY);
return weekdayStr;
}
else
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_UNKNOWN);
case CTimerd::TIMERREPEAT_ONCE :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_ONCE );
case CTimerd::TIMERREPEAT_DAILY :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_DAILY );
case CTimerd::TIMERREPEAT_WEEKLY :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_WEEKLY );
case CTimerd::TIMERREPEAT_BIWEEKLY :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_BIWEEKLY );
case CTimerd::TIMERREPEAT_FOURWEEKLY :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_FOURWEEKLY );
case CTimerd::TIMERREPEAT_MONTHLY :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_MONTHLY );
case CTimerd::TIMERREPEAT_BYEVENTDESCRIPTION :
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_BYEVENTDESCRIPTION);
default:
if (rep >=CTimerd::TIMERREPEAT_WEEKDAYS)
{
int weekdays = (((int)rep) >> 9);
std::string weekdayStr="";
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_MONDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_TUESDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_WEDNESDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_THURSDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_FRIDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_SATURDAY);
weekdays >>= 1;
if (weekdays & 1)
weekdayStr+= g_Locale->getText(LOCALE_TIMERLIST_REPEAT_SUNDAY);
return weekdayStr;
}
else
return g_Locale->getText(LOCALE_TIMERLIST_REPEAT_UNKNOWN);
}
}
@@ -938,7 +955,7 @@ int CTimerList::modifyTimer()
timerSettings.addItem( m1);
CDateInput timerSettings_stopTime(LOCALE_TIMERLIST_STOPTIME, &timer->stopTime , LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
if(timer->stopTime != 0)
if (timer->stopTime != 0)
{
CMenuForwarder *m2 = new CMenuForwarder(LOCALE_TIMERLIST_STOPTIME, true, timerSettings_stopTime.getValue (), &timerSettings_stopTime );
timerSettings.addItem( m2);
@@ -957,11 +974,11 @@ int CTimerList::modifyTimer()
//printf("TIMER: rec dir %s len %s\n", timer->recordingDir, strlen(timer->recordingDir));
if(!strlen(timer->recordingDir))
if (!strlen(timer->recordingDir))
strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir,sizeof(timer->recordingDir));
CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,NULL,
timer->recordingDir, g_settings.network_nfs_recordingdir);
timer->recordingDir, g_settings.network_nfs_recordingdir);
if (!recDirs.hasItem())
{
printf("[CTimerList] warning: no network devices available\n");
@@ -994,8 +1011,8 @@ int CTimerList::modifyTimer()
CMenuOptionChooser* ma4 = new CMenuOptionChooser(LOCALE_RECORDINGMENU_APIDS_AC3, &timer_apids_ac3, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true, &apid_notifier);
timerSettings_apids.addItem(ma4);
apid_notifier.setItems(ma1,ma2,ma3,ma4);
if(timer->eventType == CTimerd::TIMER_RECORD)
{
if (timer->eventType == CTimerd::TIMER_RECORD)
{
timerSettings.addItem( new CMenuForwarder(LOCALE_TIMERLIST_APIDS, true, NULL, &timerSettings_apids ));
}
@@ -1045,28 +1062,28 @@ int CTimerList::newTimer()
CMenuWidget mcradio(LOCALE_TIMERLIST_BOUQUETSELECT, NEUTRINO_ICON_SETTINGS);
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
if (!g_bouquetManager->Bouquets[i]->bHidden) {
if (!g_bouquetManager->Bouquets[i]->bHidden) {
CMenuWidget* mwtv = new CMenuWidget(LOCALE_TIMERLIST_CHANNELSELECT, NEUTRINO_ICON_SETTINGS);
toDelete.push_back(mwtv);
CMenuWidget* mwradio = new CMenuWidget(LOCALE_TIMERLIST_CHANNELSELECT, NEUTRINO_ICON_SETTINGS);
toDelete.push_back(mwradio);
ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->tvChannels);
for(int j = 0; j < (int) channels->size(); j++) {
for (int j = 0; j < (int) channels->size(); j++) {
char cChannelId[3+16+1+1];
sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", (*channels)[j]->channel_id);
mwtv->addItem(new CMenuForwarderNonLocalized((*channels)[j]->getName().c_str(), true, NULL, this, (std::string(cChannelId) + (*channels)[j]->getName()).c_str()));
}
}
if (!channels->empty())
mctv.addItem(new CMenuForwarderNonLocalized(g_bouquetManager->Bouquets[i]->Name.c_str(), true, NULL, mwtv));
channels = &(g_bouquetManager->Bouquets[i]->radioChannels);
for(int j = 0; j < (int) channels->size(); j++) {
for (int j = 0; j < (int) channels->size(); j++) {
char cChannelId[3+16+1+1];
sprintf(cChannelId, "SC:" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS ",", (*channels)[j]->channel_id);
mwradio->addItem(new CMenuForwarderNonLocalized((*channels)[j]->getName().c_str(), true, NULL, this, (std::string(cChannelId) + (*channels)[j]->getName()).c_str()));
}
}
if (!channels->empty())
mcradio.addItem(new CMenuForwarderNonLocalized(g_bouquetManager->Bouquets[i]->Name.c_str(), true, NULL, mwtv));
}
@@ -1117,7 +1134,7 @@ int CTimerList::newTimer()
int ret=timerSettings.exec(this,"");
// delete dynamic created objects
for(unsigned int count=0;count<toDelete.size();count++)
for (unsigned int count=0; count<toDelete.size(); count++)
{
delete toDelete[count];
}
@@ -1135,12 +1152,12 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime)
std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER);
timerbuf += "\n";
for (CTimerd::TimerList::iterator it = overlappingTimers.begin();
it != overlappingTimers.end();it++)
it != overlappingTimers.end(); it++)
{
timerbuf += CTimerList::convertTimerType2String(it->eventType);
timerbuf += " (";
timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8
if(it->epgID != 0)
if (it->epgID != 0)
{
CEPGData epgdata;
//if (g_Sectionsd->getEPGid(it->epgID, it->epg_starttime, &epgdata))
@@ -1149,7 +1166,7 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime)
timerbuf += ":";
timerbuf += epgdata.title;
}
else if(strlen(it->epgTitle)!=0)
else if (strlen(it->epgTitle)!=0)
{
timerbuf += ":";
timerbuf += it->epgTitle;