diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2010-06-18 22:52:36 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2010-06-18 22:52:36 +0200 |
commit | d8f8154bb9967da609354b27e25ae6f47ba6dd27 (patch) | |
tree | 2d34e0601ca87a024d6e13a295c8883ee73ec9fb /service.h | |
parent | 4f8e89fbe330a263130ca066a1671297f939e42d (diff) | |
download | vdr-plugin-graphlcd-d8f8154bb9967da609354b27e25ae6f47ba6dd27.tar.gz vdr-plugin-graphlcd-d8f8154bb9967da609354b27e25ae6f47ba6dd27.tar.bz2 |
new class for external services (service informations from other plugins: defined for now: radiotext, lcr, femon); radiotext/lcr-hack no longer necessary because of ext. services; new tokens for ext. services; bug fixes (casting, uint64_t, update detection); patches for femon <= 1.7.7
Diffstat (limited to 'service.h')
-rw-r--r-- | service.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/service.h b/service.h new file mode 100644 index 0000000..1248af5 --- /dev/null +++ b/service.h @@ -0,0 +1,87 @@ +/** + * GraphLCD plugin for the Video Disk Recorder + * + * service.h - class for events from external services + * + * (c) 2010 Wolfgang Astleitner <mrwastl AT users sourceforge net> + **/ + +#ifndef _GRAPHLCD_SERVICE_H_ +#define _GRAPHLCD_SERVICE_H_ + +#include <glcdskin/type.h> + +#include <string> +#include <vdr/plugin.h> + +#include <vector> // req. for state.h +#include "state.h" + +// Radiotext +struct RadioTextService_v1_0 { + int rds_info; + int rds_pty; + char *rds_text; + char *rds_title; + char *rds_artist; + struct tm *title_start; +}; + +// LcrData +struct LcrService_v1_0 { + cString destination; + cString price; + cString pulse; +}; + +// Femon +struct FemonService_v1_0 { + cString fe_name; + cString fe_status; + uint16_t fe_snr; + uint16_t fe_signal; + uint32_t fe_ber; + uint32_t fe_unc; + double video_bitrate; + double audio_bitrate; + double dolby_bitrate; +}; + + + +class cGraphLCDService +{ +private: + //cMutex mutex; + cGraphLCDState * mState; + + RadioTextService_v1_0 checkRTSData, currRTSData; + LcrService_v1_0 checkLcrData, currLcrData; + FemonService_v1_0 checkFemonData, currFemonData; + /* __Changed = data has been changed */ + /* __Active = plugin/service is available and active */ + /* __Use = service is requested in skin (don't call services that wouldn't be used anyway) */ + bool radioChanged, radioActive, radioUse; + bool lcrChanged, lcrActive, lcrUse; + bool femonChanged, femonActive, femonUse; + // timestamp of last service update request + uint64_t radioLastChange, lcrLastChange, femonLastChange; + // min. delay between two service update requests + int radioUpdateDelay, lcrUpdateDelay, femonUpdateDelay; + + // check if femon version <= 1.7.7 + bool femonVersionChecked, femonVersionValid; + +//protected: + +public: + cGraphLCDService(cGraphLCDState * state); + virtual ~cGraphLCDService(); + + bool ServiceIsAvailable(const std::string & Name); + void SetServiceUpdateDelay(const std::string & Name, int delay); + bool NeedsUpdate(uint64_t CurrentTime); + GLCD::cType GetItem(const std::string & ServiceName, const std::string & Item); +}; + +#endif |