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

Revision 583, 3.3 kB (checked in by ppalmers, 17 years ago)

- Clean up the FFADODevice constructor to remove the nodeid that

can be retrieved from the configrom.

- Implement new method of creating devices: a device is supposed

to implement the createDevice static method that should return
an instance of itself or a subclass of itself. This should ease
support for manufacturer specific customizations since we don't
have to put them into the device manager class.

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/bebob_mixer.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( Ieee1394Service& ieee1394Service,
61               std::auto_ptr<ConfigRom>( configRom ));
62     virtual ~AvDevice();
63
64     static bool probe( ConfigRom& configRom );
65     virtual bool loadFromCache();
66     virtual bool saveCache();
67     virtual bool discover();
68
69     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service,
70                                         std::auto_ptr<ConfigRom>( configRom ));
71
72     virtual AVC::Subunit* createSubunit(AVC::Unit& unit,
73                                         AVC::ESubunitType type,
74                                         AVC::subunit_t id );
75     virtual AVC::Plug *createPlug( AVC::Unit* unit,
76                                    AVC::Subunit* subunit,
77                                    AVC::function_block_type_t functionBlockType,
78                                    AVC::function_block_type_t functionBlockId,
79                                    AVC::Plug::EPlugAddressType plugAddressType,
80                                    AVC::Plug::EPlugDirection plugDirection,
81                                    AVC::plug_id_t plugId );
82
83     virtual void showDevice();
84 protected:
85     virtual bool propagatePlugInfo();
86
87 public:
88     bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const;
89     static AvDevice* deserialize( Glib::ustring basePath,
90                                   Util::IODeserialize& deser,
91                                   Ieee1394Service& ieee1394Service );
92     int getConfigurationIdSampleRate();
93     int getConfigurationIdNumberOfChannel( AVC::PlugAddress::EPlugDirection ePlugDirection );
94     int getConfigurationIdSyncMode();
95     int getConfigurationId();
96
97     Glib::ustring getCachePath();
98
99 protected:
100     Mixer*             m_Mixer;
101
102 };
103
104 }
105
106 #endif
Note: See TracBrowser for help on using the browser.