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 /client/remote.h | |
download | vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.gz vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.bz2 |
Initial revision
Diffstat (limited to 'client/remote.h')
-rw-r--r-- | client/remote.h | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/client/remote.h b/client/remote.h new file mode 100644 index 0000000..24a7067 --- /dev/null +++ b/client/remote.h @@ -0,0 +1,132 @@ +/* + * $Id: remote.h,v 1.1 2004/12/30 22:44:03 lordjaxom Exp $ + */ + +#ifndef VDR_STREAMDEV_REMOTE_H +#define VDR_STREAMDEV_REMOTE_H + +#include <vdr/config.h> + +#include "tools/string.h" + +#if VDRVERSNUM < 10300 +class cEventInfo; +#else +class cEvent; +#endif +class cChannel; + +class cRemoteRecording: public cListObject { +private: + bool m_IsValid; + int m_Index; + bool m_IsNew; + char *m_TitleBuffer; + cTBString m_StartTime; + cTBString m_Name; + cTBString m_Summary; + +public: + cRemoteRecording(const char *Text); + ~cRemoteRecording(); + + bool operator==(const cRemoteRecording &Recording); + bool operator!=(const cRemoteRecording &Recording); + + void ParseInfo(const char *Text); + + bool IsValid(void) const { return m_IsValid; } + int Index(void) const { return m_Index; } + const char *StartTime(void) const { return m_StartTime; } + bool IsNew(void) const { return m_IsNew; } + const char *Name(void) const { return m_Name; } + const char *Summary(void) const { return m_Summary; } + const char *Title(char Delimiter, bool NewIndicator, int Level); + int HierarchyLevels(void); +}; + +inline bool cRemoteRecording::operator!=(const cRemoteRecording &Recording) { + return !operator==(Recording); +} + +class cRemoteRecordings: public cList<cRemoteRecording> { +public: + bool Load(void); + cRemoteRecording *GetByName(const char *Name); +}; + +class cRemoteTimer: public cListObject { + friend class cStreamdevMenuEditTimer; + +private: + bool m_IsValid; + int m_Index; + int m_Active; + int m_Day; + int m_Start; + int m_Stop; + time_t m_StartTime; + time_t m_StopTime; + int m_Priority; + int m_Lifetime; + char m_File[MaxFileName]; + time_t m_FirstDay; + cTBString m_Summary; + char *m_Buffer; + const cChannel *m_Channel; + +public: + cRemoteTimer(const char *Text); +#if VDRVERSNUM < 10300 + cRemoteTimer(const cEventInfo *EventInfo); +#else + cRemoteTimer(const cEvent *Event); +#endif + cRemoteTimer(void); + ~cRemoteTimer(); + + cRemoteTimer &operator=(const cRemoteTimer &Timer); + bool operator==(const cRemoteTimer &Timer); + bool operator!=(const cRemoteTimer &Timer) { return !operator==(Timer); } + + static int ParseDay(const char *s, time_t *FirstDay); + static const char *PrintDay(int d, time_t FirstDay = 0); + static time_t SetTime(time_t t, int SecondsFromMidnight); + static time_t IncDay(time_t t, int Days); + static int TimeToInt(int t) { return (t / 100 * 60 + t % 100) * 60; } + + const char *PrintFirstDay(void) const; + void OnOff(void); + bool IsSingleEvent(void) const { return (m_Day & 0x80000000) == 0; } + void Skip(void) { m_FirstDay = IncDay(SetTime(StartTime(), 0), 1); } + bool Matches(time_t t = 0); + bool DayMatches(time_t t = 0); + int GetMDay(time_t t); + int GetWDay(time_t t); + + bool IsValid(void) const { return m_IsValid; } + int Index(void) const { return m_Index; } + int Active(void) const { return m_Active; } + int Day(void) const { return m_Day; } + int Start(void) const { return m_Start; } + int Stop(void) const { return m_Stop; } + time_t StartTime(void) { if (!m_StartTime) Matches(); return m_StartTime; } + time_t StopTime(void) { if (!m_StopTime) Matches(); return m_StopTime; } + int Priority(void) const { return m_Priority; } + int Lifetime(void) const { return m_Lifetime; } + const char *File(void) const { return m_File; } + time_t FirstDay(void) const { return m_FirstDay; } + const cTBString &Summary(void) const { return m_Summary; } + const cChannel *Channel(void) const { return m_Channel; } + + const char *ToText(void); +}; + +class cRemoteTimers: public cList<cRemoteTimer> { +public: + bool Load(void); +}; + +extern cRemoteTimers RemoteTimers; + +#endif // VDR_STREAMDEV_REMOTE_H |