summaryrefslogtreecommitdiff
path: root/src/vdr-plugin/config.h
blob: ccda574d9c4ce4708a86c8ed58af9e3645d017fb (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
68
69
70
71
72
/*
 * config.h: Web video plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#ifndef __WEBVIDEO_CONFIG_H
#define __WEBVIDEO_CONFIG_H

#include <vdr/tools.h>
#include "request.h"

class cDownloadQuality : public cListObject {
private:
  char *site;
  char *min;
  char *max;

public:
  cDownloadQuality(const char *site);
  ~cDownloadQuality();

  void SetMin(const char *val);
  void SetMax(const char *val);

  const char *GetSite();
  const char *GetMin();
  const char *GetMax();
};

class cWebvideoConfig {
private:
  char *downloadPath;
  char *templatePath;
  char *postProcessCmd;
  bool preferXine;
  bool vfatNames;
  cList<cDownloadQuality> downloadLimits;
  cList<cDownloadQuality> streamLimits;

  const char *GetQuality(const char *site, eRequestType type, int limit);

public:
  cWebvideoConfig();
  ~cWebvideoConfig();

  bool ReadConfigFile(const char *inifile);

  void SetDownloadPath(const char *path);
  const char *GetDownloadPath();

  void SetTemplatePath(const char *path);
  const char *GetTemplatePath();

  void SetPreferXineliboutput(bool pref);
  bool GetPreferXineliboutput();

  void SetUseVFATNames(bool vfat);
  bool GetUseVFATNames();

  const char *GetMinQuality(const char *site, eRequestType type);
  const char *GetMaxQuality(const char *site, eRequestType type);

  void SetPostProcessCmd(const char *cmd);
  const char *GetPostProcessCmd();
};

extern cWebvideoConfig *webvideoConfig;

#endif