From a61c82eaeb72d20e4a7609b27cd4903d2a2a1a34 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 14 May 2010 12:20:57 +0000 Subject: [PATCH] -add show infobar.txt window git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@583 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/infoviewer.cpp | 36 +++++++++++++++++++++++++++++++++++- src/gui/infoviewer.h | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0f63f8493..9060e4fcb 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -540,7 +540,7 @@ fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_set ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, ChannelName, COL_INFOBAR, 0, true); // UTF-8 - + showInfoFile(); // int ChanInfoY = BoxStartY + ChanHeight + 10; ButtonWidth = (BoxEndX - ChanInfoX - ICON_OFFSET) >> 2; @@ -1527,6 +1527,40 @@ void CInfoViewer::show_Data (bool calledFromEvent) #endif } +void CInfoViewer::showInfoFile() +{ + if (recordModeActive) + return; + char infotext[80]; + int fd, xStart, xEnd, height, r; + ssize_t cnt; + + fd = open("/tmp/infobar.txt", O_RDONLY); //Datei aus welcher der Text ausgelesen wird + + if (fd < 0) + return; + + cnt = read(fd, infotext, 79); + if (cnt < 0) { + fprintf(stderr, "CInfoViewer::showInfoFile: could not read from infobar.txt: %m"); + close(fd); + return; + } + close(fd); + infotext[cnt] = '\0'; + + xStart = BoxStartX + ChanWidth + 140; // Abstand rechst vom Aufnahmeicon + xEnd = BoxEndX - 225; // Abstand links von der Progressbar + height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 2; + r = height / 3; + // background + frameBuffer->paintBox(xStart, BoxStartY, xEnd, BoxStartY + height, COL_INFOBAR_PLUS_0, RADIUS_SMALL, CORNER_ALL); //round + + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( + xStart + r, BoxStartY + height, xEnd - xStart - r*2, (std::string)infotext, COL_INFOBAR, height, false); +} + + void CInfoViewer::showButton_Audio () { // green, in case of several APIDs diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 3ab325a9e..9b1298357 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -124,6 +124,7 @@ class CInfoViewer void showLcdPercentOver(); int showChannelLogo(const t_channel_id logo_channel_id); void showSNR(); + void showInfoFile(); public: bool chanready;