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

Revision 734, 3.6 kB (checked in by ppalmers, 16 years ago)

merge ppalmers-streaming branch

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/amdtp/AmdtpReceiveStreamProcessor.h"
37 #include "libstreaming/amdtp/AmdtpTransmitStreamProcessor.h"
38 #include "libstreaming/amdtp/AmdtpPort.h"
39 #include "libstreaming/amdtp/AmdtpPortInfo.h"
40
41 #include "debugmodule/debugmodule.h"
42
43 class ConfigRom;
44 class Ieee1394Service;
45
46 namespace GenericAVC {
47
48 class AvDevice : public FFADODevice, public AVC::Unit {
49 public:
50     AvDevice( Ieee1394Service& ieee1394Service,
51               std::auto_ptr<ConfigRom>( configRom ));
52     virtual ~AvDevice();
53
54     static bool probe( ConfigRom& configRom );
55     virtual bool discover();
56     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service,
57                                        std::auto_ptr<ConfigRom>( configRom ));
58
59     virtual bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const;
60     virtual bool deserialize( Glib::ustring basePath, Util::IODeserialize& deser );
61
62     virtual void setVerboseLevel(int l);
63     virtual void showDevice();
64
65     virtual bool setSamplingFrequency( int );
66     virtual int getSamplingFrequency( );
67
68     virtual ClockSourceVector getSupportedClockSources();
69     virtual bool setActiveClockSource(ClockSource);
70     virtual ClockSource getActiveClockSource();
71
72     virtual int getStreamCount();
73     virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i);
74
75     virtual bool prepare();
76     virtual bool lock();
77     virtual bool unlock();
78
79     virtual bool startStreamByIndex(int i);
80     virtual bool stopStreamByIndex(int i);
81
82     // redefinition to resolve ambiguity
83     virtual Ieee1394Service& get1394Service()
84         { return FFADODevice::get1394Service(); };
85     virtual ConfigRom& getConfigRom() const
86         { return FFADODevice::getConfigRom(); };
87
88 protected:
89     virtual bool addPlugToProcessor( AVC::Plug& plug, Streaming::StreamProcessor *processor,
90                              Streaming::AmdtpAudioPort::E_Direction direction);
91 /*    bool setSamplingFrequencyPlug( AVC::Plug& plug,
92                                    AVC::Plug::EPlugDirection direction,
93                                    AVC::ESamplingFrequency samplingFrequency );*/
94
95     struct VendorModelEntry m_model;
96
97     // streaming stuff
98     typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector;
99     StreamProcessorVector m_receiveProcessors;
100     StreamProcessorVector m_transmitProcessors;
101
102     DECLARE_DEBUG_MODULE;
103
104 private:
105     ClockSource syncInfoToClockSource(const SyncInfo& si);
106 };
107
108 }
109
110 #endif //GENERICAVC_AVDEVICE_H
Note: See TracBrowser for help on using the browser.