summaryrefslogtreecommitdiff
path: root/discmgr.h
blob: e35950b5c15e3a25b247c8720da24dc8e008d08a (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
/*
 * discmgr.h: BluRay disc / drive manager
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef _DISCMGR_H
#define _DISCMGR_H

#include <vdr/tools.h>

#define DEFAULT_DEVICE    "/dev/sr0"
#define DEFAULT_PATH      "/media/cdrom"
#define DEFAULT_MOUNTER   "/bin/mount"
#define DEFAULT_UNMOUNTER "/bin/umount"
#define DEFAULT_EJECT     "/usr/bin/eject"

class cDiscMgr {

private:

  cString Device, Path, MountCmd, UnMountCmd, EjectCmd;

  void Mount(bool Retry = true);
  void UnMount(void);
  void CloseTray(void);

 public:
  cDiscMgr();

  const char *GetDev(void)          { return Device; }
  const char *GetPath(void)         { return Path; }

  void SetDevice(const char *D)     { Device = D; }
  void SetPath(const char *P)       { Path = P; }
  void SetMountCmd(const char *M)   { MountCmd = M; }
  void SetUnMountCmd(const char *U) { UnMountCmd = U; }
  void SetEjectCmd(const char *E)   { EjectCmd = E; }

  bool IsMounted(void);

  bool CheckDisc(void);
  void Eject(void);
};

#endif //_DISCMGR_H