summaryrefslogtreecommitdiff
path: root/views/viewhelpers.h
blob: 1baf4e02ed11a44c4a94b468eb5ddcc3ee5ef4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __VIEWHELPERS_H
#define __VIEWHELPERS_H

#include "../services/dvbapi.h"

typedef map<string,string> stringmap;
typedef map<string,int> intmap;
typedef pair<string,string> stringpair;

class cViewHelpers {
private:
    cMutex mutexDevices;
    int numDevices;
    bool devicesInit;
    int* lastSignalStrength;
    int* lastSignalQuality;
    bool* recDevices;
    int lSignalDisplay;
    int lSignalStrength;
    int lSignalQuality;
    int lastSecond;
    int lastMinute;
    double lastSystemLoad;
    int lastMemUsage;
    string lastVdrCPU;
    string lastVdrMEM;
    sDVBAPIEcmInfo lastEcmInfo;
    void RecName(string &path, string &name, string &folder);
    void RecPoster(const cRecording *rec, int &posterWidth, int &posterHeight, string &path, bool &hasPoster);
    void SetCurrentScheduleFromChannel(const cChannel *channel, stringmap &stringTokens, intmap &intTokens);
    void SetCurrentScheduleFromRecording(const cRecording *recording, stringmap &stringTokens, intmap &intTokens);
    bool CompareECMInfos(sDVBAPIEcmInfo *ecmInfo);
protected:
    void InitDevices(void);
    bool SetDevices(bool initial, bool light, intmap *intTokens, vector<stringmap> *devices);
    bool CheckNewMails(void);
    int GetLiveBuffer(void);
    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);
    void SetPosterBannerV2(const cRecording *recording, stringmap &stringTokens, intmap &intTokens);
    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);
    void SetMenuMessage(eMessageType type, string text, stringmap &stringTokens, intmap &intTokens);
public:
    cViewHelpers(void);
    virtual ~cViewHelpers(void);
    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);
    bool SetVDRStats            (bool forced, stringmap &stringTokens, intmap &intTokens);
    bool SetDummy               (bool forced, stringmap &stringTokens, intmap &intTokens);
};

#endif //__VIEWHELPERS_H