root/branches/libffado-2.0/src/bebob/bebob_avdevice.h

Revision 1241, 3.7 kB (checked in by ppalmers, 13 years ago)

update BeBoB constructors (thx slack) (closes #129, #127)

Line 
1 /*
2  * Copyright (C) 2005-2008 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 program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program 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
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef BEBOB_AVDEVICE_H
25 #define BEBOB_AVDEVICE_H
26
27 #include <stdint.h>
28
29 #include "debugmodule/debugmodule.h"
30
31 #include "libieee1394/configrom.h"
32 #include "libieee1394/ieee1394service.h"
33
34 #include "libavc/avc_definitions.h"
35 #include "libavc/general/avc_extended_cmd_generic.h"
36 #include "libavc/general/avc_unit.h"
37 #include "libavc/general/avc_subunit.h"
38 #include "libavc/general/avc_plug.h"
39
40 #include "bebob/bebob_avplug.h"
41 #include "bebob/bebob_avdevice_subunit.h"
42 #include "bebob/bebob_mixer.h"
43
44 #include "libstreaming/amdtp/AmdtpReceiveStreamProcessor.h"
45 #include "libstreaming/amdtp/AmdtpTransmitStreamProcessor.h"
46 #include "libstreaming/amdtp/AmdtpPort.h"
47 #include "libstreaming/amdtp/AmdtpPortInfo.h"
48
49 #include "libutil/serialize.h"
50
51 #include "genericavc/avc_avdevice.h"
52
53 #include "ffadodevice.h"
54
55 #include <sstream>
56 #include <vector>
57
58 namespace BeBoB {
59
60 class AvDevice : public GenericAVC::AvDevice {
61 public:
62     AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));
63     virtual ~AvDevice();
64
65     static bool probe( ConfigRom& configRom, bool generic = false );
66     virtual bool loadFromCache();
67     virtual bool saveCache();
68     virtual bool discover();
69
70     static FFADODevice * createDevice( DeviceManager& d, 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                                    int globalId = -1 );
83
84     virtual int getSelectorFBValue(int id);
85     virtual bool setSelectorFBValue(int id, int v);
86     virtual int getFeatureFBVolumeValue(int id, int channel);
87     virtual bool setFeatureFBVolumeValue(int id, int channel, int v);
88
89     virtual void showDevice();
90     virtual void setVerboseLevel(int l);
91 protected:
92     virtual bool propagatePlugInfo();
93
94     virtual bool buildMixer();
95     virtual bool destroyMixer();
96
97 public:
98     virtual bool serialize( std::string basePath, Util::IOSerialize& ser ) const;
99     virtual bool deserialize( std::string basePath, Util::IODeserialize& deser );
100
101     virtual uint64_t getConfigurationId();
102
103     std::string getCachePath();
104
105 protected:
106     virtual uint8_t getConfigurationIdSampleRate();
107     virtual uint8_t getConfigurationIdNumberOfChannel( AVC::PlugAddress::EPlugDirection ePlugDirection );
108     virtual uint8_t getConfigurationIdSyncMode();
109
110 protected:
111     Mixer*             m_Mixer;
112
113 };
114
115 }
116
117 #endif
Note: See TracBrowser for help on using the browser.