Statistics
| Branch: | Tag: | Revision:

dvbd / src / tunermanager.h @ 2cecea08

History | View | Annotate | Download (2.13 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

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

    
30
class Tuner;
31
class Demuxer;
32
class ConfigFile;
33

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

    
37
class TunerManager : public Selectable {
38
public:
39

    
40
  virtual ~TunerManager();
41

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

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

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

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

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

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

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

    
64
private:
65
  friend class FakeTunerManager;
66

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

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

    
75
#endif // __TUNERMANAGER_H