From 1d3e4189c698e98b6672f48d0e40e0568c792d28 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 22:05:18 +0200 Subject: [PATCH 1/6] epgplus: use user's setting for progressbar color Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86551c38a9274aaa3d8017b894f6750b9261e218 Author: vanhofen Date: 2017-04-10 (Mon, 10 Apr 2017) Origin message was: ------------------ - epgplus: use user's setting for progressbar color ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 96247543e..5f5fc5bff 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -216,7 +216,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int // paint new mark CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); - pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); + //NI pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); time_t currentTime; time(¤tTime); From 6e6ffe3fce15c9fdbb0a78f3fccfeebe898fd198 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 15:55:23 +0200 Subject: [PATCH 2/6] add missing //NI tags Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/880020cb5433f9a19403900516551f6abee952dc Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - add missing //NI tags ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/color.h | 4 ++-- src/gui/infoviewer.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/color.h b/src/gui/color.h index 62e25afb9..d188cea8c 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -76,7 +76,7 @@ #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) #define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0) #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) -#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (COL_PROGRESSBAR + 0) +#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (COL_PROGRESSBAR + 0) //NI #else #define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)]) #define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)]) @@ -101,7 +101,7 @@ #define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)]) #define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)]) #define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)]) -#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_PROGRESSBAR + 0)]) +#define COL_PROGRESSBAR_PASSIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_PROGRESSBAR + 0)]) //NI // text colors #define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)]) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0a4397f5e..6c6b313bd 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1750,8 +1750,8 @@ void CInfoViewer::showSNR () int sigbox_offset = ChanWidth *10/100; sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, NULL, true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); - sigbox->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); - sigbox->setPassiveColor(COL_PROGRESSBAR_PASSIVE_PLUS_0); + sigbox->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); //NI + sigbox->setPassiveColor(COL_PROGRESSBAR_PASSIVE_PLUS_0); //NI sigbox->setColorBody(numbox->getColorBody()); sigbox->doPaintBg(false); sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode()); @@ -1841,8 +1841,8 @@ void CInfoViewer::display_Info(const char *current, const char *next, pb_p = pb_w; timescale->setDimensionsAll(pb_startx, pb_starty, pb_w, pb_h); - timescale->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); - timescale->setPassiveColor(g_settings.infobar_progressbar ? COL_PROGRESSBAR_PASSIVE_PLUS_0 : COL_INFOBAR_PLUS_0); + timescale->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); //NI + timescale->setPassiveColor(g_settings.infobar_progressbar ? COL_PROGRESSBAR_PASSIVE_PLUS_0 : COL_INFOBAR_PLUS_0); //NI timescale->enableShadow(!g_settings.infobar_progressbar ? CC_SHADOW_ON : CC_SHADOW_OFF, OFFSET_SHADOW/2); timescale->setValues(pb_p, pb_w); From 21e4bf01d250893554b98511e18584f3d9894fd0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 17:32:46 +0200 Subject: [PATCH 3/6] remove obsolete src/gui/dmx_tspidbandwidth.c Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9ea5bcfd74c789712be6b7887a17398111979cb2 Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - remove obsolete src/gui/dmx_tspidbandwidth.c ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/dmx_tspidbandwidth.c | 235 ----------------------------------- 1 file changed, 235 deletions(-) delete mode 100644 src/gui/dmx_tspidbandwidth.c diff --git a/src/gui/dmx_tspidbandwidth.c b/src/gui/dmx_tspidbandwidth.c deleted file mode 100644 index 07ced12f5..000000000 --- a/src/gui/dmx_tspidbandwidth.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * some definition - */ -#define TS_LEN 188 -#define TS_SYNC_BYTE 0x47 -#define TS_BUF_SIZE (TS_LEN * 2048) /* fix dmx buffer size */ - -static unsigned long timeval_to_ms(const struct timeval *tv) -{ - return (tv->tv_sec * 1000) + ((tv->tv_usec + 500) / 1000); -} - -long delta_time_ms (struct timeval *tv, struct timeval *last_tv) -{ - return timeval_to_ms(tv) - timeval_to_ms(last_tv); -} - -int ts_pidbandwidth (OPTION *opt) -{ - - u_char buf[TS_BUF_SIZE]; - struct pollfd pfd; - struct dmx_pes_filter_params flt; - int dmxfd; - struct timeval tv,last_tv, first_tv; - int pid; - uint64_t b_total; - long b; - long packets_bad; - long packets_total; - struct { // simple struct for storing last average bandwidth - unsigned long kb_sec; - unsigned long b_sec; - } last_avg; - - - - - if (opt->ts_raw_mode) { - pid = PID_FULL_TS; - } else { - pid = opt->pid; - } - - - - indent (0); - out_nl (2,""); - out_nl (2,"---------------------------------------------------------"); - out_nl (2,"PID bandwidth statistics..."); - if (opt->ts_raw_mode) { - out (2,"Full Transponder"); - } else { - out (2,"PID: %u (0x%04x)", pid, pid); - } - if (opt->rd_packet_count != 0) { - out (2," - max packet count: %ld ", opt->rd_packet_count); - } - out_nl (2,""); - out_nl (2,"---------------------------------------------------------"); - - - - // -- open DVR device for reading - pfd.events = POLLIN | POLLPRI; - if((pfd.fd = open(opt->devDvr,O_RDONLY|O_NONBLOCK)) < 0){ - IO_error(opt->devDvr); - return -1; - } - - - - if ((dmxfd=open(opt->devDemux,O_RDWR)) < 0) { - IO_error(opt->devDemux); - close(pfd.fd); - return -1; - } - ioctl (dmxfd,DMX_SET_BUFFER_SIZE, sizeof(buf)); - - flt.pid = pid; - flt.input = DMX_IN_FRONTEND; - flt.output = DMX_OUT_TS_TAP; - flt.pes_type = DMX_PES_OTHER; - flt.flags = DMX_IMMEDIATE_START; - if (ioctl(dmxfd, DMX_SET_PES_FILTER, &flt) < 0) { - IO_error("DMX_SET_PES_FILTER"); - close(pfd.fd); - close(dmxfd); - return -1; - } - - - - gettimeofday (&first_tv, NULL); - last_tv.tv_sec = first_tv.tv_sec; - last_tv.tv_usec = first_tv.tv_usec; - - b_total = 0; - packets_total = 0; - packets_bad = 0; - - while ( !isSigAbort() ) { - int b_len, b_start; - - // -- we will poll the PID in 2 secs intervall - int timeout = 2000; - - b_len = 0; - b_start = 0; - if (poll(&pfd, 1, timeout) > 0) { - if (pfd.revents & POLLIN) { - - b_len = read(pfd.fd, buf, sizeof(buf)); - gettimeofday (&tv, NULL); - - - if (b_len >= TS_LEN) { - b_start = sync_ts (buf, b_len); - } else { - b_len = 0; - } - - b = b_len - b_start; - if (b == 0) continue; - if (b < 0) { - IO_error("read"); - continue; - } - - b_total += b; - - - - // -- calc bandwidth - - { - uint64_t bit_s; - long d_tim_ms; - int packets; - - packets = b/TS_LEN; - packets_total += packets; - - - // output on different verbosity levels - // -- current bandwidth - d_tim_ms = delta_time_ms (&tv, &last_tv); - if (d_tim_ms <= 0) d_tim_ms = 1; // ignore usecs - - out (3, "packets read: %3d/(%ld) d_time: %2ld.%03ld s = ", - packets, packets_total, d_tim_ms / 1000UL, d_tim_ms % 1000UL); - - // -- current bandwidth in kbit/sec - // --- cast to uint64_t so it doesn't overflow as - // --- early, add time / 2 before division for correct rounding - bit_s = (((uint64_t)b * 8000ULL) + ((uint64_t)d_tim_ms / 2ULL)) - / (uint64_t)d_tim_ms; - - out (1, "%5llu.%03llu kbit/s", bit_s / 1000ULL, bit_s % 1000ULL); - - - // -- average bandwidth - d_tim_ms = delta_time_ms (&tv,&first_tv); - if (d_tim_ms <= 0) d_tim_ms = 1; // ignore usecs - - bit_s = ((b_total * 8000ULL) + ((uint64_t)d_tim_ms / 2ULL)) - / (uint64_t)d_tim_ms; - - last_avg.kb_sec = (unsigned long) (bit_s / 1000ULL); - last_avg.b_sec = (unsigned long) (bit_s % 1000ULL); - - out (2, " (Avrg: %5lu.%03lu kbit/s)", last_avg.kb_sec, last_avg.b_sec); - - - // -- bad packet(s) check in buffer - { - int bp; - - bp = ts_error_count (buf+b_start, b); - packets_bad += bp; - out (4, " [bad: %d]", bp); - } - - out_NL (1); - - } - - - last_tv.tv_sec = tv.tv_sec; - last_tv.tv_usec = tv.tv_usec; - - - - // count packets ? - if (opt->rd_packet_count > 0) { - opt->rd_packet_count -= b/TS_LEN; - if (opt->rd_packet_count <= 0) break; - } - - - } - } - - } - - - // -- packets stats - - out (4, "## "); - - if (opt->ts_raw_mode) { out (2,"PID: "); - } else { out (2,"PID: %u (0x%04x)", pid, pid); - } - - out (4, " bad/total packets: %ld/%ld (= %1.1Lf%%)", - packets_bad, packets_total, - (((long double) packets_bad)*100)/packets_total ); - out (4, " Avrg: %5lu.%03lu kbit/s", - last_avg.kb_sec, last_avg.b_sec); - out_NL(4); - - - - - if (ioctl(dmxfd, DMX_STOP) < 0) { - IO_error("DMX_STOP"); - } - close(dmxfd); - close(pfd.fd); - - - return 0; - -} - From 290eb19dae36e1bd4e8f93d1eaee5f7c910a4a50 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 17:32:46 +0200 Subject: [PATCH 4/6] remove obsolete src/driver/wav.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3a1ef47dc4b03b16972797b86da57596c4ce1bc Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - remove obsolete src/driver/wav.h ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/wav.h | 65 ------------------------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 src/driver/wav.h diff --git a/src/driver/wav.h b/src/driver/wav.h deleted file mode 100644 index 1b108b746..000000000 --- a/src/driver/wav.h +++ /dev/null @@ -1,65 +0,0 @@ -static unsigned char click[] = { -0xE5, 0xF5, 0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 0xF7, -0xE5, 0xEE, 0xE5, 0xE7, 0x98, 0xE1, 0xB2, 0xDC, 0xCB, 0xD7, 0xB2, 0xD5, 0x98, 0xD3, 0x98, 0xD3, -0x98, 0xD3, 0xFF, 0xD4, 0x65, 0xD6, 0x32, 0xD9, 0xFF, 0xDB, 0x7F, 0xDF, 0xFF, 0xE2, 0x7F, 0xE6, -0xB2, 0xEA, 0xE5, 0xEE, 0xCB, 0xF3, 0xB2, 0xF8, 0x98, 0xFD, 0x7E, 0x02, 0x17, 0x08, 0xB1, 0x0D, -0xFE, 0x13, 0x4A, 0x1A, 0x97, 0x20, 0x7E, 0x25, 0x17, 0x2B, 0x4A, 0x2F, 0x31, 0x34, 0x4A, 0x36, -0x64, 0x38, 0xFE, 0x36, 0x4A, 0x36, 0x17, 0x32, 0xE4, 0x2D, 0xE4, 0x26, 0xE4, 0x1F, 0x17, 0x16, -0x4A, 0x0C, 0xCA, 0x01, 0xFF, 0xF7, 0x32, 0xEE -}; From d291aa3c22adbd96521ee47123ec07966634efcc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 23:12:41 +0200 Subject: [PATCH 5/6] channellist: simplify MaxChanNr() function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/763f16ccca61817d1c7152dbd9671269ba0a5d55 Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - channellist: simplify MaxChanNr() function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index bb016b2e1..2d02382cc 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -68,6 +68,7 @@ #else #include #endif +#include #include #include @@ -1276,7 +1277,7 @@ int CChannelList::numericZap(int key) } return res; } - size_t maxchansize = MaxChanNr().size(); + size_t maxchansize = MaxChanNr().size(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth(); int sx = maxchansize * fw + (fw/2); int sy = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight() + 6; @@ -2288,19 +2289,14 @@ bool CChannelList::SameTP(CZapitChannel * channel) return iscurrent; } -std::string CChannelList::MaxChanNr() +std::string CChannelList::MaxChanNr() { - zapit_list_it_t chan_it; - std::stringstream ss; - std::string maxchansize; - int chan_nr_max = 1; - unsigned int nr = 0; - for (chan_it=(*chanlist).begin(); chan_it!=(*chanlist).end(); ++chan_it) { - chan_nr_max = std::max(chan_nr_max, (*chanlist)[nr++]->number); + int n = 1; + for (zapit_list_it_t it = (*chanlist).begin(); it != (*chanlist).end(); ++it) + { + n = std::max(n, (*it)->number); } - ss << chan_nr_max; - ss >> maxchansize; - return maxchansize; + return to_string(n); } void CChannelList::paintPig (int _x, int _y, int w, int h) From c03b2777cd4ca834fae528169478c1b18473c865 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 11 Apr 2017 23:12:41 +0200 Subject: [PATCH 6/6] channellist: a bit more offset for item; fix progressbar's width use OFFSET defines for logo in header and in right infozone Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e6746e2aa0d912fcf61aca88c74fd8776f2e00e Author: vanhofen Date: 2017-04-11 (Tue, 11 Apr 2017) Origin message was: ------------------ - channellist: a bit more offset for item; fix progressbar's width use OFFSET defines for logo in header and in right infozone ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 52 +++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2d02382cc..03057fe87 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1900,10 +1900,10 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int prg_offset = 0; int title_offset = 0; int rec_mode; - if(g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) + if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); - title_offset = OFFSET_INNER_SMALL; + title_offset = OFFSET_INNER_MID; } snprintf(tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number); @@ -1994,16 +1994,16 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (curr == selected && move_state == beMoving) { frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight); } else if (edit_state && chan->bLocked) { frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight); } else if (g_settings.channellist_show_numbers) { - int numpos = x + OFFSET_INNER_SMALL + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); + int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight); } else if (!edit_state) @@ -2017,9 +2017,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint) else l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); - int pb_space = prg_offset - title_offset; + int pb_width = prg_offset; int pb_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getDigitHeight(); - CProgressBar pb(x + OFFSET_INNER_SMALL + numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0); + CProgressBar pb(x + OFFSET_INNER_MID + numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_width, pb_height, COL_MENUCONTENT_PLUS_0); pb.setType(CProgressBar::PB_TIMESCALE); pb.setDesign(g_settings.theme.progressbar_design_channellist); pb.setCornerType(0); @@ -2032,28 +2032,28 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } pb.setFrameThickness(pb_frame); pb.doPaintBg(false); - int pb_max = pb_space - 4; if (!(p_event->description.empty())) { - snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); + snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l, g_settings.channellist_epgtext_align_right ? " " : " - "); unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description); - int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 2*OFFSET_INNER_MID - offset_right; // 15 = scrollbar + int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 3*OFFSET_INNER_MID - offset_right; // 15 = scrollbar if (max_desc_len < 0) max_desc_len = 0; if ((int) ch_desc_len > max_desc_len) ch_desc_len = max_desc_len; - if(g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { + if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) + { if(displayNext) { struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_SMALL + numwidth + 6, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); } else { @@ -2063,32 +2063,34 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (((jetzt - p_event->startTime + 30) / 60) < 0 ) runningPercent= 0; else - runningPercent=(jetzt-p_event->startTime) * pb_max / p_event->duration; + runningPercent=(jetzt-p_event->startTime) * pb_width / p_event->duration; - pb.setValues(runningPercent, pb_max); + pb.setValues(runningPercent, pb_width); pb.paint(); } } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); - if (g_settings.channellist_epgtext_align_right) { + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + if (g_settings.channellist_epgtext_align_right) + { // align right g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 15 - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } - else { + else + { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + ch_name_len + OFFSET_INNER_SMALL + prg_offset, ypos + fheight, ch_desc_len, p_event->description, ecolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID + ch_name_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } } else { if (g_settings.theme.progressbar_design_channellist != CProgressBar::PB_OFF) { - pb.setValues(0, pb_max); + pb.setValues(0, pb_width); pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); } if (!firstpaint && curr == selected) updateVfd(); @@ -2157,7 +2159,7 @@ void CChannelList::paintHead() if (!header->getContextBtnObject()->empty()) header->removeContextButtons(); header->enableClock(true, "%H:%M", "%H %M", true); - logo_off = header->getClockObject()->getWidth() + 10; + logo_off = header->getClockObject()->getWidth() + OFFSET_INNER_MID; header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); }else{ @@ -2168,7 +2170,7 @@ void CChannelList::paintHead() } } else - logo_off = 10; + logo_off = OFFSET_INNER_MID; header->paint(CC_SAVE_SCREEN_NO); } @@ -2382,7 +2384,7 @@ void CChannelList::paint_events(CChannelEventList &evtlist) frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; - int eventStartTimeWidth = 4 * g_Font[eventFont]->getMaxDigitWidth() + g_Font[eventFont]->getRenderWidth(":") + 5; // use a fixed value + int eventStartTimeWidth = 4 * g_Font[eventFont]->getMaxDigitWidth() + g_Font[eventFont]->getRenderWidth(":") + OFFSET_INNER_SMALL; // use a fixed value int startTimeWidth = 0; CChannelEventList::iterator e; time_t azeit; @@ -2431,9 +2433,9 @@ void CChannelList::paint_events(CChannelEventList &evtlist) strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit ); //printf("%s %s\n", startTime, e->description.c_str()); startTimeWidth = eventStartTimeWidth; - g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color); + g_Font[eventFont]->RenderString(x+ width+ OFFSET_INNER_MID, y+ theight+ pig_height + i*ffheight, startTimeWidth, startTime, color); } - g_Font[eventFont]->RenderString(x+ width+5+startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 20, e->description, color); + g_Font[eventFont]->RenderString(x+ width+ OFFSET_INNER_MID +startTimeWidth, y+ theight+ pig_height + i*ffheight, infozone_width - startTimeWidth - 2*OFFSET_INNER_MID, e->description, color); } else {