Changeset 15253
- Timestamp:
- 04/14/12 02:28:07 (11 years ago)
- Location:
- titan/titan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/gmultiepg.h
r14209 r15253 111 111 112 112 113 int calcgmultiepg(struct channel* tmpchannel, struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, struct skin* timeline, int zoom, time_t akttime, struct channel* aktchannel, int linecol1, int linecol2, int linecol3, int* aktline, struct skin** pchnode, struct skin** pchnode1, int height, int picheight )113 int calcgmultiepg(struct channel* tmpchannel, struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, struct skin* timeline, int zoom, time_t akttime, struct channel* aktchannel, int linecol1, int linecol2, int linecol3, int* aktline, struct skin** pchnode, struct skin** pchnode1, int height, int picheight, int epgicon, long deaktivcol) 114 114 { 115 115 int treffer = 0, gridbr = 0, aktcol = 0, nottuneable = 0; … … 119 119 time_t nowtime = time(NULL); 120 120 121 int epgpicon = getconfigint("epgpicon", NULL);122 123 121 if(tmpchannel != NULL && tmpchannel->servicetype == status.servicetype) 124 122 { … … 129 127 { 130 128 chnode->bgspace = 1; 131 tmpstr = createpiconpath(tmpchannel, 0); 132 if(epgpicon == 1 && tmpstr != NULL && strstr(tmpstr, "default.png") == NULL) 129 130 if(epgpicon == 1) tmpstr = createpiconpath(tmpchannel, 0); 131 if(tmpstr != NULL && strstr(tmpstr, "default.png") == NULL) 133 132 { 134 133 changepic(chnode, tmpstr); … … 193 192 chnode1->hspace = 2; 194 193 if(nottuneable == 1) 195 chnode1->deaktivcol = convertcol("deaktivcol");194 chnode1->deaktivcol = deaktivcol; 196 195 197 196 //TODO: record timeline … … 226 225 chnode1->bgspace = 1; 227 226 if(nottuneable == 1) 228 chnode1->deaktivcol = convertcol("deaktivcol");227 chnode1->deaktivcol = deaktivcol; 229 228 } 230 229 } … … 233 232 if(nottuneable == 1) 234 233 { 235 chnode->deaktivcol = convertcol("deaktivcol");234 chnode->deaktivcol = deaktivcol; 236 235 (*aktline)--; 237 236 } … … 252 251 int height = getskinconfigint("epgheight", NULL); 253 252 int picheight = getskinconfigint("epgpicheight", NULL); 253 int epgpicon = getconfigint("epgpicon", NULL); 254 long deaktivcol = convertcol("deaktivcol"); 254 255 255 256 if(height < 1) height = 35; … … 261 262 while(tmpchannel != NULL) 262 263 { 263 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight ) == 1)264 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight, epgicon, deaktivcol) == 1) 264 265 treffer = 1; 265 266 tmpchannel = tmpchannel->next; … … 279 280 int height = getskinconfigint("epgheight", NULL); 280 281 int picheight = getskinconfigint("epgpicheight", NULL); 282 int epgpicon = getconfigint("epgpicon", NULL); 283 long deaktivcol = convertcol("deaktivcol"); 281 284 282 285 if(height < 1) height = 35; … … 288 291 while(tmpbouquet != NULL) 289 292 { 290 if(calcgmultiepg(tmpbouquet->channel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight ) == 1)293 if(calcgmultiepg(tmpbouquet->channel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight, epgicon, deaktivcol) == 1) 291 294 treffer = 1; 292 295 tmpbouquet = tmpbouquet->next; … … 306 309 int height = getskinconfigint("epgheight", NULL); 307 310 int picheight = getskinconfigint("epgpicheight", NULL); 311 int epgpicon = getconfigint("epgpicon", NULL); 312 long deaktivcol = convertcol("deaktivcol"); 308 313 309 314 if(height < 1) height = 35; … … 316 321 if(tmpchannel->provider == providernode) 317 322 { 318 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight ) == 1)323 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight, epgicon, deaktivcol) == 1) 319 324 treffer = 1; 320 325 } … … 337 342 int height = getskinconfigint("epgheight", NULL); 338 343 int picheight = getskinconfigint("epgpicheight", NULL); 344 int epgpicon = getconfigint("epgpicon", NULL); 345 long deaktivcol = convertcol("deaktivcol"); 339 346 340 347 if(height < 1) height = 35; … … 347 354 if(tmpchannel->transponder != NULL && tmpchannel->transponder->orbitalpos == satnode->orbitalpos) 348 355 { 349 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight ) == 1)356 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight, epgicon, deaktivcol) == 1) 350 357 treffer = 1; 351 358 } … … 366 373 int height = getskinconfigint("epgheight", NULL); 367 374 int picheight = getskinconfigint("epgpicheight", NULL); 375 int epgpicon = getconfigint("epgpicon", NULL); 376 long deaktivcol = convertcol("deaktivcol"); 368 377 369 378 if(height < 1) height = 35; … … 376 385 if(tmpchannel->name != NULL && (tmpchannel->name[0] == character || tmpchannel->name[0] == character + 32)) 377 386 { 378 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight ) == 1)387 if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, timeline, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight, epgicon, deaktivcol) == 1) 379 388 treffer = 1; 380 389 } -
titan/titan/menulist.h
r15189 r15253 260 260 break; 261 261 } 262 if(listbox->select != NULL && rcret==getrcconfigint("rcok", NULL))262 if(listbox->select != NULL && rcret==getrcconfigint("rcok", NULL)) 263 263 { 264 264 ret = (struct menulist*)listbox->select->handle; -
titan/titan/sh4port.h
r15252 r15253 478 478 } 479 479 480 void blitjpg(unsigned char* buf, int posx, int posy, int width, int height, int scalewidth, int scaleheight )480 void blitjpg(unsigned char* buf, int posx, int posy, int width, int height, int scalewidth, int scaleheight, int mwidth, int mheight, int halign, int valign) 481 481 { 482 482 STMFBIO_BLT_EXTERN_DATA blt_data; 483 483 memset(&blt_data, 0, sizeof(STMFBIO_BLT_EXTERN_DATA)); 484 485 //auto scale to mwidth / mheight 486 if(scalewidth == 1 && scaleheight == 1) 487 calcautoscale(width, height, mwidth, mheight, &scalewidth, &scaleheight); 488 489 if(scalewidth == 0) scalewidth = width; 490 if(scaleheight == 0) scaleheight = height; 491 492 if(width > mwidth) scalewidth = mwidth; 493 if(height > mheight) scaleheight = mheight; 494 495 if(halign == CENTER) 496 posx += mwidth / 2 - width / 2; 497 else if(halign == RIGHT) 498 posx += mwidth - width; 499 if(valign == MIDDLE) 500 posy += mheight / 2 - height / 2; 501 else if(valign == BOTTOM) 502 posy += mheight - height; 484 503 485 504 blt_data.operation = BLT_OP_COPY; … … 496 515 blt_data.dst_top = posy; 497 516 498 if(scalewidth == 0) scalewidth = width;499 if(scaleheight == 0) scaleheight = height;500 501 517 blt_data.dst_right = posx + scalewidth; 502 518 blt_data.dst_bottom = posy + scaleheight; -
titan/titan/skin.h
r15251 r15253 1558 1558 png_bytepp row_pointers = NULL; 1559 1559 png_bytep sig = NULL; 1560 unsigned char* directbuf = NULL;1561 1560 1562 1561 fd = fopen(filename, "rb"); … … 1642 1641 png_set_gamma(png_ptr, 2.2, gamma); 1643 1642 1644 /*1645 if(mwidth > 0 && mheight > 0 && *width <= mwidth && *height <= mheight)1646 {1647 if(halign == CENTER)1648 posx += mwidth / 2 - (*width) / 2;1649 else if(halign == RIGHT)1650 posx += mwidth - (*width);1651 if(valign == MIDDLE)1652 posy += mheight / 2 - (*height) / 2;1653 else if(valign == BOTTOM)1654 posy += mheight - (*height);1655 directbuf = skinfb->fb + (posy * skinfb->pitch) + (posx * skinfb->colbytes);1656 if(color_type == PNG_COLOR_TYPE_RGB)1657 png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);1658 png_set_bgr(png_ptr);1659 }1660 */1661 1662 1643 png_read_update_info(png_ptr, info_ptr); 1663 1644 *rowbytes = png_get_rowbytes(png_ptr, info_ptr); 1664 1645 *channels = (int)png_get_channels(png_ptr, info_ptr); 1665 1646 1666 //if(directbuf == NULL) 1667 buf = malloc((*rowbytes) * (*height)); 1668 //else 1669 // buf = directbuf; 1670 1647 buf = malloc((*rowbytes) * (*height)); 1671 1648 if(buf == NULL) 1672 1649 { … … 1684 1661 err("%s unknown error", filename); 1685 1662 free(sig); 1686 if(directbuf == NULL) free(buf);1687 1663 fclose(fd); 1688 1664 return NULL; 1689 1665 } 1690 1666 1691 //if(directbuf == NULL) 1692 //{ 1693 for (y = 0; y < (*height); ++y) 1694 row_pointers[y] = (png_bytep)buf + y * (*rowbytes); 1695 //} 1696 //else 1697 //{ 1698 // for (y = 0; y < (*height); ++y) 1699 // row_pointers[y] = (png_bytep)buf + y * skinfb->pitch; 1700 //} 1667 for (y = 0; y < (*height); ++y) 1668 row_pointers[y] = (png_bytep)buf + y * (*rowbytes); 1701 1669 1702 1670 png_read_image(png_ptr, row_pointers); … … 1713 1681 1714 1682 debug(1000, "out"); 1715 //if(directbuf == NULL) 1716 return buf; 1717 //else 1718 // return NULL; 1683 return buf; 1719 1684 } 1720 1685 … … 1723 1688 debug(1000, "in"); 1724 1689 unsigned char *buf = NULL, *scalebuf = NULL; 1725 int memfd = -1, py = 0, pyh = 0, pxw = 0, diff = 0; //px = 01690 int memfd = -1, py = 0, pyh = 0, pxw = 0, diff = 0; 1726 1691 unsigned long width, height, rowbytes; 1727 1692 int channels, length; 1728 unsigned char *src; // red, green, blue, alpha; 1729 //unsigned long color; 1693 unsigned char *src; 1730 1694 png_uint_32 y, x; 1731 1695 struct pic* picnode = NULL; … … 1745 1709 { 1746 1710 if(pictype == 0) 1747 {1748 //deaktivate: draws transparent pixel1749 //read direkt into framebuffer1750 //if(scaleheight == 0 && scalewidth == 0)1751 // buf = readpng(filename, &width, &height, &rowbytes, &channels, posx, posy, mwidth, mheight, halign, valign);1752 //else1753 1711 buf = readpng(filename, &width, &height, &rowbytes, &channels, 0, 0, 0, 0, 0, 0); 1754 }1755 1712 else if(pictype == 1) 1756 1713 readjpg(filename, &width, &height, &rowbytes, &channels, &buf, &memfd); … … 1795 1752 } 1796 1753 1797 if(width > mwidth) width = mwidth;1798 if(height > mheight) height = mheight;1799 1800 if(halign == CENTER)1801 posx += mwidth / 2 - width / 2;1802 else if(halign == RIGHT)1803 posx += mwidth - width;1804 if(valign == MIDDLE)1805 posy += mheight / 2 - height / 2;1806 else if(valign == BOTTOM)1807 posy += mheight - height;1808 1809 1754 if(pictype == 0) 1810 1755 { 1756 if(width > mwidth) width = mwidth; 1757 if(height > mheight) height = mheight; 1758 1759 if(halign == CENTER) 1760 posx += mwidth / 2 - width / 2; 1761 else if(halign == RIGHT) 1762 posx += mwidth - width; 1763 if(valign == MIDDLE) 1764 posy += mheight / 2 - height / 2; 1765 else if(valign == BOTTOM) 1766 posy += mheight - height; 1767 1811 1768 py = (posy * skinfb->width) + posx; 1812 1769 pyh = py + (height * skinfb->width); … … 1845 1802 } 1846 1803 } 1847 /*1848 for (y = 0; y < height; ++y)1849 {1850 py = (posy + y) * skinfb->width;1851 src = buf + y * rowbytes;1852 for (x = 0; x < width; x++)1853 {1854 red = *src++;1855 green = *src++;1856 blue = *src++;1857 if(channels == 3)1858 alpha = 255;1859 else1860 alpha = *src++;1861 1862 if(alpha == 0) continue;1863 color = (alpha << 24) | (red << 16) | (green << 8) | blue;1864 //if(color & 0xff000000 == 0) continue;1865 drawpixelfast(posx + x, py, color);1866 }1867 }1868 */1869 1804 } 1870 1805 else if(pictype == 1 && memfd > -1) 1871 blitjpg(buf, posx, posy, width, height, scalewidth, scaleheight 1806 blitjpg(buf, posx, posy, width, height, scalewidth, scaleheight, mwidth, mheight, halign, valign); 1872 1807 1873 1808 if(picnode == NULL)
Note: See TracChangeset
for help on using the changeset viewer.