From c1bf83aec2961a4e84dbc1c36042bd985f044a91 Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sat, 4 Feb 2006 11:49:02 +0100 Subject: 2006-02-04: Version 1.1-cvs_ext-0.7 (vdr-text2skin-1.1-cvs_ext-0.7.diff) - changed the routines to determine the next timers - added the possibility to have a scrollbar in every menu - not fully implemented yet (to position in menu-lists is not necessarily correct, if there are more items with the same osd-text) --- status.h | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'status.h') diff --git a/status.h b/status.h index 2047595..8bd0f96 100644 --- a/status.h +++ b/status.h @@ -5,8 +5,6 @@ #ifndef VDR_TEXT2SKIN_STATUS_H #define VDR_TEXT2SKIN_STATUS_H -#include -#include #include "common.h" #include @@ -30,22 +28,32 @@ public: typedef std::string tRecordingInfo; typedef std::vector tRecordings; - struct tEvent + struct tEvent : public cListObject { - std::string title; - bool isRecording; - std::string channelName; - int channelNumber; - time_t startTime; - time_t stopTime; - int priority; + time_t startTime; + time_t stopTime; + int channelNumber; + std::string channelName; + int priority; + bool isRecording; + std::string title; - bool tEvent::operator< (const tEvent &b) const + tEvent(cTimer *timer) : + startTime(timer->StartTime()), + stopTime(timer->StopTime()), + channelNumber(timer->Channel()->Number()), + channelName(timer->Channel()->Name()), + priority(timer->Priority()), + isRecording(timer->Recording()), + title(timer->File()) {} + + virtual int Compare(const cListObject &listObj) const { - int r = startTime - b.startTime; - r = r == 0 ? b.priority - priority : r; - return r > 0 ? true : false; - }; + tEvent *e = (tEvent *)&listObj; + int r = startTime - e->startTime; + if (r == 0) r = e->priority - priority; + return r; + } }; typedef std::vector tEvents; @@ -58,8 +66,8 @@ private: bool mReplayIsLoop; bool mReplayIsShuffle; tRecordings mRecordings; - tEvents mEvents; const cRecording *mReplay; + cList mEvents; cMutex mRecordingsLock; uint mCurrentRecording; uint mNextRecording; @@ -76,7 +84,8 @@ protected: #endif virtual void OsdClear(void); virtual void OsdCurrentItem(const char *Text); - + virtual void OsdItem(const char *Text, int Index); + public: cText2SkinStatus(void); -- cgit v1.2.3