Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

This commit is contained in:
[CST] Focus
2012-12-04 10:48:27 +04:00
13 changed files with 139 additions and 12 deletions

View File

@@ -159,9 +159,6 @@ class CAudioPlayerGui : public CMenuTarget
CFileFilter audiofilefilter;
void paintItemID3DetailsLine (int pos);
void clearItemID3DetailsLine ();
void play(unsigned int pos);
void stop();
void pause();
void ff(unsigned int seconds=0);
void rev(unsigned int seconds=0);
int getNext();
@@ -248,8 +245,6 @@ class CAudioPlayerGui : public CMenuTarget
bool openSCbrowser(void);
bool clearPlaylist(void);
bool shufflePlaylist(void);
bool playNext(bool allow_rotate = false);
bool playPrev(bool allow_rotate = false);
bool pictureviewer;
@@ -260,6 +255,12 @@ class CAudioPlayerGui : public CMenuTarget
int exec(CMenuTarget* parent, const std::string & actionKey);
void wantNextPlay();
void pause();
void play(unsigned int pos);
void stop();
bool playNext(bool allow_rotate = false);
bool playPrev(bool allow_rotate = false);
int getAdioPayerM_currend() {return m_current;}
};

View File

@@ -101,6 +101,9 @@ CPictureViewerGui::CPictureViewerGui()
picture_filter.addFilter("jpeg");
picture_filter.addFilter("gif");
picture_filter.addFilter("crw");
decodeT = 0;
decodeTflag = false;
}
//------------------------------------------------------------------------
@@ -109,6 +112,12 @@ CPictureViewerGui::~CPictureViewerGui()
{
playlist.clear();
delete m_viewer;
if (decodeT)
{
pthread_cancel(decodeT);
decodeT = 0;
}
}
//------------------------------------------------------------------------
@@ -225,6 +234,9 @@ int CPictureViewerGui::show()
bool loop=true;
bool update=true;
if (audioplayer)
m_currentTitle = m_audioPlayer->getAdioPayerM_currend();
while (loop)
{
if (update)
@@ -544,6 +556,35 @@ int CPictureViewerGui::show()
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD));
}
}
else if (((msg==CRCInput::RC_plus) || (msg==CRCInput::RC_minus)) && decodeTflag)
{
// FIXME: do not accept volume-keys while decoding
}
// control keys for audioplayer
else if (audioplayer && msg==CRCInput::RC_pause)
{
m_currentTitle = m_audioPlayer->getAdioPayerM_currend();
m_audioPlayer->pause();
}
else if (audioplayer && msg==CRCInput::RC_stop)
{
m_currentTitle = m_audioPlayer->getAdioPayerM_currend();
m_audioPlayer->stop();
}
else if (audioplayer && msg==CRCInput::RC_play)
{
m_currentTitle = m_audioPlayer->getAdioPayerM_currend();
if (m_currentTitle > -1)
m_audioPlayer->play((unsigned int)m_currentTitle);
}
else if (audioplayer && msg==CRCInput::RC_forward)
{
m_audioPlayer->playNext();
}
else if (audioplayer && msg==CRCInput::RC_rewind)
{
m_audioPlayer->playPrev();
}
else if (msg == NeutrinoMessages::CHANGEMODE)
{
if ((data & NeutrinoMessages::mode_mask) !=NeutrinoMessages::mode_pic)
@@ -726,6 +767,10 @@ void CPictureViewerGui::paint()
void CPictureViewerGui::view(unsigned int index, bool unscaled)
{
if (decodeTflag)
return;
m_unscaled = unscaled;
selected=index;
CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str());
@@ -733,26 +778,59 @@ void CPictureViewerGui::view(unsigned int index, bool unscaled)
strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[index].Date));
//CVFD::getInstance()->showMenuText(1, timestring); //FIXME
if (unscaled)
m_viewer->DecodeImage(playlist[index].Filename, true, unscaled);
m_viewer->ShowImage(playlist[index].Filename, unscaled);
if (m_state==MENU)
m_state=VIEW;
//decode and view in a seperate thread
if (!decodeTflag) {
decodeTflag=true;
pthread_create(&decodeT, NULL, decodeThread, (void*) this);
pthread_detach(decodeT);
}
}
void* CPictureViewerGui::decodeThread(void *arg)
{
CPictureViewerGui *PictureViewerGui = (CPictureViewerGui*) arg;
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
PictureViewerGui->thrView();
PictureViewerGui->decodeTflag=false;
pthread_exit(NULL);
}
void CPictureViewerGui::thrView()
{
if (m_unscaled)
m_viewer->DecodeImage(playlist[selected].Filename, true, m_unscaled);
m_viewer->ShowImage(playlist[selected].Filename, m_unscaled);
#if 0
//Decode next
unsigned int next=selected+1;
if (next > playlist.size()-1)
next=0;
if (m_state==MENU)
m_state=VIEW;
if (m_state==VIEW)
m_viewer->DecodeImage(playlist[next].Filename,true);
else
m_viewer->DecodeImage(playlist[next].Filename,false);
#endif
}
void CPictureViewerGui::endView()
{
if (m_state != MENU)
m_state=MENU;
if (decodeTflag)
{
decodeTflag=false;
pthread_cancel(decodeT);
}
}
void CPictureViewerGui::deletePicFile(unsigned int index, bool mode)
@@ -798,8 +876,16 @@ void CPictureViewerGui::showHelp()
helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP20));
helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP21));
helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP22));
helpbox.addLine("Version: $Revision: 1.57 $");
if(audioplayer)
{
helpbox.addPagebreak();
helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30));
helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31));
helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32));
helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33));
helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34));
helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35));
}
hide();
helpbox.show(LOCALE_MESSAGEBOX_INFO);
}

View File

@@ -111,6 +111,14 @@ class CPictureViewerGui : public CMenuTarget
void deletePicFile(unsigned int index, bool mode);
bool audioplayer;
int m_currentTitle;
pthread_t decodeT;
static void* decodeThread(void *arg);
bool decodeTflag;
void thrView();
bool m_unscaled;
public:
CPictureViewerGui();

View File

@@ -61,6 +61,10 @@
#define NEUTRINO_ICON_BUTTON_DOWN_SMALL "down_small"
#define NEUTRINO_ICON_BUTTON_LEFT "left"
#define NEUTRINO_ICON_BUTTON_BACKWARD "btn_backward"
#define NEUTRINO_ICON_BUTTON_FORWARD "btn_forward"
#define NEUTRINO_ICON_BUTTON_PAUSE "btn_pause"
#define NEUTRINO_ICON_BUTTON_PLAY "btn_play"
#define NEUTRINO_ICON_BUTTON_RECORD_ACTIVE "btn_record_active"
#define NEUTRINO_ICON_BUTTON_RECORD_INACTIVE "btn_record_inactive"
#define NEUTRINO_ICON_BUTTON_STOP "btn_stop"

View File

@@ -1479,6 +1479,12 @@ typedef enum
LOCALE_PICTUREVIEWER_HELP21,
LOCALE_PICTUREVIEWER_HELP22,
LOCALE_PICTUREVIEWER_HELP3,
LOCALE_PICTUREVIEWER_HELP30,
LOCALE_PICTUREVIEWER_HELP31,
LOCALE_PICTUREVIEWER_HELP32,
LOCALE_PICTUREVIEWER_HELP33,
LOCALE_PICTUREVIEWER_HELP34,
LOCALE_PICTUREVIEWER_HELP35,
LOCALE_PICTUREVIEWER_HELP4,
LOCALE_PICTUREVIEWER_HELP5,
LOCALE_PICTUREVIEWER_HELP6,

View File

@@ -1479,6 +1479,12 @@ const char * locale_real_names[] =
"pictureviewer.help21",
"pictureviewer.help22",
"pictureviewer.help3",
"pictureviewer.help30",
"pictureviewer.help31",
"pictureviewer.help32",
"pictureviewer.help33",
"pictureviewer.help34",
"pictureviewer.help35",
"pictureviewer.help4",
"pictureviewer.help5",
"pictureviewer.help6",