diff options
| author | Fraxinas <andreas.frisch@multimedia-labs.de> | 2010-06-11 23:06:20 +0200 |
|---|---|---|
| committer | Fraxinas <andreas.frisch@multimedia-labs.de> | 2010-06-11 23:06:20 +0200 |
| commit | 681626f670c65e4ab063dd08840559c767da32fb (patch) | |
| tree | a32042ee478ead46931db2429fd97c46a7322d44 /lib | |
| parent | f7f442a1d0845e7dfd923c1d783eb612357f3e94 (diff) | |
| parent | 1445e37b9d2b2d17009cf2b91c24b895a288a702 (diff) | |
| download | enigma2-681626f670c65e4ab063dd08840559c767da32fb.tar.gz enigma2-681626f670c65e4ab063dd08840559c767da32fb.zip | |
Merge branch 'experimental' of git.opendreambox.org:/git/enigma2 into experimental
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dvb/epgcache.cpp | 8 | ||||
| -rw-r--r-- | lib/dvb/frontend.cpp | 2 | ||||
| -rw-r--r-- | lib/dvb/sec.h | 6 | ||||
| -rw-r--r-- | lib/gdi/font.cpp | 89 | ||||
| -rw-r--r-- | lib/gdi/glcddc.cpp | 8 | ||||
| -rw-r--r-- | lib/gdi/gpixmap.cpp | 194 | ||||
| -rw-r--r-- | lib/gdi/lcd.cpp | 103 | ||||
| -rw-r--r-- | lib/gdi/lcd.h | 6 | ||||
| -rw-r--r-- | lib/python/Components/NimManager.py | 124 | ||||
| -rwxr-xr-x | lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 19 | ||||
| -rwxr-xr-x | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 11 | ||||
| -rwxr-xr-x[-rw-r--r--] | lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py | 14 | ||||
| -rwxr-xr-x[-rw-r--r--] | lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py | 14 |
13 files changed, 439 insertions, 159 deletions
diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 48cbfbfd..1e8414c3 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -1457,7 +1457,7 @@ void eEPGCache::channel_data::readData( const __u8 *data) } tidMap &seenSections = this->seenSections[map]; tidMap &calcedSections = this->calcedSections[map]; - if ( state == 1 && calcedSections == seenSections || state > 1 ) + if ( (state == 1 && calcedSections == seenSections) || state > 1 ) { eDebugNoNewLine("[EPGC] "); switch (source) @@ -2562,7 +2562,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler) { __u8 buffer[10]; (*desc)->writeToBuffer(buffer); - if (!strncmp((unsigned char*)buffer+2, "EPGDATA", 7)) + if (!strncmp((char*)buffer+2, "EPGDATA", 7)) { eServiceReferenceDVB ref; if (!pmthandler->getServiceReference(ref)) @@ -2571,7 +2571,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler) messages.send(Message(Message::got_mhw2_channel_pid, ref, pid)); } } - else if(!strncmp((unsigned char*)buffer+2, "FICHAS", 6)) + else if(!strncmp((char*)buffer+2, "FICHAS", 6)) { eServiceReferenceDVB ref; if (!pmthandler->getServiceReference(ref)) @@ -2580,7 +2580,7 @@ void eEPGCache::PMTready(eDVBServicePMTHandler *pmthandler) messages.send(Message(Message::got_mhw2_summary_pid, ref, pid)); } } - else if(!strncmp((unsigned char*)buffer+2, "GENEROS", 7)) + else if(!strncmp((char*)buffer+2, "GENEROS", 7)) { eServiceReferenceDVB ref; if (!pmthandler->getServiceReference(ref)) diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index bd8f0028..0081e324 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1124,7 +1124,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS & PutToDict(dict, "orbital_position", orb_pos); PutToDict(dict, "polarization", polarization); - switch(parm_u_qpsk_fec_inner) + switch((int)parm_u_qpsk_fec_inner) { case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break; case FEC_2_3: tmp = eDVBFrontendParametersSatellite::FEC_2_3; break; diff --git a/lib/dvb/sec.h b/lib/dvb/sec.h index 5d73bb7b..ef8b1e0c 100644 --- a/lib/dvb/sec.h +++ b/lib/dvb/sec.h @@ -133,6 +133,12 @@ public: { return secSequence.size(); } + eSecCommandList &operator=(const eSecCommandList &lst) + { + secSequence = lst.secSequence; + cur = begin(); + return *this; + } }; #endif diff --git a/lib/gdi/font.cpp b/lib/gdi/font.cpp index f27a8f77..74cda40e 100644 --- a/lib/gdi/font.cpp +++ b/lib/gdi/font.cpp @@ -6,6 +6,11 @@ #include <pthread.h> #include <sys/types.h> #include <unistd.h> +#include <byteswap.h> + +#ifndef BYTE_ORDER +#error "no BYTE_ORDER defined!" +#endif // use this for init Freetype... #include <ft2build.h> @@ -766,8 +771,9 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons gColor *lookup8, lookup8_invert[16]; gColor *lookup8_normal=0; + __u16 lookup16_normal[16], lookup16_invert[16], *lookup16; __u32 lookup32_normal[16], lookup32_invert[16], *lookup32; - + if (surface->bpp == 8) { if (surface->clut.data) @@ -781,10 +787,33 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons opcode=0; } else opcode=1; + } else if (surface->bpp == 16) + { + opcode=2; + for (int i=0; i<16; ++i) + { +#define BLEND(y, x, a) (y + (((x-y) * a)>>8)) + unsigned char da = background.a, dr = background.r, dg = background.g, db = background.b; + int sa = i * 16; + if (sa < 256) + { + dr = BLEND(background.r, foreground.r, sa) & 0xFF; + dg = BLEND(background.g, foreground.g, sa) & 0xFF; + db = BLEND(background.b, foreground.b, sa) & 0xFF; + } +#undef BLEND +#if BYTE_ORDER == LITTLE_ENDIAN + lookup16_normal[i] = bswap_16(((db >> 3) << 11) | ((dg >> 2) << 5) | (dr >> 3)); +#else + lookup16_normal[i] = ((db >> 3) << 11) | ((dg >> 2) << 5) | (dr >> 3); +#endif + da ^= 0xFF; + } + for (int i=0; i<16; ++i) + lookup16_invert[i]=lookup16_normal[i^0xF]; } else if (surface->bpp == 32) { opcode=3; - for (int i=0; i<16; ++i) { #define BLEND(y, x, a) (y + (((x-y) * a)>>8)) @@ -809,7 +838,7 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons eWarning("can't render to %dbpp", surface->bpp); return; } - + gRegion area(eRect(0, 0, surface->x, surface->y)); gRegion clip = dc.getClip() & area; @@ -835,10 +864,12 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons if (!(i->flags & GS_INVERT)) { lookup8 = lookup8_normal; + lookup16 = lookup16_normal; lookup32 = lookup32_normal; } else { lookup8 = lookup8_invert; + lookup16 = lookup16_invert; lookup32 = lookup32_invert; } @@ -873,46 +904,76 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons d+=diff*buffer_stride; } if (sx>0) - for (int ay=0; ay<sy; ay++) - { - if (!opcode) // 4bit lookup to 8bit + { + switch(opcode) { + case 0: // 4bit lookup to 8bit + for (int ay=0; ay<sy; ay++) { register __u8 *td=d; register int ax; - for (ax=0; ax<sx; ax++) - { + { register int b=(*s++)>>4; if(b) *td++=lookup8[b]; else td++; } - } else if (opcode == 1) // 8bit direct + s+=glyph_bitmap->pitch-sx; + d+=buffer_stride; + } + break; + case 1: // 8bit direct + for (int ay=0; ay<sy; ay++) { register __u8 *td=d; register int ax; for (ax=0; ax<sx; ax++) - { + { register int b=*s++; *td++^=b; } - } else + s+=glyph_bitmap->pitch-sx; + d+=buffer_stride; + } + break; + case 2: // 16bit + for (int ay=0; ay<sy; ay++) + { + register __u16 *td=(__u16*)d; + register int ax; + for (ax=0; ax<sx; ax++) + { + register int b=(*s++)>>4; + if(b) + *td++=lookup16[b]; + else + td++; + } + s+=glyph_bitmap->pitch-sx; + d+=buffer_stride; + } + break; + case 3: // 32bit + for (int ay=0; ay<sy; ay++) { register __u32 *td=(__u32*)d; register int ax; for (ax=0; ax<sx; ax++) - { + { register int b=(*s++)>>4; if(b) *td++=lookup32[b]; else td++; } + s+=glyph_bitmap->pitch-sx; + d+=buffer_stride; } - s+=glyph_bitmap->pitch-sx; - d+=buffer_stride; + default: + break; } + } } } } diff --git a/lib/gdi/glcddc.cpp b/lib/gdi/glcddc.cpp index 8612c70b..a593cfa3 100644 --- a/lib/gdi/glcddc.cpp +++ b/lib/gdi/glcddc.cpp @@ -14,13 +14,13 @@ gLCDDC::gLCDDC() surface.x=lcd->size().width(); surface.y=lcd->size().height(); - surface.bpp=8; - surface.bypp=1; surface.stride=lcd->stride(); + surface.bypp=surface.stride / surface.x; + surface.bpp=surface.bypp*8; surface.data=lcd->buffer(); - - surface.clut.colors=256; + surface.clut.colors=0; surface.clut.data=0; + m_pixmap = new gPixmap(&surface); } diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp index 3e643108..0e8d39ec 100644 --- a/lib/gdi/gpixmap.cpp +++ b/lib/gdi/gpixmap.cpp @@ -3,6 +3,11 @@ #include <lib/gdi/gpixmap.h> #include <lib/gdi/region.h> #include <lib/gdi/accel.h> +#include <byteswap.h> + +#ifndef BYTE_ORDER +#error "no BYTE_ORDER defined!" +#endif gLookup::gLookup() :size(0), lookup(0) @@ -154,6 +159,26 @@ void gPixmap::fill(const gRegion ®ion, const gColor &color) { for (int y=area.top(); y<area.bottom(); y++) memset(((__u8*)surface->data)+y*surface->stride+area.left(), color.color, area.width()); + } else if (surface->bpp == 16) + { + __u32 icol; + + if (surface->clut.data && color < surface->clut.colors) + icol=(surface->clut.data[color].a<<24)|(surface->clut.data[color].r<<16)|(surface->clut.data[color].g<<8)|(surface->clut.data[color].b); + else + icol=0x10101*color; +#if BYTE_ORDER == LITTLE_ENDIAN + __u16 col = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19); +#else + __u16 col = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19; +#endif + for (int y=area.top(); y<area.bottom(); y++) + { + __u16 *dst=(__u16*)(((__u8*)surface->data)+y*surface->stride+area.left()*surface->bypp); + int x=area.width(); + while (x--) + *dst++=col; + } } else if (surface->bpp == 32) { __u32 col; @@ -208,18 +233,33 @@ void gPixmap::fill(const gRegion ®ion, const gRGB &color) while (x--) *dst++=col; } + } else if (surface->bpp == 16) + { + __u32 icol = color.argb(); +#if BYTE_ORDER == LITTLE_ENDIAN + __u16 col = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19); +#else + __u16 col = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19; +#endif + for (int y=area.top(); y<area.bottom(); y++) + { + __u16 *dst=(__u16*)(((__u8*)surface->data)+y*surface->stride+area.left()*surface->bypp); + int x=area.width(); + while (x--) + *dst++=col; + } } else eWarning("couldn't rgbfill %d bpp", surface->bpp); } } -static void blit_8i_to_32(__u32 *dst, __u8 *src, __u32 *pal, int width) +static inline void blit_8i_to_32(__u32 *dst, __u8 *src, __u32 *pal, int width) { while (width--) *dst++=pal[*src++]; } -static void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width) +static inline void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width) { while (width--) { @@ -232,6 +272,25 @@ static void blit_8i_to_32_at(__u32 *dst, __u8 *src, __u32 *pal, int width) } } +static inline void blit_8i_to_16(__u16 *dst, __u8 *src, __u32 *pal, int width) +{ + while (width--) + *dst++=pal[*src++] & 0xFFFF; +} + +static inline void blit_8i_to_16_at(__u16 *dst, __u8 *src, __u32 *pal, int width) +{ + while (width--) + { + if (!(pal[*src]&0x80000000)) + { + src++; + dst++; + } else + *dst++=pal[*src++] & 0xFFFF; + } +} + /* WARNING, this function is not endian safe! */ static void blit_8i_to_32_ab(__u32 *dst, __u8 *src, __u32 *pal, int width) { @@ -441,6 +500,95 @@ void gPixmap::blit(const gPixmap &src, const eRect &_pos, const gRegion &clip, i srcptr+=src.surface->stride; dstptr+=surface->stride; } + } else if ((surface->bpp == 16) && (src.surface->bpp==8)) + { + __u8 *srcptr=(__u8*)src.surface->data; + __u8 *dstptr=(__u8*)surface->data; // !! + __u32 pal[256]; + + for (int i=0; i<256; ++i) + { + __u32 icol; + if (src.surface->clut.data && (i<src.surface->clut.colors)) + icol=(src.surface->clut.data[i].a<<24)|(src.surface->clut.data[i].r<<16)|(src.surface->clut.data[i].g<<8)|(src.surface->clut.data[i].b); + else + icol=0x010101*i; +#if BYTE_ORDER == LITTLE_ENDIAN + pal[i] = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19); +#else + pal[i] = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19; +#endif + pal[i]^=0xFF000000; + } + + srcptr+=srcarea.left()*src.surface->bypp+srcarea.top()*src.surface->stride; + dstptr+=area.left()*surface->bypp+area.top()*surface->stride; + + if (flag & blitAlphaBlend) + eWarning("ignore unsupported 8bpp -> 16bpp alphablend!"); + + for (int y=0; y<area.height(); y++) + { + int width=area.width(); + unsigned char *psrc=(unsigned char*)srcptr; + __u16 *dst=(__u16*)dstptr; + if (flag & blitAlphaTest) + blit_8i_to_16_at(dst, psrc, pal, width); + else + blit_8i_to_16(dst, psrc, pal, width); + srcptr+=src.surface->stride; + dstptr+=surface->stride; + } + } else if ((surface->bpp == 16) && (src.surface->bpp==32)) + { + __u8 *srcptr=(__u8*)src.surface->data; + __u8 *dstptr=(__u8*)surface->data; + + srcptr+=srcarea.left()+srcarea.top()*src.surface->stride; + dstptr+=area.left()+area.top()*surface->stride; + + if (flag & blitAlphaBlend) + eWarning("ignore unsupported 32bpp -> 16bpp alphablend!"); + + for (int y=0; y<area.height(); y++) + { + int width=area.width(); + __u32 *srcp=(__u32*)srcptr; + __u16 *dstp=(__u16*)dstptr; + + if (flag & blitAlphaTest) + { + while (width--) + { + if (!((*srcp)&0xFF000000)) + { + srcp++; + dstp++; + } else + { + __u32 icol = *srcp++; +#if BYTE_ORDER == LITTLE_ENDIAN + *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19); +#else + *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19; +#endif + } + } + } else + { + while (width--) + { + __u32 icol = *srcp++; +#if BYTE_ORDER == LITTLE_ENDIAN + *dstp++ = bswap_16(((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19); +#else + *dstp++ = ((icol & 0xFF) >> 3) << 11 | ((icol & 0xFF00) >> 10) << 5 | (icol & 0xFF0000) >> 19; +#endif + } + } + srcptr+=src.surface->stride; + dstptr+=surface->stride; + } } else eWarning("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp); } @@ -488,27 +636,34 @@ static inline int sgn(int a) void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color) { __u8 *srf8 = 0; - __u32 *srf32 = 0; + __u16 *srf16 = 0; + __u32 *srf32 = 0; int stride = surface->stride; - + if (clip.rects.empty()) return; - + + __u16 col16; __u32 col = 0; if (surface->bpp == 8) - { srf8 = (__u8*)surface->data; - } else if (surface->bpp == 32) + else { srf32 = (__u32*)surface->data; - if (surface->clut.data && color < surface->clut.colors) col=(surface->clut.data[color].a<<24)|(surface->clut.data[color].r<<16)|(surface->clut.data[color].g<<8)|(surface->clut.data[color].b); else col=0x10101*color; - col^=0xFF000000; + col^=0xFF000000; } - + + if (surface->bpp == 16) +#if BYTE_ORDER == LITTLE_ENDIAN + col16=bswap_16(((col & 0xFF) >> 3) << 11 | ((col & 0xFF00) >> 10) << 5 | (col & 0xFF0000) >> 19); +#else + col16=((col & 0xFF) >> 3) << 11 | ((col & 0xFF00) >> 10) << 5 | (col & 0xFF0000) >> 19; +#endif + int xa = start.x(), ya = start.y(), xb = dst.x(), yb = dst.y(); int dx, dy, x, y, s1, s2, e, temp, swap, i; dy=abs(yb-ya); @@ -526,7 +681,7 @@ void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color) } else swap=0; e = 2*dy-dx; - + int lasthit = 0; for(i=1; i<=dx; i++) { @@ -563,20 +718,25 @@ void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color) } while (!clip.rects[a].contains(x, y)); lasthit = a; } - + if (srf8) srf8[y * stride + x] = color; - if (srf32) + else if (srf16) + srf16[y * stride/2 + x] = col16; + else srf32[y * stride/4 + x] = col; fail: while (e>=0) { - if (swap==1) x+=s1; - else y+=s2; + if (swap==1) + x+=s1; + else + y+=s2; e-=2*dx; } - if (swap==1) - y+=s2; + + if (swap==1) + y+=s2; else x+=s1; e+=2*dy; diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp index 0908d890..a953ef0d 100644 --- a/lib/gdi/lcd.cpp +++ b/lib/gdi/lcd.cpp @@ -14,13 +14,19 @@ eDBoxLCD *eDBoxLCD::instance; -eLCD::eLCD(eSize size): res(size) +eLCD::eLCD() { lcdfd = -1; locked=0; - _buffer=new unsigned char[res.height()*res.width()]; - memset(_buffer, 0, res.height()*res.width()); - _stride=res.width(); +} + +void eLCD::setSize(int xres, int yres, int bpp) +{ + res = eSize(xres, yres); + _buffer=new unsigned char[xres * yres * bpp/8]; + memset(_buffer, 0, res.height()*res.width()*bpp/8); + _stride=res.width()*bpp/8; + eDebug("lcd buffer %p %d bytes, stride %d", _buffer, xres*yres*bpp/8, _stride); } eLCD::~eLCD() @@ -42,8 +48,9 @@ void eLCD::unlock() locked=0; } -eDBoxLCD::eDBoxLCD(): eLCD(eSize(132, 64)) +eDBoxLCD::eDBoxLCD() { + int xres=132, yres=64, bpp=8; is_oled = 0; #ifndef NO_LCD lcdfd = open("/dev/dbox/oled0", O_RDWR); @@ -75,13 +82,37 @@ eDBoxLCD::eDBoxLCD(): eLCD(eSize(132, 64)) int i=LCD_MODE_BIN; ioctl(lcdfd, LCD_IOCTL_ASC_MODE, &i); inverted=0; + FILE *f = fopen("/proc/stb/lcd/xres", "r"); + if (f) + { + int tmp; + if (fscanf(f, "%x", &tmp) == 1) + xres = tmp; + fclose(f); + f = fopen("/proc/stb/lcd/yres", "r"); + if (f) + { + if (fscanf(f, "%x", &tmp) == 1) + yres = tmp; + fclose(f); + f = fopen("/proc/stb/lcd/bpp", "r"); + if (f) + { + if (fscanf(f, "%x", &tmp) == 1) + bpp = tmp; + fclose(f); + } + } + is_oled = 3; + } } + setSize(xres, yres, bpp); } void eDBoxLCD::setInverted(unsigned char inv) { inverted=inv; - update(); + update(); } int eDBoxLCD::setLCDContrast(int contrast) @@ -145,42 +176,52 @@ eDBoxLCD *eDBoxLCD::getInstance() void eDBoxLCD::update() { - if (!is_oled || is_oled == 2) + if (lcdfd >= 0) { - unsigned char raw[132*8]; - int x, y, yy; - for (y=0; y<8; y++) + if (!is_oled || is_oled == 2) { - for (x=0; x<132; x++) + unsigned char raw[132*8]; + int x, y, yy; + for (y=0; y<8; y++) { - int pix=0; - for (yy=0; yy<8; yy++) + for (x=0; x<132; x++) { - pix|=(_buffer[(y*8+yy)*132+x]>=108)<<yy; + int pix=0; + for (yy=0; yy<8; yy++) + { + pix|=(_buffer[(y*8+yy)*132+x]>=108)<<yy; + } + raw[y*132+x]=(pix^inverted); } - raw[y*132+x]=(pix^inverted); } - } - if (lcdfd >= 0) write(lcdfd, raw, 132*8); - } else - { - unsigned char raw[64*64]; - int x, y; - memset(raw, 0, 64*64); - for (y=0; y<64; y++) + } + else if (is_oled == 3) { + FILE *f = fopen("/tmp/bla", "w+"); + if (f) { + fwrite(_buffer, _stride * res.height(), 1, f); + fclose(f); + } + write(lcdfd, _buffer, _stride * res.height()); + } + else { - int pix=0; - for (x=0; x<128 / 2; x++) + unsigned char raw[64*64]; + int x, y; + memset(raw, 0, 64*64); + for (y=0; y<64; y++) { - pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4); - if (inverted) - pix = 0xFF - pix; - raw[y*64+x] = pix; + int pix=0; + for (x=0; x<128 / 2; x++) + { + pix = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4); + if (inverted) + pix = 0xFF - pix; + raw[y*64+x] = pix; + } } - } - if (lcdfd >= 0) write(lcdfd, raw, 64*64); + } } } diff --git a/lib/gdi/lcd.h b/lib/gdi/lcd.h index 99f921b5..e7b4c2c4 100644 --- a/lib/gdi/lcd.h +++ b/lib/gdi/lcd.h @@ -13,10 +13,11 @@ class eLCD { #ifdef SWIG - eLCD(eSize size); + eLCD(); ~eLCD(); #else protected: + void setSize(int xres, int yres, int bpp); eSize res; unsigned char *_buffer; int lcdfd; @@ -29,12 +30,11 @@ public: int islocked() { return locked; } bool detected() { return lcdfd >= 0; } #ifndef SWIG - eLCD(eSize size); + eLCD(); virtual ~eLCD(); __u8 *buffer() { return (__u8*)_buffer; } int stride() { return _stride; } eSize size() { return res; } - virtual void update()=0; #endif }; diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 9520f972..2deb2bf7 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -293,17 +293,9 @@ class SecConfigure: sec.setLNBLOFH(10600000) sec.setLNBThreshold(11700000) elif currLnb.lof.value == "unicable": - if currLnb.unicable.value == "unicable_user": -#TODO satpositions for satcruser - sec.setLNBLOFL(currLnb.lofl.value * 1000) - sec.setLNBLOFH(currLnb.lofh.value * 1000) - sec.setLNBThreshold(currLnb.threshold.value * 1000) - sec.setLNBSatCR(currLnb.satcruser.index) - sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000) - sec.setLNBSatCRpositions(1) #HACK - elif currLnb.unicable.value == "unicable_matrix": - manufacturer_name = currLnb.unicableMatrixManufacturer.value - manufacturer = currLnb.unicableMatrix[manufacturer_name] + def setupUnicable(configManufacturer, ProductDict): + manufacturer_name = configManufacturer.value + manufacturer = ProductDict[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) @@ -311,22 +303,22 @@ class SecConfigure: sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) - currLnb.unicableMatrixManufacturer.save_forced = True + configManufacturer.save_forced = True manufacturer.product.save_forced = True manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True + + if currLnb.unicable.value == "unicable_user": +#TODO satpositions for satcruser + sec.setLNBLOFL(currLnb.lofl.value * 1000) + sec.setLNBLOFH(currLnb.lofh.value * 1000) + sec.setLNBThreshold(currLnb.threshold.value * 1000) + sec.setLNBSatCR(currLnb.satcruser.index) + sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000) + sec.setLNBSatCRpositions(1) #HACK + elif currLnb.unicable.value == "unicable_matrix": + setupUnicable(currLnb.unicableMatrixManufacturer, currLnb.unicableMatrix) elif currLnb.unicable.value == "unicable_lnb": - manufacturer_name = currLnb.unicableLnbManufacturer.value - manufacturer = currLnb.unicableLnb[manufacturer_name] - product_name = manufacturer.product.value - sec.setLNBSatCR(manufacturer.scr[product_name].index) - sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) - sec.setLNBSatCRpositions(manufacturer.positions[product_name][0].value) - sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) - sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) - sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) - currLnb.unicableLnbManufacturer.save_forced = True - manufacturer.product.save_forced = True - manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True + setupUnicable(currLnb.unicableLnbManufacturer, currLnb.unicableLnb) elif currLnb.lof.value == "c_band": sec.setLNBLOFL(5150000) sec.setLNBLOFH(5150000) @@ -1138,72 +1130,60 @@ def InitNimManager(nimmgr): else: section.unicable = ConfigSelection(choices = {"unicable_user": _("User defined")}, default = "unicable_user") - if lnb < 3: - section.unicableMatrix = ConfigSubDict() - section.unicableMatrixManufacturer = ConfigSelection(choices = UnicableMatrixManufacturers, default = UnicableMatrixManufacturers[0]) - for y in unicablematrixproducts: - products = unicablematrixproducts[y].keys() + def fillUnicableConf(sectionDict, unicableproducts, vco_null_check): + for y in unicableproducts: + products = unicableproducts[y].keys() products.sort() tmp = ConfigSubsection() tmp.product = ConfigSelection(choices = products, default = products[0]) tmp.scr = ConfigSubDict() tmp.vco = ConfigSubDict() + tmp.lofl = ConfigSubDict() + tmp.lofh = ConfigSubDict() + tmp.loft = ConfigSubDict() + tmp.positions = ConfigSubDict() for z in products: scrlist = [] - vcolist = unicablematrixproducts[y][z] + vcolist = unicableproducts[y][z] tmp.vco[z] = ConfigSubList() for cnt in range(1,1+len(vcolist)-1): vcofreq = int(vcolist[cnt-1]) - if vcofreq == 0: + if vcofreq == 0 and vco_null_check: scrlist.append(("%d" %cnt,"SCR %d " %cnt +_("not used"))) else: scrlist.append(("%d" %cnt,"SCR %d" %cnt)) tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq))) - tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) - section.unicableMatrix[y] = tmp + tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) + + positions = int(vcolist[len(vcolist)-1][0]) + tmp.positions[z] = ConfigSubList() + tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) + + lofl = vcolist[len(vcolist)-1][1] + tmp.lofl[z] = ConfigSubList() + tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl))) + + lofh = int(vcolist[len(vcolist)-1][2]) + tmp.lofh[z] = ConfigSubList() + tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh))) + + loft = int(vcolist[len(vcolist)-1][3]) + tmp.loft[z] = ConfigSubList() + tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft))) + sectionDict[y] = tmp + + if lnb < 3: + print "MATRIX" + section.unicableMatrix = ConfigSubDict() + section.unicableMatrixManufacturer = ConfigSelection(UnicableMatrixManufacturers, UnicableMatrixManufacturers[0]) + fillUnicableConf(section.unicableMatrix, unicablematrixproducts, True) if lnb < 2: + print "LNB" section.unicableLnb = ConfigSubDict() section.unicableLnbManufacturer = ConfigSelection(UnicableLnbManufacturers, UnicableLnbManufacturers[0]) - for y in unicablelnbproducts: - products = unicablelnbproducts[y].keys() - products.sort() - tmp = ConfigSubsection() - tmp.product = ConfigSelection(choices = products, default = products[0]) - tmp.scr = ConfigSubDict() - tmp.vco = ConfigSubDict() - tmp.lofl = ConfigSubDict() - tmp.lofh = ConfigSubDict() - tmp.loft = ConfigSubDict() - tmp.positions = ConfigSubDict() - for z in products: - scrlist = [] - vcolist = unicablelnbproducts[y][z] - tmp.vco[z] = ConfigSubList() - for cnt in range(1,1+len(vcolist)-1): - scrlist.append(("%d" %cnt,"SCR %d" %cnt)) - vcofreq = int(vcolist[cnt-1]) - tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq))) - tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) - - positions = int(vcolist[len(vcolist)-1][0]) - tmp.positions[z] = ConfigSubList() - tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) - - lofl = vcolist[len(vcolist)-1][1] - tmp.lofl[z] = ConfigSubList() - tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl))) - - lofh = int(vcolist[len(vcolist)-1][2]) - tmp.lofh[z] = ConfigSubList() - tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh))) - - loft = int(vcolist[len(vcolist)-1][3]) - tmp.loft[z] = ConfigSubList() - tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft))) - - section.unicableLnb[y] = tmp - + fillUnicableConf(section.unicableLnb, unicablelnbproducts, False) + #TODO satpositions for satcruser section.satcruser = ConfigSelection(advanced_lnb_satcruser_choices, default="1") tmp = ConfigSubList() diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index e092e82f..64b4ae50 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -88,8 +88,8 @@ class FileBrowser(Screen): self.close(None) class DVDSummary(Screen): - skin = """ - <screen position="0,0" size="132,64"> + skin = ( + """<screen name="DVDSummary" position="0,0" size="132,64" id="1"> <widget source="session.CurrentService" render="Label" position="5,4" size="120,28" font="Regular;12" transparent="1" > <convert type="ServiceName">Name</convert> </widget> @@ -101,7 +101,20 @@ class DVDSummary(Screen): <widget source="session.CurrentService" render="Progress" position="6,46" size="60,18" borderWidth="1" > <convert type="ServicePosition">Position</convert> </widget> - </screen>""" + </screen>""", + """<screen name="DVDSummary" position="0,0" size="96,64" id="2"> + <widget source="session.CurrentService" render="Label" position="0,0" size="96,25" font="Regular;12" transparent="1" > + <convert type="ServiceName">Name</convert> + </widget> + <widget name="DVDPlayer" position="0,26" size="96,12" font="Regular;10" transparent="1" /> + <widget name="Chapter" position="0,40" size="66,12" font="Regular;10" transparent="1" halign="left" /> + <widget source="session.CurrentService" render="Label" position="66,40" size="30,12" font="Regular;10" transparent="1" halign="right" > + <convert type="ServicePosition">Position</convert> + </widget> + <widget source="session.CurrentService" render="Progress" position="0,52" size="96,12" borderWidth="1" > + <convert type="ServicePosition">Position</convert> + </widget> + </screen>""") def __init__(self, session, parent): Screen.__init__(self, session, parent) diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 15806e8c..e4bdba12 100755 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -925,12 +925,17 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB self.clear_playlist() class MediaPlayerLCDScreen(Screen): - skin = """ - <screen position="0,0" size="132,64" title="LCD Text"> + skin = ( + """<screen name="MediaPlayerLCDScreen" position="0,0" size="132,64" id="1"> <widget name="text1" position="4,0" size="132,35" font="Regular;16"/> <widget name="text3" position="4,36" size="132,14" font="Regular;10"/> <widget name="text4" position="4,49" size="132,14" font="Regular;10"/> - </screen>""" + </screen>""", + """<screen name="MediaPlayerLCDScreen" position="0,0" size="96,64" id="2"> + <widget name="text1" position="0,0" size="96,35" font="Regular;14"/> + <widget name="text3" position="0,36" size="96,14" font="Regular;10"/> + <widget name="text4" position="0,49" size="96,14" font="Regular;10"/> + </screen>""") def __init__(self, session, parent): Screen.__init__(self, session) diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py b/lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py index 8986560b..7a0da851 100644..100755 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py @@ -39,13 +39,19 @@ class writeNAND(Task): self.output_line = data class NFISummary(Screen): - skin = """ - <screen position="0,0" size="132,64"> + skin = ( + """<screen name="NFISummary" position="0,0" size="132,64" id="1"> <widget source="title" render="Label" position="2,0" size="120,14" valign="center" font="Regular;12" /> <widget source="content" render="Label" position="2,14" size="120,34" font="Regular;12" transparent="1" zPosition="1" /> - <widget source="job_progresslabel" render="Label" position="66,50" size="60,14" font="Regular;12" transparent="1" halign="right" zPosition="0" /> <widget source="job_progressbar" render="Progress" position="2,50" size="66,14" borderWidth="1" /> - </screen>""" + <widget source="job_progresslabel" render="Label" position="66,50" size="60,14" font="Regular;12" transparent="1" halign="right" zPosition="0" /> + </screen>""", + """<screen name="NFISummary" position="0,0" size="96,64" id="2"> + <widget source="title" render="Label" position="0,0" size="96,14" valign="center" font="Regular;10" /> + <widget source="content" render="Label" position="0,14" size="96,34" font="Regular;10" transparent="1" zPosition="1" /> + <widget source="job_progressbar" render="Progress" position="0,50" size="50,14" borderWidth="1" /> + <widget source="job_progresslabel" render="Label" position="50,50" size="46,14" font="Regular;10" transparent="1" halign="right" zPosition="0" /> + </screen>""") def __init__(self, session, parent): Screen.__init__(self, session, parent) diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py index 3c76685e..9b9044ee 100644..100755 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py @@ -12,14 +12,22 @@ from Tools.HardwareInfo import HardwareInfo config.misc.showtestcard = ConfigBoolean(default = False) class VideoWizardSummary(WizardSummary): - skin = """ - <screen position="0,0" size="132,64"> + skin = ( + """<screen name="VideoWizardSummary" position="0,0" size="132,64" id="1"> <widget name="text" position="6,4" size="120,40" font="Regular;12" transparent="1" /> <widget source="parent.list" render="Label" position="6,40" size="120,21" font="Regular;14"> <convert type="StringListSelection" /> </widget> <!--widget name="pic" pixmap="%s" position="6,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/--> - </screen>""" #% (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/lcd_Scart.png")) + </screen>""", + """<screen name="VideoWizardSummary" position="0,0" size="96,64" id="2"> + <widget name="text" position="0,4" size="96,40" font="Regular;12" transparent="1" /> + <widget source="parent.list" render="Label" position="0,40" size="96,21" font="Regular;14"> + <convert type="StringListSelection" /> + </widget> + <!--widget name="pic" pixmap="%s" position="0,22" zPosition="10" size="64,64" transparent="1" alphatest="on"/--> + </screen>""") + #% (resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/lcd_Scart.png")) def __init__(self, session, parent): WizardSummary.__init__(self, session, parent) |
