summaryrefslogtreecommitdiff
path: root/dvdplugin.h
blob: d6268bbbe5be95a77de269e7a31f50c15bc5adea (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
#ifndef __DVDPLUGIN_DVDSWITCH_H
#define __DVDPLUGIN_DVDSWITCH_H

#include <vdr/thread.h>
#include "helpers.h"
#include "setup.h"

class cDVDPluginThread : public cThread
{
  private:
    char *Image;
  protected:
    virtual void Action(void);
  public:
    cDVDPluginThread(const char *image = NULL);
    ~cDVDPluginThread(void);
};

class cDVDPlugin
{
  private:
    static cDVDPluginThread *thread;
    static void DetectDevice(void);
    static void SetLink(void);
    static void KillLink(void)
    {
      cFileCMD::Del(DVDSwitchSetup.DVDLink);
    };
  public:
    static void Start(const char *image = NULL);
    static void Exit(void);
    static void ChangeLink(const char *target, const char *link);
    static void Init(void)
    {
      DetectDevice();
      ChangeLink(DVDSwitchSetup.DVDLinkOrg, DVDSwitchSetup.DVDLink);
      SetLink();
    }
    static void Finish(void)
    {
      Exit();
      KillLink();
    }
};

#endif // __DVDPLUGIN_DVDSWITCH_H