root/trunk/libffado/src/bebob/bebob_avdevice.h

Revision 554, 3.2 kB (checked in by ppalmers, 17 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.

Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #ifndef BEBOB_AVDEVICE_H
25 #define BEBOB_AVDEVICE_H
26
27 #include <stdint.h>
28
29 #include "debugmodule/debugmodule.h"
30 #include "libavc/avc_definitions.h"
31 #include "libavc/general/avc_extended_cmd_generic.h"
32 #include "libavc/general/avc_unit.h"
33 #include "libavc/general/avc_subunit.h"
34 #include "libavc/general/avc_plug.h"
35
36 #include "bebob/bebob_avplug.h"
37 #include "bebob/bebob_avdevice_subunit.h"
38 #include "bebob/GenericMixer.h"
39
40 #include "libstreaming/AmdtpStreamProcessor.h"
41 #include "libstreaming/AmdtpPort.h"
42 #include "libstreaming/AmdtpPortInfo.h"
43
44 #include "libutil/serialize.h"
45
46 #include "genericavc/avc_avdevice.h"
47
48 #include "ffadodevice.h"
49
50 #include <sstream>
51 #include <vector>
52
53 class ConfigRom;
54 class Ieee1394Service;
55
56 namespace BeBoB {
57
58 class AvDevice : public GenericAVC::AvDevice {
59 public:
60     AvDevice( std::auto_ptr<ConfigRom>( configRom ),
61               Ieee1394Service& ieee1394Service,
62               int nodeId );
63     virtual ~AvDevice();
64
65     static bool probe( ConfigRom& configRom );
66     virtual bool loadFromCache();
67     virtual bool saveCache();
68     virtual bool discover();
69
70     virtual AVC::Subunit* createSubunit(AVC::Unit& unit,
71                                         AVC::ESubunitType type,
72                                         AVC::subunit_t id );
73     virtual AVC::Plug *createPlug( AVC::Unit* unit,
74                                    AVC::Subunit* subunit,
75                                    AVC::function_block_type_t functionBlockType,
76                                    AVC::function_block_type_t functionBlockId,
77                                    AVC::Plug::EPlugAddressType plugAddressType,
78                                    AVC::Plug::EPlugDirection plugDirection,
79                                    AVC::plug_id_t plugId );
80
81 protected:
82     virtual bool propagatePlugInfo();
83
84 public:
85     bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const;
86     static AvDevice* deserialize( Glib::ustring basePath,
87                                   Util::IODeserialize& deser,
88                                   Ieee1394Service& ieee1394Service );
89     int getConfigurationIdSampleRate();
90     int getConfigurationIdNumberOfChannel( AVC::PlugAddress::EPlugDirection ePlugDirection );
91     int getConfigurationIdSyncMode();
92     int getConfigurationId();
93
94     Glib::ustring getCachePath();
95
96 protected:
97     GenericMixer*             m_Mixer;
98
99 };
100
101 }
102
103 #endif
Note: See TracBrowser for help on using the browser.