diff options
author | Frank Schmirler <schmirl@puter.linogate.de> | 2010-12-02 08:53:01 +0100 |
---|---|---|
committer | Frank Schmirler <schmirl@puter.linogate.de> | 2010-12-02 08:53:01 +0100 |
commit | 5e30711bfdb28085234a5ef6da4f4e44305ac3e4 (patch) | |
tree | d15809d23eeeed7fda55d9450b1af7c99d6eb5d6 /server/suspend.c | |
download | vdr-plugin-streamdev-5e30711bfdb28085234a5ef6da4f4e44305ac3e4.tar.gz vdr-plugin-streamdev-5e30711bfdb28085234a5ef6da4f4e44305ac3e4.tar.bz2 |
Snapshot 2007-03-20
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..9ac9ac5 --- /dev/null +++ b/server/suspend.c @@ -0,0 +1,69 @@ +/* + * $Id: suspend.c,v 1.1.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; +} |