root/trunk/libffado/src/genericavc/avc_avdevice.h

Revision 630, 3.3 kB (checked in by wagi, 17 years ago)

Some more fixing of the cashing code. The loading is still disabled because it seems not to work right. But at least it doesn't crash anymore. Some further debugging is
needed.

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  * Copyright (C) 2005-2007 by Daniel Wagner
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 GENERICAVC_AVDEVICE_H
26 #define GENERICAVC_AVDEVICE_H
27
28 #include "ffadodevice.h"
29 #include "genericavc/avc_vendormodel.h"
30
31 #include "libavc/avc_definitions.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 "libstreaming/AmdtpStreamProcessor.h"
37 #include "libstreaming/AmdtpPort.h"
38 #include "libstreaming/AmdtpPortInfo.h"
39
40 #include "debugmodule/debugmodule.h"
41
42 class ConfigRom;
43 class Ieee1394Service;
44
45 namespace GenericAVC {
46
47 class AvDevice : public FFADODevice, public AVC::Unit {
48 public:
49     AvDevice( Ieee1394Service& ieee1394Service,
50               std::auto_ptr<ConfigRom>( configRom ));
51     virtual ~AvDevice();
52
53     static bool probe( ConfigRom& configRom );
54     virtual bool discover();
55     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service,
56                                        std::auto_ptr<ConfigRom>( configRom ));
57
58     virtual bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const;
59     virtual bool deserialize( Glib::ustring basePath, Util::IODeserialize& deser );
60
61     virtual void setVerboseLevel(int l);
62     virtual void showDevice();
63
64     virtual bool setSamplingFrequency( int );
65     virtual int getSamplingFrequency( );
66
67     virtual int getStreamCount();
68     virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i);
69
70     virtual bool prepare();
71     virtual bool lock();
72     virtual bool unlock();
73
74     virtual bool startStreamByIndex(int i);
75     virtual bool stopStreamByIndex(int i);
76
77     // redefinition to resolve ambiguity
78     virtual Ieee1394Service& get1394Service()
79         { return FFADODevice::get1394Service(); };
80     virtual ConfigRom& getConfigRom() const
81         { return FFADODevice::getConfigRom(); };
82
83 protected:
84     virtual bool addPlugToProcessor( AVC::Plug& plug, Streaming::StreamProcessor *processor,
85                              Streaming::AmdtpAudioPort::E_Direction direction);
86 /*    bool setSamplingFrequencyPlug( AVC::Plug& plug,
87                                    AVC::Plug::EPlugDirection direction,
88                                    AVC::ESamplingFrequency samplingFrequency );*/
89
90     struct VendorModelEntry m_model;
91
92     // streaming stuff
93     typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector;
94     StreamProcessorVector m_receiveProcessors;
95     StreamProcessorVector m_transmitProcessors;
96
97     DECLARE_DEBUG_MODULE;
98 };
99
100 }
101
102 #endif //GENERICAVC_AVDEVICE_H
Note: See TracBrowser for help on using the browser.