diff options
author | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
commit | 302fa2e67276bd0674e81e2a9a01b9e91dd45d8c (patch) | |
tree | a454884a16e0ffa48b5ce3e4ce1a66eb874a9de0 /server/suspend.c | |
download | vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.gz vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.bz2 |
Initial revision
Diffstat (limited to 'server/suspend.c')
-rw-r--r-- | server/suspend.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/server/suspend.c b/server/suspend.c new file mode 100644 index 0000000..8f6da38 --- /dev/null +++ b/server/suspend.c @@ -0,0 +1,69 @@ +/* + * $Id: suspend.c,v 1.1 2004/12/30 22:44:21 lordjaxom Exp $ + */ + +#include "server/suspend.h" +#include "server/suspend.dat" +#include "common.h" + +cSuspendLive::cSuspendLive(void) +#if VDRVERSNUM >= 10300 + : cThread("Streamdev: server suspend") +#endif +{ +} + +cSuspendLive::~cSuspendLive() { + Detach(); +} + +void cSuspendLive::Activate(bool On) { + Dprintf("Activate cSuspendLive %d\n", On); + if (On) + Start(); + else + Stop(); +} + +void cSuspendLive::Stop(void) { + if (m_Active) { + m_Active = false; + Cancel(3); + } +} + +void cSuspendLive::Action(void) { +#if VDRVERSNUM < 10300 + isyslog("Streamdev: Suspend Live thread started (pid = %d)", getpid()); +#endif + + m_Active = true; + while (m_Active) { + DeviceStillPicture(suspend_mpg, sizeof(suspend_mpg)); + usleep(100000); + } + +#if VDRVERSNUM < 10300 + isyslog("Streamdev: Suspend Live thread stopped"); +#endif +} + +bool cSuspendCtl::m_Active = false; + +cSuspendCtl::cSuspendCtl(void): + cControl(m_Suspend = new cSuspendLive) { + m_Active = true; +} + +cSuspendCtl::~cSuspendCtl() { + m_Active = false; + DELETENULL(m_Suspend); +} + +eOSState cSuspendCtl::ProcessKey(eKeys Key) { + if (!m_Suspend->IsActive() || Key == kBack) { + DELETENULL(m_Suspend); + return osEnd; + } + return osContinue; +} |