summaryrefslogtreecommitdiff
path: root/recmanager.h
blob: 158991fb72ef137da63dd03d83859000e47d71b0 (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
63
64
65
66
67
#ifndef __TVGUIDE_RECMMANAGER_H
#define __TVGUIDE_RECMMANAGER_H

#include <string>
#include <vector>
#include <vdr/plugin.h>
#include "detailview.h"
#include "recmenu.h"

class TVGuideTimerConflict {
public:
    time_t time;
    time_t timeStart;
    time_t timeStop;
    time_t overlapStart;
    time_t overlapStop;
    int percentPossible;
    int timerID;
    std::vector<int> timerIDs;
    bool timerInvolved(int involvedID);
};

struct TVGuideEPGSearchTemplate {
public:
    std::string name;
    std::string templValue;
};

// --- cRecManager  -------------------------------------------------------------
class cRecManager   {
private:
    cPlugin *epgSearchPlugin;
    bool epgSearchAvailable;
    void DeleteTimer(cTimer *timer);
public:
    cRecManager  (void);
    void SetEPGSearchPlugin(void);
    bool EpgSearchAvailable(void) {return epgSearchAvailable;};
    bool RefreshRemoteTimers(void);
    bool CheckEventForTimer(const cEvent *event);
    cTimer *GetTimerForEvent(const cEvent *event);
    cTimer *createTimer(const cEvent *event, std::string path);
    cTimer *createLocalTimer(const cEvent *event, std::string path);
    cTimer *createRemoteTimer(const cEvent *event, std::string path);
    void SetTimerPath(cTimer *timer, std::string path);
    void DeleteTimer(int timerID);
    void DeleteTimer(const cEvent *event);
    void DeleteLocalTimer(const cEvent *event);
    void DeleteRemoteTimer(const cEvent *event);
    void SaveTimer(cTimer *timer, cRecMenu *menu);
    bool IsRecorded(const cEvent *event);
    std::vector<TVGuideTimerConflict> CheckTimerConflict(void);
    cTimer *CreateSeriesTimer(cRecMenu *menu, std::string path);
    std::string BuildEPGSearchString(cString searchString, cRecMenu *menu);
    std::string BuildEPGSearchString(cString searchString, std::string templValue);
    const cEvent **PerformSearchTimerSearch(std::string epgSearchString, int &numResults);
    const cEvent **PerformSearch(cRecMenu *menu, bool withOptions, int &numResults);
    std::vector<TVGuideEPGSearchTemplate> ReadEPGSearchTemplates(void);
    int CreateSearchTimer(std::string epgSearchString);
    void UpdateSearchTimers(void);
    bool CreateSwitchTimer(const cEvent *event, cRecMenu *menu);
    void DeleteSwitchTimer(const cEvent *event);
    cRecording **SearchForRecordings(cString searchString, int &numResults);
    virtual ~cRecManager  (void);
};

#endif //__TVGUIDE_RECMMANAGER_H