- 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
This commit is contained in:
striper
2011-08-28 11:05:09 +00:00
parent 87bbccf035
commit aad36fcf8b
4 changed files with 66 additions and 29 deletions

View File

@@ -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 \

BIN
data/icons/ats.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

After

Width:  |  Height:  |  Size: 338 B

View File

@@ -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())
{
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);
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];
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);
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");
}
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);
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);
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);
}
}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);
}
}
}