mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Move suspend on inactivity to houesekeeping.
This commit is contained in:
parent
c19b86411a
commit
8612044b9b
@ -1402,7 +1402,7 @@ class cPluginSoftHdDevice:public cPlugin
|
||||
virtual bool Initialize(void);
|
||||
virtual bool Start(void);
|
||||
virtual void Stop(void);
|
||||
// virtual void Housekeeping(void);
|
||||
virtual void Housekeeping(void);
|
||||
virtual void MainThreadHook(void);
|
||||
virtual const char *MainMenuEntry(void);
|
||||
virtual cOsdObject *MainMenuAction(void);
|
||||
@ -1501,6 +1501,10 @@ bool cPluginSoftHdDevice::Start(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
** Shutdown plugin. Stop any background activities the plugin is
|
||||
** performing.
|
||||
*/
|
||||
void cPluginSoftHdDevice::Stop(void)
|
||||
{
|
||||
//dsyslog("[softhddev]%s:\n", __FUNCTION__);
|
||||
@ -1508,8 +1512,6 @@ void cPluginSoftHdDevice::Stop(void)
|
||||
::Stop();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/**
|
||||
** Perform any cleanup or other regular tasks.
|
||||
*/
|
||||
@ -1517,10 +1519,18 @@ void cPluginSoftHdDevice::Housekeeping(void)
|
||||
{
|
||||
dsyslog("[softhddev]%s:\n", __FUNCTION__);
|
||||
|
||||
// ::Housekeeping();
|
||||
}
|
||||
// check if user is inactive, automatic enter suspend mode
|
||||
// FIXME: cControl prevents shutdown, disable this until fixed
|
||||
if (0 && SuspendMode == NOT_SUSPENDED && ShutdownHandler.IsUserInactive()) {
|
||||
// don't overwrite already suspended suspend mode
|
||||
cControl::Launch(new cSoftHdControl);
|
||||
cControl::Attach();
|
||||
Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11);
|
||||
SuspendMode = SUSPEND_NORMAL;
|
||||
}
|
||||
|
||||
#endif
|
||||
::Housekeeping();
|
||||
}
|
||||
|
||||
/**
|
||||
** Create main menu entry.
|
||||
@ -1556,16 +1566,6 @@ void cPluginSoftHdDevice::MainThreadHook(void)
|
||||
cDevice::SetPrimaryDevice(DoMakePrimary);
|
||||
DoMakePrimary = 0;
|
||||
}
|
||||
// check if user is inactive, automatic enter suspend mode
|
||||
// FIXME: cControl prevents shutdown, disable this until fixed
|
||||
// FIXME: move this to ::Housekeeping
|
||||
if (0 && SuspendMode == NOT_SUSPENDED && ShutdownHandler.IsUserInactive()) {
|
||||
// don't overwrite already suspended suspend mode
|
||||
cControl::Launch(new cSoftHdControl);
|
||||
cControl::Attach();
|
||||
Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11);
|
||||
SuspendMode = SUSPEND_NORMAL;
|
||||
}
|
||||
|
||||
::MainThreadHook();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user