diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-05 17:52:00 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-05 17:52:00 +0000 |
commit | 93f1c156edfd067627cd969ca275f38d3b319069 (patch) | |
tree | dcad5da03d5f1073e44cf074d7207585b81cd270 /timers.h | |
parent | 5db7bc2bcf45e33e0cd1f58042751d69f29a4023 (diff) | |
download | vdr-plugin-live-93f1c156edfd067627cd969ca275f38d3b319069.tar.gz vdr-plugin-live-93f1c156edfd067627cd969ca275f38d3b319069.tar.bz2 |
- moved SortedTimers to plugin and added methods to interface from website
- added function to update internal timers from main thread
Diffstat (limited to 'timers.h')
-rw-r--r-- | timers.h | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -2,22 +2,55 @@ #define VDR_LIVE_TIMERS_H #include <list> +#include <string> #include <vdr/timers.h> +#include <vdr/thread.h> #include "live.h" namespace vdrlive { class Plugin; -class TimerManager +class SortedTimersInterface: public std::list< cTimer > +{ +public: + virtual ~SortedTimersInterface() {} + + virtual std::string GetTimerId( cTimer const& timer ) = 0; +}; + +class SortedTimers: public SortedTimersInterface +{ + friend class TimerManager; + +public: + virtual std::string GetTimerId( cTimer const& timer ); + +private: + SortedTimers(); + SortedTimers( SortedTimers const& ); + + int m_state; + int m_refs; + + void ReloadTimers( bool initial = false ); +}; + +class TimerManager: public cMutex { friend TimerManager& Plugin::GetLiveTimerManager(); +public: + SortedTimersInterface& GetTimers() { return m_timers; } + + // may only be called from Plugin::MainThreadHook + void DoPendingWork(); + private: TimerManager(); TimerManager( TimerManager const& ); - + SortedTimers m_timers; }; inline TimerManager& LiveTimerManager() |