mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
audioplayer: don't remove station-logo immediately; ...
this allows the usage of station-logo as screensaver
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2f5de6496a
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-05-24 (Thu, 24 May 2018)
Origin message was:
------------------
- audioplayer: don't remove station-logo immediately; ...
this allows the usage of station-logo as screensaver
------------------
This commit was generated by Migit
This commit is contained in:
@@ -323,6 +323,9 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
m_idletime = time(NULL);
|
m_idletime = time(NULL);
|
||||||
m_screensaver = false;
|
m_screensaver = false;
|
||||||
|
|
||||||
|
m_cover.clear();
|
||||||
|
m_stationlogo = false;
|
||||||
|
|
||||||
m_streamripper_available = !find_executable("streamripper").empty() && !find_executable("streamripper.sh").empty();
|
m_streamripper_available = !find_executable("streamripper").empty() && !find_executable("streamripper.sh").empty();
|
||||||
m_streamripper_active = false;
|
m_streamripper_active = false;
|
||||||
|
|
||||||
@@ -1825,12 +1828,12 @@ void CAudioPlayerGui::paintCover()
|
|||||||
const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData();
|
const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData();
|
||||||
|
|
||||||
// try folder.jpg first
|
// try folder.jpg first
|
||||||
std::string cover = m_curr_audiofile.Filename.substr(0, m_curr_audiofile.Filename.rfind('/')) + "/folder.jpg";
|
m_cover = m_curr_audiofile.Filename.substr(0, m_curr_audiofile.Filename.rfind('/')) + "/folder.jpg";
|
||||||
bool stationlogo = false;
|
m_stationlogo = false;
|
||||||
|
|
||||||
// try cover from tag
|
// try cover from tag
|
||||||
if (!meta.cover.empty())
|
if (!meta.cover.empty())
|
||||||
cover = meta.cover;
|
m_cover = meta.cover;
|
||||||
// try station logo
|
// try station logo
|
||||||
else if (!meta.logo.empty())
|
else if (!meta.logo.empty())
|
||||||
{
|
{
|
||||||
@@ -1850,20 +1853,20 @@ void CAudioPlayerGui::paintCover()
|
|||||||
CHTTPTool httptool;
|
CHTTPTool httptool;
|
||||||
if (httptool.downloadFile(meta.logo, fullname.c_str()))
|
if (httptool.downloadFile(meta.logo, fullname.c_str()))
|
||||||
{
|
{
|
||||||
cover = fullname;
|
m_cover = fullname;
|
||||||
stationlogo = true;
|
m_stationlogo = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cover.clear();
|
m_cover.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access(cover.c_str(), F_OK) == 0)
|
if (access(m_cover.c_str(), F_OK) == 0)
|
||||||
{
|
{
|
||||||
int cover_x = m_x + OFFSET_INNER_MID;
|
int cover_x = m_x + OFFSET_INNER_MID;
|
||||||
int cover_y = m_y + OFFSET_INNER_SMALL;
|
int cover_y = m_y + OFFSET_INNER_SMALL;
|
||||||
m_cover_width = 0;
|
m_cover_width = 0;
|
||||||
CComponentsPicture *cover_object = new CComponentsPicture(cover_x, cover_y, cover);
|
CComponentsPicture *cover_object = new CComponentsPicture(cover_x, cover_y, m_cover);
|
||||||
if (cover_object)
|
if (cover_object)
|
||||||
{
|
{
|
||||||
cover_object->doPaintBg(false);
|
cover_object->doPaintBg(false);
|
||||||
@@ -1872,16 +1875,6 @@ void CAudioPlayerGui::paintCover()
|
|||||||
|
|
||||||
m_cover_width = cover_object->getWidth() + OFFSET_INNER_MID;
|
m_cover_width = cover_object->getWidth() + OFFSET_INNER_MID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Some guys use this covers for the screensaver.
|
|
||||||
So we need to keep this station-logo until the
|
|
||||||
stream is stopped.
|
|
||||||
Until this is coded we delete the station-logo
|
|
||||||
immediately.
|
|
||||||
*/
|
|
||||||
if (stationlogo)
|
|
||||||
unlink(cover.c_str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2098,6 +2091,12 @@ void CAudioPlayerGui::stop()
|
|||||||
if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)
|
if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)
|
||||||
CAudioPlayer::getInstance()->stop();
|
CAudioPlayer::getInstance()->stop();
|
||||||
|
|
||||||
|
if (m_stationlogo)
|
||||||
|
{
|
||||||
|
unlink(m_cover.c_str());
|
||||||
|
m_stationlogo = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_streamripper_active)
|
if (m_streamripper_active)
|
||||||
{
|
{
|
||||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2);
|
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2);
|
||||||
|
@@ -109,6 +109,8 @@ class CAudioPlayerGui : public CMenuTarget
|
|||||||
bool m_select_title_by_name;
|
bool m_select_title_by_name;
|
||||||
bool m_show_playlist;
|
bool m_show_playlist;
|
||||||
bool m_playlistHasChanged;
|
bool m_playlistHasChanged;
|
||||||
|
std::string m_cover;
|
||||||
|
bool m_stationlogo;
|
||||||
bool m_streamripper_available;
|
bool m_streamripper_available;
|
||||||
bool m_streamripper_active;
|
bool m_streamripper_active;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user