use new exec_controlscript() function

Origin commit data
------------------
Commit: a84dbc4741
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-01-26 (Sat, 26 Jan 2019)

Origin message was:
------------------
- use new exec_controlscript() function
This commit is contained in:
vanhofen
2019-01-26 17:05:44 +01:00
parent 700e7adfe0
commit 66df79926b
8 changed files with 44 additions and 88 deletions

View File

@@ -90,8 +90,8 @@ extern cVideo * videoDecoder;
// check if files to be added are already in the playlist
#define AUDIOPLAYER_CHECK_FOR_DUPLICATES
#define AUDIOPLAYER_START_SCRIPT CONTROLDIR "/audioplayer.start"
#define AUDIOPLAYER_END_SCRIPT CONTROLDIR "/audioplayer.end"
#define AUDIOPLAYER_START_SCRIPT "audioplayer.start"
#define AUDIOPLAYER_END_SCRIPT "audioplayer.end"
#define DEFAULT_RADIOSTATIONS_XMLFILE CONFIGDIR "/radio-stations.xml"
#define DEFAULT_RADIOFAVORITES_XMLFILE CONFIGDIR "/radio-favorites.xml" //NI
@@ -316,9 +316,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
printf("[audioplayer.cpp] wakeup_hdd(%s)\n", g_settings.network_nfs_audioplayerdir.c_str());
wakeup_hdd(g_settings.network_nfs_audioplayerdir.c_str(),true);
puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT ".");
if (my_system(AUDIOPLAYER_START_SCRIPT) != 0)
perror(AUDIOPLAYER_START_SCRIPT " failed");
exec_controlscript(AUDIOPLAYER_START_SCRIPT);
int res = show();
@@ -328,9 +326,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
m_frameBuffer->useBackground(usedBackground);
m_frameBuffer->paintBackground();
puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT ".");
if (my_system(AUDIOPLAYER_END_SCRIPT) != 0)
perror(AUDIOPLAYER_END_SCRIPT " failed");
exec_controlscript(AUDIOPLAYER_END_SCRIPT);
//g_Zapit->unlockPlayBack();
CZapit::getInstance()->EnablePlayback(true);

View File

@@ -90,8 +90,8 @@
#define LCD_MODE CVFD::MODE_MOVIE
#endif
#define MOVIEPLAYER_START_SCRIPT CONTROLDIR "/movieplayer.start"
#define MOVIEPLAYER_END_SCRIPT CONTROLDIR "/movieplayer.end"
#define MOVIEPLAYER_START_SCRIPT "movieplayer.start"
#define MOVIEPLAYER_END_SCRIPT "movieplayer.end"
extern cVideo * videoDecoder;
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
@@ -387,11 +387,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
}
}
if (!access(MOVIEPLAYER_START_SCRIPT, X_OK)) {
puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT ".");
if (my_system(MOVIEPLAYER_START_SCRIPT) != 0)
perror(MOVIEPLAYER_START_SCRIPT " failed");
}
exec_controlscript(MOVIEPLAYER_START_SCRIPT);
Cleanup();
ClearFlags();
@@ -480,11 +476,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
bookmarkmanager->flush();
if (!access(MOVIEPLAYER_END_SCRIPT, X_OK)) {
puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT ".");
if (my_system(MOVIEPLAYER_END_SCRIPT) != 0)
perror(MOVIEPLAYER_END_SCRIPT " failed");
}
exec_controlscript(MOVIEPLAYER_END_SCRIPT);
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);

View File

@@ -82,8 +82,8 @@ extern cVideo * videoDecoder;
//NI InfoIcons
#include <gui/infoicons.h>
#define PICTUREVIEWER_START_SCRIPT CONTROLDIR "/pictureviewer.start"
#define PICTUREVIEWER_END_SCRIPT CONTROLDIR "/pictureviewer.end"
#define PICTUREVIEWER_START_SCRIPT "pictureviewer.start"
#define PICTUREVIEWER_END_SCRIPT "pictureviewer.end"
//------------------------------------------------------------------------
bool comparePictureByDate (const CPicture& a, const CPicture& b)
@@ -194,9 +194,7 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
if (parent)
parent->hide();
puts("[pictureviewer.cpp] executing " PICTUREVIEWER_START_SCRIPT ".");
if (my_system(PICTUREVIEWER_START_SCRIPT) != 0)
perror(PICTUREVIEWER_START_SCRIPT " failed");
exec_controlscript(PICTUREVIEWER_START_SCRIPT);
// remember last mode
m_LastMode = CNeutrinoApp::getInstance()->getMode();
@@ -231,9 +229,7 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
CZapit::getInstance()->EnablePlayback(true);
}
puts("[pictureviewer.cpp] executing " PICTUREVIEWER_END_SCRIPT ".");
if (my_system(PICTUREVIEWER_END_SCRIPT) != 0)
perror(PICTUREVIEWER_END_SCRIPT " failed");
exec_controlscript(PICTUREVIEWER_END_SCRIPT);
// Restore previous background
if (usedBackground) {

View File

@@ -59,8 +59,8 @@
extern cVideo * videoDecoder;
#define NEUTRINO_SCAN_START_SCRIPT CONFIGDIR "/scan.start"
#define NEUTRINO_SCAN_STOP_SCRIPT CONFIGDIR "/scan.stop"
#define NEUTRINO_SCAN_START_SCRIPT "scan.start"
#define NEUTRINO_SCAN_STOP_SCRIPT "scan.stop"
#define BAR_BORDER 2
#define BAR_WIDTH 150
@@ -291,10 +291,8 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
}
success = false;
if(!manual) {
if (my_system(NEUTRINO_SCAN_START_SCRIPT) != 0)
perror(NEUTRINO_SCAN_START_SCRIPT " failed");
}
if (!manual)
exec_controlscript(NEUTRINO_SCAN_START_SCRIPT);
g_Zapit->setScanBouquetMode( (CZapitClient::bouquetMode)scansettings.bouquetMode);
@@ -359,10 +357,9 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
/* to join scan thread */
g_Zapit->stopScan();
if(!manual) {
if (my_system(NEUTRINO_SCAN_STOP_SCRIPT) != 0)
perror(NEUTRINO_SCAN_STOP_SCRIPT " failed");
}
if (!manual)
exec_controlscript(NEUTRINO_SCAN_STOP_SCRIPT);
if(!test) {
CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : (canceled ? LOCALE_SCANTS_CANCELED : LOCALE_SCANTS_FAILED));
header.paint(CC_SAVE_SCREEN_NO);