root/trunk/libffado/src/devicemanager.h

Revision 554, 2.3 kB (checked in by ppalmers, 16 years ago)

Merge echoaudio branch into trunk.

This adds support for the Echo Audiofire devices to FFADO. Possibly also other devices working with the Apple Class Driver will work with this code. It is not fully complete yet, but the main rework is
done.

First of all the IAvDevice class/interface is renamed to FFADODevice, in order to separate the AV/C code from the FFADO API code. A device supported by FFADO implements a FFADODevice.

The BeBoB device has been split up into three groups:
- libavc/* : all code and commands that are specified by AV/C specs. Note that a lot of the code that used to be in BeBoB::AvDevice? now resides in AVC::Unit
- genericavc/* : a FFADODevice that uses AV/C descriptors & commands for discovery and config
- bebob/* : the bebob FFADODevice that inherits from GenericAVC::AvDevice? but that uses BridgeCo? commands for discovery

Everything has been moved as high as possible in the class hierarchy. If necessary, a subclass that uses device specific commands is introduced (e.g. BeBoB::Plug inherits from AVC::Plug and uses the
BridgeCo? extended plug info command to discover it's properties).

There are some other fixes along the way that have been done too.

  • 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 "libosc/OscServer.h"
35 #include "libosc/OscNode.h"
36
37 #include <glibmm/ustring.h>
38
39 #include <vector>
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 class DeviceManager
51     : public Util::OptionContainer,
52       public OSC::OscNode
53 {
54 public:
55     DeviceManager();
56     ~DeviceManager();
57
58     bool initialize( int port );
59     bool deinitialize();
60
61     bool discover( );
62
63     bool isValidNode( int node );
64     int getNbDevices();
65     int getDeviceNodeId( int deviceNr );
66
67     FFADODevice* getAvDevice( int nodeId );
68     FFADODevice* getAvDeviceByIndex( int idx );
69     unsigned int getAvDeviceCount();
70
71     Streaming::StreamProcessor *getSyncSource();
72
73 protected:
74     FFADODevice* getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ),
75                                    int id );
76     FFADODevice* getSlaveDriver( std::auto_ptr<ConfigRom>( configRom ) );
77
78 protected:
79     Ieee1394Service* m_1394Service;
80     FFADODeviceVector  m_avDevices;
81
82     OSC::OscServer*  m_oscServer;
83
84 // debug stuff
85 public:
86     void setVerboseLevel(int l);
87 private:
88     DECLARE_DEBUG_MODULE;
89 };
90
91 #endif
Note: See TracBrowser for help on using the browser.