root/trunk/libffado/src/devicemanager.h

Revision 742, 3.0 kB (checked in by ppalmers, 16 years ago)

- Remove some obsolete support files and dirs

- Clean up the license statements in the source files. Everything is

GPL version 3 now.

- Add license and copyright notices to scons scripts

- Clean up some other text files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  * Copyright (C) 2005-2007 by Pieter Palmers
4  *
5  * This file is part of FFADO
6  * FFADO = Free Firewire (pro-)audio drivers for linux
7  *
8  * FFADO is based upon FreeBoB.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24
25 #ifndef FFADODEVICEMANAGER_H
26 #define FFADODEVICEMANAGER_H
27
28 #include "debugmodule/debugmodule.h"
29
30 #include "libieee1394/configrom.h"
31 #include "libieee1394/ieee1394service.h"
32
33 #include "libutil/OptionContainer.h"
34 #include "libcontrol/BasicElements.h"
35
36 #include <glibmm/ustring.h>
37
38 #include <vector>
39 #include <string>
40
41 class Ieee1394Service;
42 class FFADODevice;
43 namespace Streaming {
44     class StreamProcessor;
45 }
46
47 typedef std::vector< FFADODevice* > FFADODeviceVector;
48 typedef std::vector< FFADODevice* >::iterator FFADODeviceVectorIterator;
49
50 typedef std::vector< Ieee1394Service* > Ieee1394ServiceVector;
51 typedef std::vector< Ieee1394Service* >::iterator Ieee1394ServiceVectorIterator;
52
53 typedef std::vector< Functor* > FunctorVector;
54 typedef std::vector< Functor* >::iterator FunctorVectorIterator;
55
56 class DeviceManager
57     : public Util::OptionContainer,
58       public Control::Container
59 {
60 public:
61     DeviceManager();
62     ~DeviceManager();
63
64     bool initialize();
65     bool deinitialize();
66
67     bool addSpecString(char *);
68     bool isSpecStringValid(std::string s);
69
70     bool discover();
71
72     bool isValidNode( int node );
73     int getNbDevices();
74     int getDeviceNodeId( int deviceNr );
75
76     FFADODevice* getAvDevice( int nodeId );
77     FFADODevice* getAvDeviceByIndex( int idx );
78     unsigned int getAvDeviceCount();
79
80     Streaming::StreamProcessor *getSyncSource();
81
82     void show();
83
84     // the Control::Container functions
85     virtual std::string getName()
86         {return "DeviceManager";};
87     virtual bool setName( std::string n )
88         { return false;};
89
90 protected:
91     FFADODevice* getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ),
92                                      int id );
93     FFADODevice* getSlaveDriver( std::auto_ptr<ConfigRom>( configRom ) );
94
95     void busresetHandler();
96
97 protected:
98     // we have one service for each port
99     // found on the system. We don't allow dynamic addition of ports (yet)
100     Ieee1394ServiceVector   m_1394Services;
101     FFADODeviceVector       m_avDevices;
102     FunctorVector           m_busreset_functors;
103
104     std::vector<std::string>          m_SpecStrings;
105
106 // debug stuff
107 public:
108     void setVerboseLevel(int l);
109 private:
110     DECLARE_DEBUG_MODULE;
111 };
112
113 #endif
Note: See TracBrowser for help on using the browser.