From 64b3debba2c0bcdb5120bc150857d8992a1043f4 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sun, 22 Jul 2012 17:28:59 +0200 Subject: [PATCH] * Audioplayer: CComponentsInfoBox use to paint infobox --- src/gui/audioplayer.cpp | 23 ++++++++++++++++------- src/gui/audioplayer.h | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index a3b53f91d..43d5b5a54 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -188,6 +188,8 @@ CAudioPlayerGui::CAudioPlayerGui(bool inetmode) m_frameBuffer = CFrameBuffer::getInstance(); m_visible = false; m_inetmode = inetmode; + dline = NULL; + ibox = NULL; Init(); } @@ -237,6 +239,8 @@ CAudioPlayerGui::~CAudioPlayerGui() m_title2Pos.clear(); // g_Zapit->setStandby (false); g_Sectionsd->setPauseScanning (false); + delete dline; + delete ibox; } //------------------------------------------------------------------------ @@ -1874,7 +1878,6 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) int ypos2 = m_y + (m_height - m_info_height); int ypos1a = ypos1 + (m_fheight / 2) - 2; int ypos2a = ypos2 + (m_info_height / 2) - 2; - fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; // Clear m_frameBuffer->paintBackgroundBoxRel(xpos - 1, m_y + m_title_height, ConnectLineBox_Width + 1, @@ -1884,13 +1887,16 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) if (!m_playlist.empty() && (pos >= 0)) { //details line - CComponentsDetailLine details_line(xpos, ypos1a, ypos2a, m_fheight/2+1, m_fheight); - details_line.paint(); + if (dline == NULL) + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_fheight); + dline->setYPos(ypos1a); + dline->paint(false); - // -- small Frame around infobox - m_frameBuffer->paintBoxFrame(m_x, ypos2, m_width, m_info_height, 2, col1, RADIUS_MID); // paint id3 infobox - m_frameBuffer->paintBoxRel(m_x + 2, ypos2 + 2 , m_width - 4, m_info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_MID); + if (ibox == NULL) + ibox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height, false); + ibox->paint(false); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2 + 1*m_fheight, m_width- 80, m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK, 0, true); // UTF-8 std::string tmp; @@ -1919,7 +1925,10 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) } else { - m_frameBuffer->paintBackgroundBoxRel(m_x, ypos2, m_width, m_info_height); + if (dline != NULL) + dline->hide(); + if (ibox != NULL) + ibox->hide(); } } //------------------------------------------------------------------------ diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 3fea78f12..789c8d53a 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -140,6 +140,8 @@ class CAudioPlayerGui : public CMenuTarget bool m_screensaver; bool m_inetmode; uint32_t stimer; + CComponentsDetailLine *dline; + CComponentsInfoBox *ibox; SMSKeyInput m_SMSKeyInput;