summaryrefslogtreecommitdiff
path: root/plugin/status.h
blob: 3f0f5a51763216fcd49369cde8fc8eaaf7d89f17 (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
/*
 * status.h: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */
#ifndef __status_h_
#define __status_h_

#include <vdr/status.h>
#include "setup.h"

#if __GNUC__ > 3
#define UNUSED(v) UNUSED_ ## v __attribute__((unused))
#else
#define UNUSED(x) x
#endif

struct recs
{
    char *Name;
    char *FileName;
    pid_t Pid;
    char Status;
    bool ChangedbyUser;
};

// --- cStatusMarkAd
class cStatusMarkAd : public cStatus
{
private:
    struct recs recs[MAXDEVICES*MAXRECEIVERS];
    struct setup *setup;

    const char *bindir;
    const char *logodir;

    int actpos;

    bool getPid(int Position);
    bool getStatus(int Position);
    int Recording();
    bool Replaying();
    int Get(const char *FileName, const char *Name=NULL);
    int Add(const char *FileName, const char *Name);
    void Remove(int Position, bool Kill=false);
    void Remove(const char *Name, bool Kill=false);
    void Pause(const char *FileName);
    void Continue(const char *FileName);
    bool LogoExists(const char *Name);
protected:
    virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On);
    virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On);
    virtual void TimerChange(const cTimer *Timer, eTimerChange Change);
public:
    cStatusMarkAd(const char *BinDir,const char *LogoDir, struct setup *Setup);
    ~cStatusMarkAd();
    bool MarkAdRunning(void);
    void ResetActPos(void)
    {
        actpos=0;
    }
    bool GetNextActive(struct recs **RecEntry);
    bool Start(const char *FileName, const char *Name, const bool Direct=false);
};

#endif