Conflicts:
	src/gui/audioplayer.cpp
	src/gui/audioplayer.h


Origin commit data
------------------
Commit: 3f812037a5
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-28 (Wed, 28 Jun 2017)
This commit is contained in:
vanhofen
2017-06-28 22:49:34 +02:00
4 changed files with 30 additions and 17 deletions

View File

@@ -157,6 +157,7 @@ CAudioPlayerGui::CAudioPlayerGui(bool inetmode)
m_inetmode = inetmode;
m_detailsline = NULL;
m_infobox = NULL;
m_titlebox = NULL;
Init();
}
@@ -212,6 +213,7 @@ CAudioPlayerGui::~CAudioPlayerGui()
m_title2Pos.clear();
delete m_detailsline;
delete m_infobox;
delete m_titlebox;
}
const struct button_label AudioPlayerButtons[][4] =
@@ -1808,15 +1810,23 @@ void CAudioPlayerGui::paintTitleBox()
return;
if (m_state == CAudioPlayerGui::STOP && m_show_playlist)
m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_title_height + OFFSET_SHADOW);
{
if (m_titlebox)
{
m_titlebox->kill();
delete m_titlebox; m_titlebox = NULL;
}
}
else
{
// shadow
m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_LARGE);
m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_LARGE);
m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, 1, COL_FRAME_PLUS_0, RADIUS_LARGE); //NI
// title box
if (!m_titlebox)
{
m_titlebox = new CComponentsShapeSquare(m_x, m_y, m_width, m_title_height, NULL, CC_SHADOW_ON);
m_titlebox->enableFrame(true, FRAME_MIN_WIDTH);
m_titlebox->setCorner(RADIUS_LARGE);
}
m_titlebox->paint(false);
paintCover();
// first line (Track number)
@@ -1839,7 +1849,7 @@ void CAudioPlayerGui::paintTitleBox()
int xstart = (m_width - w)/2;
if (xstart < OFFSET_INNER_MID)
xstart = OFFSET_INNER_MID;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 1*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //caption "current track"
// second line (Artist/Title...)
GetMetaData(m_curr_audiofile);
@@ -1864,7 +1874,7 @@ void CAudioPlayerGui::paintTitleBox()
xstart = (m_width - w)/2;
if (xstart < OFFSET_INNER_MID)
xstart = OFFSET_INNER_MID;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + OFFSET_INNER_SMALL + 2*m_item_height, m_width - 2*OFFSET_INNER_MID, tmp, COL_MENUHEAD_TEXT); //artist - title
// reset so fields get painted always
m_metainfo.clear();
@@ -2215,7 +2225,7 @@ void CAudioPlayerGui::updateMetaData()
if (updateMeta || updateScreen)
{
int cover_width = m_title_height + 2*OFFSET_INNER_MID;
m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, COL_MENUHEAD_PLUS_0);
m_frameBuffer->paintBoxRel(m_x + cover_width, m_y + OFFSET_INNER_SMALL + 2*m_item_height + OFFSET_INNER_SMALL, m_width - OFFSET_INNER_MID - cover_width, m_meta_height, m_titlebox->getColorBody());
int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo);
int xstart = (m_width - w)/2;
@@ -2263,7 +2273,7 @@ void CAudioPlayerGui::updateTimes(const bool force)
if (m_inetmode)
w_total_time = 0;
int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time;
int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - 2*m_titlebox->getFrameThickness();
// played time offset to align this value on the right side
int o_played_time = std::max(w_faked_time - w_played_time, 0);
int x_faked_time = x_total_time - w_faked_time;
@@ -2272,20 +2282,20 @@ void CAudioPlayerGui::updateTimes(const bool force)
if (updateTotal && !m_inetmode)
{
m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time, m_item_height, COL_MENUHEAD_PLUS_0);
m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time, m_item_height, m_titlebox->getColorBody());
if (m_time_total > 0)
{
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT); //total time
}
}
if (updatePlayed || (m_state == CAudioPlayerGui::PAUSE))
{
m_frameBuffer->paintBoxRel(x_faked_time, y_times, w_faked_time, m_item_height, COL_MENUHEAD_PLUS_0);
m_frameBuffer->paintBoxRel(x_faked_time, y_times, w_faked_time, m_item_height, m_titlebox->getColorBody());
struct timeval tv;
gettimeofday(&tv, NULL);
if ((m_state != CAudioPlayerGui::PAUSE) || (tv.tv_sec & 1))
{
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_played_time, y_times + m_item_height, w_played_time, played_time, COL_MENUHEAD_TEXT);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_played_time, y_times + m_item_height, w_played_time, played_time, COL_MENUHEAD_TEXT); //elapsed time
}
}
}

View File

@@ -128,6 +128,7 @@ class CAudioPlayerGui : public CMenuTarget
bool m_inetmode;
CComponentsDetailsLine *m_detailsline;
CComponentsInfoBox *m_infobox;
CComponentsShapeSquare *m_titlebox;
SMSKeyInput m_SMSKeyInput;

View File

@@ -123,8 +123,8 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con
* If already existing some items then subtract those width from footer width.
* ...so we have the possible usable size for button container.
*/
if(!v_cc_items.empty()){ //FIXME: footer container seems always not empty here, so here j initialized with = 1. I dont't know where it comes from! dbt!
for (size_t j= 1; j< size(); j++)
if(!v_cc_items.empty()){
for (size_t j= 0; j< size(); j++)
w_chain -= getCCItem(j)->getWidth();
}

View File

@@ -1004,6 +1004,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO
#define SCROLLBAR_WIDTH (OFFSET_INNER_MID + 2*OFFSET_INNER_MIN)
#define FRAME_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(2)
#define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16)
#define BIGFONT_FACTOR 1.5