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

Revision 639, 3.5 kB (checked in by ppalmers, 17 years ago)

- Introduce a generic infrastructure for FFADODevices to present the clock sources they support and their state
- Implement this infrastructure for BeBoB devices
- Implement this infrastructure for ECHO Fireworks devices

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 ClockSourceVector getSupportedClockSources();
68     virtual bool setActiveClockSource(ClockSource);
69     virtual ClockSource getActiveClockSource();
70
71     virtual int getStreamCount();
72     virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i);
73
74     virtual bool prepare();
75     virtual bool lock();
76     virtual bool unlock();
77
78     virtual bool startStreamByIndex(int i);
79     virtual bool stopStreamByIndex(int i);
80
81     // redefinition to resolve ambiguity
82     virtual Ieee1394Service& get1394Service()
83         { return FFADODevice::get1394Service(); };
84     virtual ConfigRom& getConfigRom() const
85         { return FFADODevice::getConfigRom(); };
86
87 protected:
88     virtual bool addPlugToProcessor( AVC::Plug& plug, Streaming::StreamProcessor *processor,
89                              Streaming::AmdtpAudioPort::E_Direction direction);
90 /*    bool setSamplingFrequencyPlug( AVC::Plug& plug,
91                                    AVC::Plug::EPlugDirection direction,
92                                    AVC::ESamplingFrequency samplingFrequency );*/
93
94     struct VendorModelEntry m_model;
95
96     // streaming stuff
97     typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector;
98     StreamProcessorVector m_receiveProcessors;
99     StreamProcessorVector m_transmitProcessors;
100
101     DECLARE_DEBUG_MODULE;
102
103 private:
104     ClockSource syncInfoToClockSource(const SyncInfo& si);
105 };
106
107 }
108
109 #endif //GENERICAVC_AVDEVICE_H
Note: See TracBrowser for help on using the browser.