Statistics
| Branch: | Tag: | Revision:

dvbd / src / tunermanager.h @ 0939257b

History | View | Annotate | Download (2.08 KB)

1
// -*- c++ -*-
2
/*
3
  Copyright 2003 John Knottenbelt
4
  
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
7
  the Free Software Foundation; either version 2 of the License, or
8
  (at your option) any later version.
9
 
10
  This program is distributed in the hope that it will be useful,
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
  GNU General Public License for more details.
14
 
15
  You should have received a copy of the GNU General Public License
16
  along with this program; if not, write to the Free Software
17
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
18
*/
19

    
20
#if !defined __TUNERMANAGER_H
21
#define __TUNERMANAGER_H
22

    
23
#include "dvbd.h"
24
#include "select.h"
25
#include "source.h"
26

    
27
#include <list>
28
#include <map>
29
#include <string>
30

    
31
class Tuner;
32
class ConfigFile;
33

    
34
typedef std::list<Tuner *> TunerList;
35

    
36
class TunerManager : public Selectable {
37
public:
38

    
39
  virtual ~TunerManager();
40

    
41
  bool parseConfig(ConfigFile &c);
42
  void parseCommandLine(int argc, char *argv[]);
43

    
44
  virtual void addSelectFDs(Select &) const;
45
  virtual bool isReady(const Select &) const;
46
  void processReady(const Select &s);
47

    
48
  bool add( const std::string &type, 
49
            const std::string &device, 
50
            const std::string &channels );
51

    
52
  void getDemuxers(const std::string &type, const std::string &channel,
53
                   bool convertToPS, SourceList &demuxers, int priority);
54

    
55
  bool canGetDemuxers(const std::string &type, const std::string &channel,
56
                      int priority) const;
57

    
58
  bool validType(const std::string &type) const;
59
  bool validChannel(const std::string &type, const std::string &channel) const;
60

    
61
  void getTunableChannels(const std::string &type, int priority, StringList &channels) const;
62

    
63
private:
64
  friend class FakeTunerManager;
65

    
66
  typedef std::map<Tuner *, ChannelMap *> TunerChannelMap;
67
  typedef std::map<std::string, TunerList *> TypeTunerMap;
68

    
69
  TunerList tuners;
70
  TunerChannelMap tunerChannelMap;
71
  TypeTunerMap typeTunerMap;
72
};
73

    
74
#endif // __TUNERMANAGER_H