From 3558beec701ec622deefcf0a13a1b084b7745d6c Mon Sep 17 00:00:00 2001 From: gixxpunk Date: Sun, 28 Aug 2011 11:05:09 +0000 Subject: [PATCH] add new timeshift icon - infoviewer: add timeshift status to showRecordIcon() git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1633 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aad36fcf8b59570279ba922953f3fa03155e80e1 Author: gixxpunk Date: 2011-08-28 (Sun, 28 Aug 2011) Origin message was: ------------------ - add new timeshift icon - infoviewer: add timeshift status to showRecordIcon() git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1633 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/icons/Makefile.am | 2 +- data/icons/ats.png | Bin 0 -> 338 bytes data/icons/rec.png | Bin 996 -> 338 bytes src/gui/infoviewer.cpp | 93 ++++++++++++++++++++++++++++------------- 4 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 data/icons/ats.png diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 23f12259f..1403a9dcf 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -2,7 +2,7 @@ installdir = $(DATADIR)/neutrino/icons install_DATA = \ 0.png 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png \ - audio.png 16_9.png 16_9_gray.png \ + audio.png 16_9.png 16_9_gray.png ats.png \ language.png bayrisch.png ch-baslerdeutsch.png ch-berndeutsch.png czech.png deutsch.png dutch.png bosanski.png \ ellinika.png english.png francais.png french.png hungarian.png italiano.png norsk.png \ polski.png portugues.png romania.png russkij.png nederlands.png slovak.png suomi.png svenska.png \ diff --git a/data/icons/ats.png b/data/icons/ats.png new file mode 100644 index 0000000000000000000000000000000000000000..0f763ddd9470c4bc5323592122968f7bd79ed780 GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^GC(ZA!3-pg1mE8UQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii`t%LR^nBFkEI}*vPSit9%GohmP>Y#EX@k ze0x?swJOcO)-^}gSf=Q*LPtfgjEi4n$ANn(Y5uRbpXs=0Xmw;=AmjV^ECY^%FYC`A zJnJ91-1V5vn-z>RHlI~oUzmIDZ`d|zr77E83(d3daO*n0H4KW*+~bvX(YKz7hasX` W>~_h5pEW=?GI+ZBxvXZ28K-x4CfdaRxmIeV_>+#z%ZMEVGjet0tSZv z|Nq}P`;ZB!U9cp`FBr&00Su~ZXC~DHWoLN0IEGZ*Dw%j&s9Ax><@z=SrK5lUug^7O zT+OdH^Q@vzoAi%bk-|G$*9qq=2(!}&ouZ^MX}9s>wtKA41Z_53ev3_zd$^-VYMXCD zU+=j<1I7&B3o3ll-D?%o9nYOQ7g(^P#Aw#7=l3nYhqS%tJa_BqmhPr`&okeDzq01L zq4;sz)4yN-eAAlcD;E^t#l;zO{{00B`9}xlGcYphPtDnm{r-UW| DFHeRZ literal 996 zcmeAS@N?(olHy`uVBq!ia0vp^GC(ZA!3-pg1mE9fU|?nl@Ck9{;NY0AqpYQ&Wn^e% zWn(p6M_E}>*~!Jp%EC%oMtYrr)-nUFZ6;by4o=Fd%KaM3K=q?wGz5lC2oz{HW&*Rs zd`}n0kcv6A6C?Q!8*sQp?me3MuKu>sj%mLxNV> zmf5w; zUd1jh(}#K8c@^8ZOmDwy6fi#Dc)^VA*6J^Jj6Y4daja-6ulKv-ITjv29m*Yq11n?> kDhbLco-4Qc^YZjP$9%r-V}H9nfKFxbboFyt=akR{0O?hITmS$7 diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 75c63a24f..5decf1076 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -288,38 +288,75 @@ void CInfoViewer::paintTime (bool show_dot, bool firstPaint) void CInfoViewer::showRecordIcon (const bool show) { - //recordModeActive = CNeutrinoApp::getInstance ()->recordingstatus || shift_timer; recordModeActive = CRecordManager::getInstance()->RecordingStatus() || CRecordManager::getInstance()->Timeshift(); if (recordModeActive) { - //printf("CInfoViewer::showRecordIcon RecordingStatus() %d Timeshift() %d\n", CRecordManager::getInstance()->RecordingStatus(), CRecordManager::getInstance()->Timeshift()); - int icon_w = 0,icon_h = 0, radius = RADIUS_MIN; - frameBuffer->getIconSize(autoshift ? NEUTRINO_ICON_AUTO_SHIFT : NEUTRINO_ICON_REC, &icon_w, &icon_h); - int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight (); - int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET; - const int icon_space = 3, box_len = 34 + icon_w, box_posY = 12; - int box_posX = ChanName_X + SHADOW_OFFSET, icon_posX = box_posX + icon_space + SHADOW_OFFSET; - if (show) { - //if (!autoshift && !shift_timer) - if(!CRecordManager::getInstance()->Timeshift()) + CRecordManager * crm = CRecordManager:: getInstance(); + int records = crm->GetRecmapSize(); + bool modus_rec = crm->RecordingStatus() && !crm->Timeshift(); + bool modus_ts = crm->Timeshift() && (records == 1); + bool modus_ts_rec = crm->Timeshift() && (records > 1); +//printf("\n##### ts %d - rec %d - ts_rec %d\n \n", modus_ts, modus_rec, modus_ts_rec); + int rec_icon_w = 0, rec_icon_h = 0, ts_icon_w = 0, ts_icon_h = 0; + const int radius = RADIUS_MIN; + const int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET; + const int icon_space = 3, box_posY = 12; + int box_len = 0, rec_icon_posX = 0, ts_icon_posX = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &rec_icon_w, &rec_icon_h); + frameBuffer->getIconSize(NEUTRINO_ICON_AUTO_SHIFT, &ts_icon_w, &ts_icon_h); + int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight () + * (g_settings.screen_yres / 100); + if (chanH < rec_icon_h) + chanH = rec_icon_h; + const int box_posX = ChanName_X + SHADOW_OFFSET; + char records_msg[8]; + snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + int TextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg) + * (g_settings.screen_xres / 100); + if (modus_rec) + { + box_len = rec_icon_w + TextWidth + icon_space*5; + rec_icon_posX = box_posX + icon_space*2; + }else if (modus_ts) + { + box_len = ts_icon_w + icon_space*4; + ts_icon_posX = box_posX + icon_space*2; + }else if (modus_ts_rec) + { + box_len = ts_icon_w + rec_icon_w + TextWidth + icon_space*7; + ts_icon_posX = box_posX + icon_space*2; + rec_icon_posX = ts_icon_posX + ts_icon_w + icon_space*2; + records--; + snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + } + if (show) + { + if (modus_rec) { - frameBuffer->paintBoxRel (box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); - frameBuffer->paintBoxRel (box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); - char records_msg[8]; - int records = CRecordManager::getInstance()->GetRecmapSize(); - snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (icon_posX + icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, - records_msg, COL_INFOBAR, 0, true); - } else { - frameBuffer->paintBackgroundBoxRel (box_posX, BoxStartY + box_posY, box_len + SHADOW_OFFSET, chanH + SHADOW_OFFSET); + frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); + frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true); + frameBuffer->paintIcon (NEUTRINO_ICON_REC, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); + }else if (modus_ts) + { + frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); + frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); + frameBuffer->paintIcon(NEUTRINO_ICON_AUTO_SHIFT, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); + }else if (modus_ts_rec) + { + frameBuffer->paintBoxRel(box_posX + SHADOW_OFFSET, BoxStartY + box_posY + SHADOW_OFFSET, box_len, chanH, COL_INFOBAR_SHADOW_PLUS_0, radius); + frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true); + frameBuffer->paintIcon(NEUTRINO_ICON_REC, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); + frameBuffer->paintIcon(NEUTRINO_ICON_AUTO_SHIFT, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); } - frameBuffer->paintIcon (autoshift ? NEUTRINO_ICON_AUTO_SHIFT : NEUTRINO_ICON_REC, icon_posX, BoxStartY + box_posY + (chanH - icon_h)/2); - - } else { - //if (!autoshift && !shift_timer) - if(!CRecordManager::getInstance()->Timeshift()) - frameBuffer->paintBoxRel (icon_posX, BoxStartY + box_posY + (chanH - icon_h)/2, icon_w, icon_h, COL_INFOBAR_PLUS_0); - else - frameBuffer->paintBackgroundBoxRel (icon_posX, BoxStartY + box_posY + (chanH - icon_h)/2, icon_w, icon_h); + }else + { + if (modus_rec) + frameBuffer->paintBoxRel(rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, rec_icon_w, rec_icon_h, COL_INFOBAR_PLUS_0); + else if (modus_ts) + frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2, ts_icon_w, ts_icon_h, COL_INFOBAR_PLUS_0); + else if (modus_ts_rec) + frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, ts_icon_w + rec_icon_w + icon_space*2, rec_icon_h, COL_INFOBAR_PLUS_0); } } }