mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- add pictureviewer to info-key in audioplayer
This commit is contained in:
@@ -65,6 +65,8 @@
|
||||
#include <gui/widget/stringinput.h>
|
||||
#include <gui/widget/stringinput_ext.h>
|
||||
|
||||
#include "gui/pictureviewer.h"
|
||||
|
||||
#include <system/settings.h>
|
||||
#include <system/helpers.h>
|
||||
#include <driver/screen_max.h>
|
||||
@@ -198,6 +200,8 @@ void CAudioPlayerGui::Init(void)
|
||||
m_selected = 0;
|
||||
m_metainfo.clear();
|
||||
|
||||
pictureviewer = false;
|
||||
|
||||
m_select_title_by_name = g_settings.audioplayer_select_title_by_name==1;
|
||||
|
||||
if (strlen(g_settings.network_nfs_audioplayerdir)!=0)
|
||||
@@ -753,6 +757,22 @@ int CAudioPlayerGui::show()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( (msg == CRCInput::RC_info) && (!m_playlist.empty()) )
|
||||
{
|
||||
pictureviewer = true;
|
||||
m_frameBuffer->Clear();
|
||||
videoDecoder->StopPicture();
|
||||
CPictureViewerGui * picture = new CPictureViewerGui();
|
||||
picture->m_audioPlayer = this;
|
||||
picture->exec(this, "audio");
|
||||
delete picture;
|
||||
pictureviewer = 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)
|
||||
{
|
||||
if (m_key_level == 2)
|
||||
@@ -904,6 +924,17 @@ bool CAudioPlayerGui::playNext(bool allow_rotate)
|
||||
return(result);
|
||||
}
|
||||
|
||||
void CAudioPlayerGui::wantNextPlay()
|
||||
{
|
||||
if ((m_state != CAudioPlayerGui::STOP) &&
|
||||
(CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) &&
|
||||
(!m_playlist.empty()))
|
||||
{
|
||||
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO)
|
||||
playNext();
|
||||
}
|
||||
}
|
||||
|
||||
bool CAudioPlayerGui::playPrev(bool allow_rotate)
|
||||
{
|
||||
bool result = false;
|
||||
@@ -1698,10 +1729,11 @@ const struct button_label AudioPlayerButtons[][4] =
|
||||
void CAudioPlayerGui::paintFoot()
|
||||
{
|
||||
// printf("paintFoot{\n");
|
||||
const struct button_label ScondLineButtons[2] =
|
||||
const struct button_label ScondLineButtons[3] =
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY },
|
||||
{ NEUTRINO_ICON_BUTTON_HELP , LOCALE_AUDIOPLAYER_KEYLEVEL },
|
||||
{ NEUTRINO_ICON_BUTTON_INFO , LOCALE_PICTUREVIEWER_HEAD},
|
||||
};
|
||||
|
||||
int top;
|
||||
@@ -1717,8 +1749,7 @@ const struct button_label ScondLineButtons[2] =
|
||||
m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1);
|
||||
|
||||
if (!m_playlist.empty())
|
||||
::paintButtons(m_x, top+m_buttonHeight, m_width, 2, ScondLineButtons, m_buttonHeight, ButtonWidth);
|
||||
|
||||
::paintButtons(m_x, top+m_buttonHeight, m_width, 3, ScondLineButtons, m_buttonHeight, ButtonWidth);
|
||||
|
||||
if (m_key_level == 0)
|
||||
{
|
||||
@@ -1943,12 +1974,16 @@ void CAudioPlayerGui::stop()
|
||||
{
|
||||
m_state = CAudioPlayerGui::STOP;
|
||||
m_current = 0;
|
||||
//LCD
|
||||
paintLCD();
|
||||
//Display
|
||||
paintInfo();
|
||||
m_key_level = 0;
|
||||
paintFoot();
|
||||
|
||||
if (!pictureviewer)
|
||||
{
|
||||
//LCD
|
||||
paintLCD();
|
||||
//Display
|
||||
paintInfo();
|
||||
m_key_level = 0;
|
||||
paintFoot();
|
||||
}
|
||||
|
||||
if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)
|
||||
CAudioPlayer::getInstance()->stop();
|
||||
@@ -2022,31 +2057,31 @@ void CAudioPlayerGui::play(unsigned int pos)
|
||||
if (m_selected - m_liststart >= m_listmaxshow && g_settings.audioplayer_follow)
|
||||
{
|
||||
m_liststart = m_selected;
|
||||
if (!m_screensaver)
|
||||
if (!m_screensaver && !pictureviewer)
|
||||
paint();
|
||||
}
|
||||
else if (m_liststart < m_selected && g_settings.audioplayer_follow)
|
||||
{
|
||||
m_liststart = m_selected - m_listmaxshow + 1;
|
||||
if (!m_screensaver)
|
||||
if (!m_screensaver && !pictureviewer)
|
||||
paint();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (old_current >= m_liststart && old_current - m_liststart < m_listmaxshow)
|
||||
{
|
||||
if (!m_screensaver)
|
||||
if (!m_screensaver && !pictureviewer)
|
||||
paintItem(old_current - m_liststart);
|
||||
}
|
||||
if (pos >= m_liststart && pos - m_liststart < m_listmaxshow)
|
||||
{
|
||||
if (!m_screensaver)
|
||||
if (!m_screensaver && !pictureviewer)
|
||||
paintItem(pos - m_liststart);
|
||||
}
|
||||
if (g_settings.audioplayer_follow)
|
||||
{
|
||||
if (old_selected >= m_liststart && old_selected - m_liststart < m_listmaxshow)
|
||||
if (!m_screensaver)
|
||||
if (!m_screensaver && !pictureviewer)
|
||||
paintItem(old_selected - m_liststart);
|
||||
}
|
||||
}
|
||||
@@ -2065,14 +2100,18 @@ void CAudioPlayerGui::play(unsigned int pos)
|
||||
m_curr_audiofile = m_playlist[m_current];
|
||||
// Play
|
||||
CAudioPlayer::getInstance()->play(&m_curr_audiofile, g_settings.audioplayer_highprio == 1);
|
||||
//LCD
|
||||
paintLCD();
|
||||
// Display
|
||||
if (!m_screensaver)
|
||||
paintInfo();
|
||||
m_key_level = 1;
|
||||
if (!m_screensaver)
|
||||
paintFoot();
|
||||
|
||||
if (!pictureviewer)
|
||||
{
|
||||
//LCD
|
||||
paintLCD();
|
||||
// Display
|
||||
if (!m_screensaver)
|
||||
paintInfo();
|
||||
m_key_level = 1;
|
||||
if (!m_screensaver)
|
||||
paintFoot();
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
|
@@ -251,11 +251,15 @@ class CAudioPlayerGui : public CMenuTarget
|
||||
bool playNext(bool allow_rotate = false);
|
||||
bool playPrev(bool allow_rotate = false);
|
||||
|
||||
bool pictureviewer;
|
||||
|
||||
public:
|
||||
CAudioPlayerGui(bool inetmode = false);
|
||||
~CAudioPlayerGui();
|
||||
int show();
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
|
||||
void wantNextPlay();
|
||||
};
|
||||
|
||||
|
||||
|
@@ -112,8 +112,12 @@ CPictureViewerGui::~CPictureViewerGui()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/)
|
||||
int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
{
|
||||
audioplayer = false;
|
||||
if (actionKey == "audio")
|
||||
audioplayer = true;
|
||||
|
||||
selected = 0;
|
||||
width = w_max (710, 0);
|
||||
height = h_max (570, 0);
|
||||
@@ -159,14 +163,16 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & /*actionKey
|
||||
// remember last mode
|
||||
m_LastMode=(CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap);
|
||||
|
||||
//g_Zapit->setStandby(true);
|
||||
g_Zapit->lockPlayBack();
|
||||
if (!audioplayer) { // !!! why? !!!
|
||||
//g_Zapit->setStandby(true);
|
||||
g_Zapit->lockPlayBack();
|
||||
|
||||
// blank background screen
|
||||
videoDecoder->setBlank(true);
|
||||
// blank background screen
|
||||
videoDecoder->setBlank(true);
|
||||
|
||||
// Stop Sectionsd
|
||||
g_Sectionsd->setPauseScanning(true);
|
||||
// Stop Sectionsd
|
||||
g_Sectionsd->setPauseScanning(true);
|
||||
}
|
||||
|
||||
// Save and Clear background
|
||||
bool usedBackground = frameBuffer->getuseBackground();
|
||||
@@ -180,11 +186,13 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & /*actionKey
|
||||
// free picviewer mem
|
||||
m_viewer->Cleanup();
|
||||
|
||||
//g_Zapit->setStandby(false);
|
||||
g_Zapit->unlockPlayBack();
|
||||
if (!audioplayer) { // !!! why? !!!
|
||||
//g_Zapit->setStandby(false);
|
||||
g_Zapit->unlockPlayBack();
|
||||
|
||||
// Start Sectionsd
|
||||
g_Sectionsd->setPauseScanning(false);
|
||||
// Start Sectionsd
|
||||
g_Sectionsd->setPauseScanning(false);
|
||||
}
|
||||
|
||||
// Restore previous background
|
||||
if (usedBackground) {
|
||||
@@ -226,6 +234,9 @@ int CPictureViewerGui::show()
|
||||
paint();
|
||||
}
|
||||
|
||||
if (audioplayer)
|
||||
m_audioPlayer->wantNextPlay();
|
||||
|
||||
if (m_state!=SLIDESHOW)
|
||||
timeout=50; // egal
|
||||
else
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include <driver/pictureviewer/pictureviewer.h>
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/filebrowser.h>
|
||||
#include <gui/audioplayer.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -109,10 +110,14 @@ class CPictureViewerGui : public CMenuTarget
|
||||
void showHelp();
|
||||
void deletePicFile(unsigned int index, bool mode);
|
||||
|
||||
bool audioplayer;
|
||||
|
||||
public:
|
||||
CPictureViewerGui();
|
||||
~CPictureViewerGui();
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
|
||||
CAudioPlayerGui *m_audioPlayer;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user