root/trunk/libffado/src/devicemanager.h

Revision 739, 3.0 kB (checked in by ppalmers, 13 years ago)

- Adapt the ffado external API (upgrade to v3)

NEEDS NEW JACK BACKEND

- simplify FFADODevice constructor even more
- implement first framework support for supporting multiple adapters.

currently all firewire adapters are scanned for supported devices unless specified otherwise
however attaching devices to separate adapters is not supported. using multiple adapters at
that are connected together might work.

  • 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 library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License version 2.1, as published by the Free Software Foundation;
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  * MA 02110-1301 USA
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.