mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
Merge remote-tracking branch 'check/cst-next'
*needs buildfixing* Conflicts: src/daemonc/Makefile.am src/daemonc/remotecontrol.cpp src/driver/Makefile.am src/driver/audiodec/Makefile.am src/driver/pictureviewer/Makefile.am src/driver/vfd.cpp src/gui/bedit/Makefile.am src/gui/components/Makefile.am src/gui/luainstance.cpp src/gui/widget/Makefile.am src/nhttpd/tuxboxapi/coolstream/Makefile.am src/system/Makefile.am
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
#include <gui/widget/stringinput.h>
|
||||
#include <gui/widget/stringinput_ext.h>
|
||||
#include <gui/widget/keyboard_input.h>
|
||||
|
||||
#include <gui/screensaver.h>
|
||||
#include "gui/pictureviewer.h"
|
||||
extern CPictureViewer * g_PicViewer;
|
||||
|
||||
@@ -173,7 +173,6 @@ CAudioPlayerGui::CAudioPlayerGui(bool inetmode)
|
||||
|
||||
void CAudioPlayerGui::Init(void)
|
||||
{
|
||||
stimer = 0;
|
||||
m_selected = 0;
|
||||
m_metainfo.clear();
|
||||
|
||||
@@ -330,8 +329,6 @@ int CAudioPlayerGui::show()
|
||||
neutrino_msg_t msg;
|
||||
neutrino_msg_data_t data;
|
||||
|
||||
int pic_index = 0;
|
||||
|
||||
int ret = menu_return::RETURN_REPAINT;
|
||||
|
||||
// clear whole screen
|
||||
@@ -347,7 +344,7 @@ int CAudioPlayerGui::show()
|
||||
|
||||
while (loop)
|
||||
{
|
||||
updateMetaData(m_screensaver);
|
||||
updateMetaData();
|
||||
|
||||
updateTimes();
|
||||
|
||||
@@ -377,30 +374,10 @@ int CAudioPlayerGui::show()
|
||||
|
||||
if ( msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER)
|
||||
{
|
||||
int timeout = time(NULL) - m_idletime;
|
||||
int screensaver_timeout = g_settings.audioplayer_screensaver;
|
||||
if (screensaver_timeout !=0 && timeout > screensaver_timeout*60 && !m_screensaver)
|
||||
int delay = time(NULL) - m_idletime;
|
||||
int screensaver_delay = g_settings.screensaver_delay;
|
||||
if (screensaver_delay != 0 && delay > screensaver_delay*60 && !m_screensaver)
|
||||
screensaver(true);
|
||||
|
||||
if (msg == NeutrinoMessages::EVT_TIMER && data == stimer) {
|
||||
if (m_screensaver) {
|
||||
char fname[255];
|
||||
|
||||
sprintf(fname, "%s/mp3-%d.jpg", DATADIR "/neutrino/icons", pic_index);
|
||||
|
||||
int lret = access(fname, F_OK);
|
||||
printf("CAudioPlayerGui::show: new pic %s: %s\n", fname, lret ? "not found" : "found");
|
||||
if (lret == 0) {
|
||||
pic_index++;
|
||||
videoDecoder->StopPicture();
|
||||
videoDecoder->ShowPicture(fname);
|
||||
} else if (pic_index) {
|
||||
pic_index = 0;
|
||||
}
|
||||
} else
|
||||
pic_index = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -408,6 +385,11 @@ int CAudioPlayerGui::show()
|
||||
if (m_screensaver)
|
||||
{
|
||||
screensaver(false);
|
||||
|
||||
videoDecoder->StopPicture();
|
||||
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg");
|
||||
paint();
|
||||
|
||||
if (msg <= CRCInput::RC_MaxRC) {
|
||||
// ignore first keypress - just quit the screensaver
|
||||
g_RCInput->clearRCMsg();
|
||||
@@ -730,11 +712,11 @@ int CAudioPlayerGui::show()
|
||||
picture->exec(this, "audio");
|
||||
delete picture;
|
||||
pictureviewer = false;
|
||||
screensaver(false);
|
||||
videoDecoder->setBlank(true);
|
||||
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg");
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_AUDIO);
|
||||
paintLCD();
|
||||
screensaver(false);
|
||||
}
|
||||
else if (msg == CRCInput::RC_help)
|
||||
{
|
||||
@@ -856,7 +838,7 @@ int CAudioPlayerGui::show()
|
||||
ret = menu_return::RETURN_EXIT_ALL;
|
||||
loop = false;
|
||||
}
|
||||
paintLCD();
|
||||
//paintLCD();
|
||||
}
|
||||
}
|
||||
hide();
|
||||
@@ -2045,7 +2027,7 @@ int CAudioPlayerGui::getNext()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CAudioPlayerGui::updateMetaData(bool screen_saver)
|
||||
void CAudioPlayerGui::updateMetaData()
|
||||
{
|
||||
bool updateMeta = false;
|
||||
bool updateLcd = false;
|
||||
@@ -2075,13 +2057,13 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver)
|
||||
info << " / " << meta.samplerate/1000 << "." << (meta.samplerate/100)%10 <<"kHz";
|
||||
|
||||
m_metainfo = meta.type_info + info.str();
|
||||
updateMeta = !screen_saver;
|
||||
updateMeta = !m_screensaver;
|
||||
|
||||
if (!meta.artist.empty() && meta.artist != m_curr_audiofile.MetaData.artist)
|
||||
{
|
||||
m_curr_audiofile.MetaData.artist = meta.artist;
|
||||
|
||||
if ( !screen_saver)
|
||||
if (!m_screensaver)
|
||||
updateScreen = true;
|
||||
updateLcd = true;
|
||||
}
|
||||
@@ -2090,7 +2072,7 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver)
|
||||
{
|
||||
m_curr_audiofile.MetaData.title = meta.title;
|
||||
|
||||
if ( !screen_saver)
|
||||
if (!m_screensaver)
|
||||
updateScreen = true;
|
||||
updateLcd = true;
|
||||
}
|
||||
@@ -2101,7 +2083,8 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver)
|
||||
updateLcd = true;
|
||||
}
|
||||
|
||||
paintCover();
|
||||
if (!m_screensaver)
|
||||
paintCover();
|
||||
}
|
||||
if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0)
|
||||
updateLcd = true;
|
||||
@@ -2180,9 +2163,9 @@ void CAudioPlayerGui::updateTimes(const bool force)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((updatePlayed || updateTotal) && m_time_total != 0)
|
||||
if ((updatePlayed || updateTotal) && m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0)
|
||||
{
|
||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total, CNeutrinoApp::getInstance()->isMuted());
|
||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2193,20 +2176,14 @@ void CAudioPlayerGui::paintLCD()
|
||||
{
|
||||
case CAudioPlayerGui::STOP:
|
||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_STOP);
|
||||
CVFD::getInstance()->showAudioProgress(0, CNeutrinoApp::getInstance()->isMuted());
|
||||
CVFD::getInstance()->showAudioProgress(0);
|
||||
break;
|
||||
case CAudioPlayerGui::PLAY:
|
||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PLAY);
|
||||
|
||||
CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title,
|
||||
m_curr_audiofile.MetaData.album);
|
||||
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0)
|
||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total, CNeutrinoApp::getInstance()->isMuted());
|
||||
|
||||
#ifdef INCLUDE_UNUSED_STUFF
|
||||
else
|
||||
CVFD::getInstance()->showAudioProgress(100 * CAudioPlayer::getInstance()->getScBuffered() / 65536, CNeutrinoApp::getInstance()->isMuted());
|
||||
#endif /* INCLUDE_UNUSED_STUFF */
|
||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total);
|
||||
break;
|
||||
case CAudioPlayerGui::PAUSE:
|
||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PAUSE);
|
||||
@@ -2225,22 +2202,17 @@ void CAudioPlayerGui::paintLCD()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CAudioPlayerGui::screensaver(bool on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
m_screensaver = true;
|
||||
m_frameBuffer->Clear();
|
||||
stimer = g_RCInput->addTimer(10*1000*1000, false);
|
||||
CScreenSaver::getInstance()->Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
g_RCInput->killTimer(stimer);
|
||||
CScreenSaver::getInstance()->Stop();
|
||||
m_screensaver = false;
|
||||
videoDecoder->StopPicture();
|
||||
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/mp3.jpg");
|
||||
paint();
|
||||
m_idletime = time(NULL);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user