mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
* reworked CA menu code
* added support for internal cardreaders for future conax support * added inactivity shutdown timer for EuP WARNING: new libcoolstream and libOpenThreads needed. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@925 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -63,6 +63,8 @@ void* SHTDCNT::TimeThread(void *)
|
||||
|
||||
void SHTDCNT::init()
|
||||
{
|
||||
shutdown_cnt = atoi(g_settings.shutdown_count) * 60;
|
||||
sleep_cnt = g_settings.shutdown_min*60;
|
||||
if (pthread_create (&thrTime, NULL, TimeThread, NULL) != 0 )
|
||||
{
|
||||
perror("[SHTDCNT]: pthread_create(TimeThread)");
|
||||
@@ -72,6 +74,7 @@ void SHTDCNT::init()
|
||||
|
||||
void SHTDCNT::shutdown_counter()
|
||||
{
|
||||
static bool sleeptimer_active = true;
|
||||
if (atoi(g_settings.shutdown_count) > 0)
|
||||
{
|
||||
if ((CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby) && (!CNeutrinoApp::getInstance ()->recordingstatus))
|
||||
@@ -79,13 +82,14 @@ void SHTDCNT::shutdown_counter()
|
||||
if (shutdown_cnt > 0 )
|
||||
{
|
||||
shutdown_cnt = shutdown_cnt - 1;
|
||||
printf("[SHTDCNT] shutdown counter: %d sec to shutdown\n", shutdown_cnt);
|
||||
//printf("[SHTDCNT] shutdown counter: %d sec to shutdown\n", shutdown_cnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send shutdown message
|
||||
printf("[SHTDCNT] shutdown counter send NeutrinoMessages::SHUTDOWN\n");
|
||||
CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::SHUTDOWN, 0);
|
||||
// send shutdown message
|
||||
printf("[SHTDCNT] shutdown counter send NeutrinoMessages::SHUTDOWN\n");
|
||||
//CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::SHUTDOWN, 0);
|
||||
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -94,4 +98,20 @@ void SHTDCNT::shutdown_counter()
|
||||
shutdown_cnt = atoi(g_settings.shutdown_count) * 60;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_settings.shutdown_min > 0) {
|
||||
if(sleep_cnt > 0) {
|
||||
sleeptimer_active = true;
|
||||
sleep_cnt--;
|
||||
} else if(sleeptimer_active && !CNeutrinoApp::getInstance ()->recordingstatus) {
|
||||
sleeptimer_active = false;
|
||||
printf("[SHTDCNT] sleep-timer send NeutrinoMessages::SLEEPTIMER\n");
|
||||
g_RCInput->postMsg(NeutrinoMessages::SLEEPTIMER, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SHTDCNT::resetSleepTimer()
|
||||
{
|
||||
sleep_cnt = g_settings.shutdown_min*60;
|
||||
}
|
||||
|
Reference in New Issue
Block a user