2014-10-25 20:10:00 +02:00
|
|
|
#ifndef __VIEWHELPERS_H
|
|
|
|
#define __VIEWHELPERS_H
|
|
|
|
|
2015-04-26 14:05:14 +02:00
|
|
|
#include "../services/dvbapi.h"
|
|
|
|
|
2015-05-10 12:55:23 +02:00
|
|
|
typedef map<string,string> stringmap;
|
|
|
|
typedef map<string,int> intmap;
|
2015-07-07 17:58:10 +02:00
|
|
|
typedef pair<string,string> stringpair;
|
2015-05-10 12:55:23 +02:00
|
|
|
|
2014-11-01 13:19:07 +01:00
|
|
|
class cViewHelpers {
|
2014-10-25 20:10:00 +02:00
|
|
|
private:
|
2015-07-16 18:08:22 +02:00
|
|
|
cMutex mutexDevices;
|
2015-03-22 08:29:52 +01:00
|
|
|
int numDevices;
|
2014-10-25 20:10:00 +02:00
|
|
|
bool devicesInit;
|
|
|
|
int* lastSignalStrength;
|
|
|
|
int* lastSignalQuality;
|
|
|
|
bool* recDevices;
|
2015-03-28 11:57:51 +01:00
|
|
|
int lSignalDisplay;
|
|
|
|
int lSignalStrength;
|
|
|
|
int lSignalQuality;
|
2015-01-06 06:07:48 +01:00
|
|
|
int lastSecond;
|
|
|
|
int lastMinute;
|
2015-03-28 11:57:51 +01:00
|
|
|
double lastSystemLoad;
|
|
|
|
int lastMemUsage;
|
2015-05-14 16:55:56 +02:00
|
|
|
string lastVdrCPU;
|
|
|
|
string lastVdrMEM;
|
2015-04-26 14:05:14 +02:00
|
|
|
sDVBAPIEcmInfo lastEcmInfo;
|
2015-03-29 13:29:59 +02:00
|
|
|
void RecName(string &path, string &name, string &folder);
|
|
|
|
void RecPoster(const cRecording *rec, int &posterWidth, int &posterHeight, string &path, bool &hasPoster);
|
2015-05-10 12:55:23 +02:00
|
|
|
void SetCurrentScheduleFromChannel(const cChannel *channel, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
void SetCurrentScheduleFromRecording(const cRecording *recording, stringmap &stringTokens, intmap &intTokens);
|
2015-04-26 14:05:14 +02:00
|
|
|
bool CompareECMInfos(sDVBAPIEcmInfo *ecmInfo);
|
2014-10-25 20:10:00 +02:00
|
|
|
protected:
|
2014-10-28 16:39:42 +01:00
|
|
|
void InitDevices(void);
|
2015-05-10 12:55:23 +02:00
|
|
|
bool SetDevices(bool initial, bool light, intmap *intTokens, vector<stringmap> *devices);
|
2014-11-15 16:24:07 +01:00
|
|
|
bool CheckNewMails(void);
|
2015-05-15 10:03:34 +02:00
|
|
|
int GetLiveBuffer(void);
|
2015-05-10 12:55:23 +02:00
|
|
|
void SetScraperTokens(const cEvent *event, const cRecording *recording, stringmap &stringTokens, intmap &intTokens, map < string, vector<stringmap> > &loopTokens);
|
|
|
|
void SetPosterBanner(const cEvent *event, stringmap &stringTokens, intmap &intTokens);
|
2015-06-13 15:41:41 +02:00
|
|
|
void SetPosterBannerV2(const cRecording *recording, stringmap &stringTokens, intmap &intTokens);
|
2015-05-10 12:55:23 +02:00
|
|
|
void SetTimers(map<string,int> *intTokens, map<string,string> *stringTokens, vector<stringmap> *timers);
|
|
|
|
void SetLastRecordings(map<string,int> *intTokens, map<string,string> *stringTokens, vector<stringmap> *lastRecordings);
|
|
|
|
void SetMenuHeader(eMenuCategory cat, string menuTitle, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
void SetCurrentSchedule(string recName, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetEcmInfos(int channelSid, stringmap &stringTokens, intmap &intTokens);
|
2015-05-14 11:26:30 +02:00
|
|
|
void SetMenuMessage(eMessageType type, string text, stringmap &stringTokens, intmap &intTokens);
|
2014-10-25 20:10:00 +02:00
|
|
|
public:
|
|
|
|
cViewHelpers(void);
|
|
|
|
virtual ~cViewHelpers(void);
|
2015-05-10 12:55:23 +02:00
|
|
|
bool SetDate (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetTime (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetSignal (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetCurrentWeatherTokens(bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetDiscUsage (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetSystemLoad (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetSystemMemory (bool forced, stringmap &stringTokens, intmap &intTokens);
|
|
|
|
bool SetSystemTemperatures (bool forced, stringmap &stringTokens, intmap &intTokens);
|
2015-05-14 16:55:56 +02:00
|
|
|
bool SetVDRStats (bool forced, stringmap &stringTokens, intmap &intTokens);
|
2015-05-10 12:55:23 +02:00
|
|
|
bool SetDummy (bool forced, stringmap &stringTokens, intmap &intTokens);
|
2014-10-25 20:10:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__VIEWHELPERS_H
|