diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 18:29:30 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 18:29:30 +0000 |
commit | 2f936c22b443086d6d621ab37dd9523d8f153f1d (patch) | |
tree | cda6945944457d965d5a4a4dc0c5130c41d34a75 | |
parent | b571722150e379925cc55ec7a9f52f1b9f2ad61a (diff) | |
download | vdr-plugin-live-2f936c22b443086d6d621ab37dd9523d8f153f1d.tar.gz vdr-plugin-live-2f936c22b443086d6d621ab37dd9523d8f153f1d.tar.bz2 |
- added status monitor to reload timers when a recording starts or stops
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | live.cpp | 5 | ||||
-rw-r--r-- | status.cpp | 21 | ||||
-rw-r--r-- | status.h | 23 | ||||
-rw-r--r-- | timers.cpp | 2 | ||||
-rw-r--r-- | timers.h | 1 |
6 files changed, 52 insertions, 4 deletions
@@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.28 2007/01/17 01:15:59 tadi Exp $ +# $Id: Makefile,v 1.29 2007/01/18 18:29:30 lordjaxom Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. @@ -59,7 +59,7 @@ SUBDIRS = httpd pages css images javascript ### The object files (add further files here): PLUGINOBJS = $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ - tools.o recordings.o tasks.o + tools.o recordings.o tasks.o status.o WEBLIBS = pages/libpages.a css/libcss.a images/libimages.a \ javascript/libjavascript.a @@ -3,13 +3,14 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: live.cpp,v 1.12 2007/01/16 18:34:31 lordjaxom Exp $ + * $Id: live.cpp,v 1.13 2007/01/18 18:29:30 lordjaxom Exp $ */ #include <vdr/plugin.h> #include "i18n.h" #include "live.h" #include "setup.h" +#include "status.h" #include "tasks.h" #include "thread.h" #include "timers.h" @@ -42,6 +43,8 @@ bool Plugin::Start(void) m_configDirectory = cPlugin::ConfigDirectory( PLUGIN_NAME_I18N ); RegisterI18n( vdrlive::Phrases ); + // force status monitor startup + LiveStatusMonitor(); // XXX error handling m_thread.reset( new ServerThread ); m_thread->Start(); diff --git a/status.cpp b/status.cpp new file mode 100644 index 0000000..acc60fe --- /dev/null +++ b/status.cpp @@ -0,0 +1,21 @@ +#include "status.h" +#include "timers.h" + +namespace vdrlive { + +StatusMonitor::StatusMonitor() +{ +} + +void StatusMonitor::Recording( cDevice const*, char const*, char const*, bool ) +{ + LiveTimerManager().DoReloadTimers(); +} + +StatusMonitor& LiveStatusMonitor() +{ + static StatusMonitor instance; + return instance; +} + +} // namespace vdrlive diff --git a/status.h b/status.h new file mode 100644 index 0000000..6f1b3ce --- /dev/null +++ b/status.h @@ -0,0 +1,23 @@ +#ifndef VDR_LIVE_STATUS_H +#define VDR_LIVE_STATUS_H + +#include <vdr/status.h> + +namespace vdrlive { + +class StatusMonitor: public cStatus +{ + friend StatusMonitor& LiveStatusMonitor(); + +private: + StatusMonitor(); + StatusMonitor( StatusMonitor const& ); + + virtual void Recording( cDevice const* Device, char const* Name, char const* FileName, bool On ); +}; + +StatusMonitor& LiveStatusMonitor(); + +} // namespace vdrlive + +#endif // VDR_LIVE_STATUS_H @@ -109,7 +109,7 @@ void TimerManager::DoPendingWork() dsyslog("SV: signalling waiters"); m_updateWait.Broadcast(); } - m_timers.ReloadTimers(); + DoReloadTimers(); } void TimerManager::DoUpdateTimers() @@ -41,6 +41,7 @@ public: // may only be called from Plugin::MainThreadHook void DoPendingWork(); + void DoReloadTimers() { m_timers.ReloadTimers(); } private: typedef std::pair< cTimer*, std::string > TimerPair; |