mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-16 01:43:42 +02:00
Merge branch 'dvbsi++' into next
This commit is contained in:
@@ -110,6 +110,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
|
||||
selected_chid = 0;
|
||||
footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar
|
||||
previous_channellist_additional = -1;
|
||||
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
||||
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -2119,15 +2120,16 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h)
|
||||
|
||||
void CChannelList::paint_events(int index)
|
||||
{
|
||||
ffheight = g_Font[eventFont]->getHeight();
|
||||
readEvents(chanlist[index]->channel_id);
|
||||
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
|
||||
|
||||
char startTime[10];
|
||||
int eventStartTimeWidth = g_Font[eventFont]->getRenderWidth("22:22") + 5; // use a fixed value
|
||||
int startTimeWidth = 0;
|
||||
CChannelEventList::iterator e;
|
||||
time_t azeit;
|
||||
time(&azeit);
|
||||
int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight();
|
||||
|
||||
if ( evtlist.empty() )
|
||||
{
|
||||
@@ -2166,11 +2168,10 @@ void CChannelList::paint_events(int index)
|
||||
struct tm *tmStartZeit = localtime(&e->startTime);
|
||||
strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit );
|
||||
//printf("%s %s\n", startTime, e->description.c_str());
|
||||
startTimeWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth("88:88"); // use a fixed value
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true);
|
||||
startTimeWidth = startTimeWidth +5;
|
||||
startTimeWidth = eventStartTimeWidth;
|
||||
g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, COL_MENUCONTENTINACTIVE, 0, true);
|
||||
}
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2206,6 +2207,7 @@ void CChannelList::readEvents(const t_channel_id channel_id)
|
||||
|
||||
void CChannelList::showdescription(int index)
|
||||
{
|
||||
ffheight = g_Font[eventFont]->getHeight();
|
||||
CZapitChannel* chan = chanlist[index];
|
||||
CChannelEvent *p_event=NULL;
|
||||
p_event = &chan->currentEvent;
|
||||
@@ -2214,13 +2216,10 @@ void CChannelList::showdescription(int index)
|
||||
CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData);
|
||||
if (!(epgData.info2.empty()))
|
||||
{
|
||||
int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight();
|
||||
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
|
||||
processTextToArray(epgData.info2);
|
||||
for (unsigned int i = 1; (i < epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++)
|
||||
{
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true);
|
||||
}
|
||||
for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++)
|
||||
g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2257,7 +2256,7 @@ void CChannelList::processTextToArray(std::string text, int screening) // UTF-8
|
||||
if (*text_!='\n')
|
||||
aktWord += *text_;
|
||||
|
||||
int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(aktWord, true);
|
||||
int aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord, true);
|
||||
if ((aktWordWidth+aktWidth)<(infozone_width - 20))
|
||||
{//space ok, add
|
||||
aktWidth += aktWordWidth;
|
||||
|
@@ -67,6 +67,8 @@ private:
|
||||
int fheight; // Fonthoehe Channellist-Inhalt
|
||||
int theight; // Fonthoehe Channellist-Titel
|
||||
int footerHeight;
|
||||
int eventFont;
|
||||
int ffheight;
|
||||
|
||||
std::string name;
|
||||
ZapitChannelList chanlist;
|
||||
|
@@ -450,6 +450,22 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos)
|
||||
// nicht gefunden / noch nicht geladen
|
||||
/* see the comment in display_Info() for a reasoning for this calculation */
|
||||
int CurrInfoY = (BoxEndY + ChanNameY + time_height) / 2; // lower end of current info box
|
||||
if(g_settings.infobar_progressbar){
|
||||
int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4;
|
||||
switch(g_settings.infobar_progressbar)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
CurrInfoY += (pb_h/3);
|
||||
break;
|
||||
case 3:
|
||||
CurrInfoY -= (pb_h/3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
neutrino_locale_t loc;
|
||||
if (! gotTime)
|
||||
loc = LOCALE_INFOVIEWER_WAITTIME;
|
||||
@@ -717,7 +733,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
|
||||
std::string prov_name = pname;
|
||||
prov_name=prov_name.substr(prov_name.find_first_of("]")+1);
|
||||
|
||||
int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName);
|
||||
int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName, true);// UTF-8
|
||||
chname_width += (chname_width/(ChannelName.size()-1)/2);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(
|
||||
ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2,
|
||||
@@ -1416,30 +1432,67 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
int height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight();
|
||||
int CurrInfoY = (BoxEndY + ChanNameY + time_height) / 2;
|
||||
int NextInfoY = CurrInfoY + height; // lower end of next info box
|
||||
int xStart;
|
||||
int InfoX = ChanInfoX + 10;
|
||||
|
||||
xStart = InfoX;
|
||||
int xStart = InfoX;
|
||||
if (starttimes)
|
||||
xStart += info_time_width + 10;
|
||||
|
||||
//colored_events init
|
||||
bool colored_event_C = false;
|
||||
bool colored_event_N = false;
|
||||
if (g_settings.colored_events_infobar == 1)
|
||||
colored_event_C = true;
|
||||
if (g_settings.colored_events_infobar == 2)
|
||||
colored_event_N = true;
|
||||
int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4;
|
||||
switch(g_settings.infobar_progressbar)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
CurrInfoY += (pb_h/3);
|
||||
NextInfoY += (pb_h/3);
|
||||
break;
|
||||
case 3:
|
||||
CurrInfoY -= (pb_h/3);
|
||||
NextInfoY += (pb_h/3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (pb_pos > -1)
|
||||
{
|
||||
int pb_w = 112;
|
||||
int pb_startx = BoxEndX - pb_w - SHADOW_OFFSET;
|
||||
int pb_starty = ChanNameY - (pb_h + 10);
|
||||
int pb_shadow = COL_INFOBAR_SHADOW_PLUS_0;
|
||||
int pb_color = g_settings.progressbar_color ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0;
|
||||
if(g_settings.infobar_progressbar){
|
||||
pb_startx = xStart;
|
||||
pb_w = BoxEndX - 10 - xStart;
|
||||
pb_shadow = 0;
|
||||
}
|
||||
switch(g_settings.infobar_progressbar)
|
||||
{
|
||||
case 1:
|
||||
|
||||
pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 6)) ;
|
||||
pb_h = (pb_h/3);
|
||||
pb_color = COL_INFOBAR_SHADOW_PLUS_0;
|
||||
break;
|
||||
case 2:
|
||||
pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 5)) ;
|
||||
pb_h = (pb_h/5);
|
||||
pb_color = COL_INFOBAR_SHADOW_PLUS_0;
|
||||
break;
|
||||
case 3:
|
||||
pb_starty = CurrInfoY + ((pb_h / 3)-(pb_h/5)) ;
|
||||
pb_h = (pb_h/5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int pb_p = pb_pos * pb_w / 100;
|
||||
int pb_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() - 4;
|
||||
if (pb_p > pb_w)
|
||||
pb_p = pb_w;
|
||||
timescale->paintProgressBar(BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h, pb_p, pb_w,
|
||||
0, 0, g_settings.progressbar_color ? COL_INFOBAR_SHADOW_PLUS_0 : COL_INFOBAR_PLUS_0, COL_INFOBAR_SHADOW_PLUS_0, "", COL_INFOBAR);
|
||||
|
||||
timescale->paintProgressBar(pb_startx, pb_starty, pb_w, pb_h, pb_p, pb_w,
|
||||
0, 0, pb_color, pb_shadow, "", COL_INFOBAR);
|
||||
//printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h);
|
||||
}
|
||||
|
||||
@@ -1453,6 +1506,14 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
int nextTimeX = BoxEndX - nextTimeW - 10;
|
||||
static int oldCurrTimeX = currTimeX; // remember the last pos. of remaining time, in case we change from 20/100min to 21/99min
|
||||
|
||||
//colored_events init
|
||||
bool colored_event_C = false;
|
||||
bool colored_event_N = false;
|
||||
if (g_settings.colored_events_infobar == 1)
|
||||
colored_event_C = true;
|
||||
if (g_settings.colored_events_infobar == 2)
|
||||
colored_event_N = true;
|
||||
|
||||
if (current != NULL && update_current)
|
||||
{
|
||||
frameBuffer->paintBox(InfoX, CurrInfoY - height, currTimeX, CurrInfoY, COL_INFOBAR_PLUS_0);
|
||||
|
@@ -81,11 +81,12 @@ COsdSetup::~COsdSetup()
|
||||
}
|
||||
|
||||
//font settings
|
||||
const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[4] =
|
||||
const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] =
|
||||
{
|
||||
SNeutrinoSettings::FONT_TYPE_CHANNELLIST,
|
||||
SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR,
|
||||
SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER,
|
||||
SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT,
|
||||
SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP
|
||||
};
|
||||
|
||||
@@ -131,7 +132,7 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[5] =
|
||||
font_sizes_groups font_sizes_groups[6] =
|
||||
{
|
||||
{LOCALE_FONTMENU_MENU , 5, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_MENU_FONTS },
|
||||
{LOCALE_FONTMENU_CHANNELLIST, 4, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS },
|
||||
{LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS },
|
||||
{LOCALE_FONTMENU_EVENTLIST , 4, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS },
|
||||
{LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS },
|
||||
{LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS },
|
||||
@@ -160,6 +161,7 @@ font_sizes_struct neutrino_font[FONT_TYPE_COUNT] =
|
||||
{LOCALE_FONTSIZE_CHANNELLIST , 20, FONT_STYLE_BOLD , 1},
|
||||
{LOCALE_FONTSIZE_CHANNELLIST_DESCR , 20, FONT_STYLE_REGULAR, 1},
|
||||
{LOCALE_FONTSIZE_CHANNELLIST_NUMBER , 14, FONT_STYLE_BOLD , 2},
|
||||
{LOCALE_FONTSIZE_CHANNELLIST_EVENT , 17, FONT_STYLE_REGULAR, 2},
|
||||
{LOCALE_FONTSIZE_CHANNEL_NUM_ZAP , 40, FONT_STYLE_BOLD , 0},
|
||||
{LOCALE_FONTSIZE_INFOBAR_NUMBER , 50, FONT_STYLE_BOLD , 0},
|
||||
{LOCALE_FONTSIZE_INFOBAR_CHANNAME , 30, FONT_STYLE_BOLD , 0},
|
||||
@@ -725,6 +727,14 @@ const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS[LOCAL
|
||||
{ 5 , LOCALE_MISCSETTINGS_INFOBAR_DISP_5 },
|
||||
{ 6 , LOCALE_MISCSETTINGS_INFOBAR_DISP_6 }
|
||||
};
|
||||
#define LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT 4
|
||||
const CMenuOptionChooser::keyval LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTIONS[LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT]=
|
||||
{
|
||||
{ 0 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_0 },
|
||||
{ 1 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_1 },
|
||||
{ 2 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_2 },
|
||||
{ 3 , LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_3 }
|
||||
};
|
||||
|
||||
//infobar
|
||||
void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
|
||||
@@ -753,6 +763,11 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
|
||||
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_SAT);
|
||||
menu_infobar->addItem(mc);
|
||||
|
||||
// infobar progress
|
||||
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR, &g_settings.infobar_progressbar, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_PROGRESSBAR_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_PROGRESSBAR);
|
||||
menu_infobar->addItem(mc);
|
||||
|
||||
// flash/hdd progress
|
||||
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, &g_settings.infobar_show_sysfs_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_FILESYS);
|
||||
|
Reference in New Issue
Block a user