root/trunk/libffado/src/digidesign/digidesign_avdevice.h

Revision 2803, 3.8 kB (checked in by jwoithe, 2 years ago)

Cosmetic: capitalise "L" in "Linux".

"Linux" is a proper noun so it should start with a capital letter. These
changes are almost all within comments.

This patch was originally proposed by pander on the ffado-devel mailing
list. It has been expanded to cover all similar cases to maintain
consistency throughout the source tree.

Line 
1 /*
2  * Copyright (C) 2005-2011 by Jonathan Woithe
3  * Copyright (C) 2005-2008 by Pieter Palmers
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 program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 2 of the License, or
13  * (at your option) version 3 of the License.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24
25 #ifndef DIGIDESIGNDEVICE_H
26 #define DIGIDESIGNDEVICE_H
27
28 #include "ffadodevice.h"
29
30 #include "debugmodule/debugmodule.h"
31 #include "libavc/avc_definitions.h"
32
33 #include "libutil/Configuration.h"
34
35 #include "libstreaming/digidesign/DigidesignReceiveStreamProcessor.h"
36 #include "libstreaming/digidesign/DigidesignTransmitStreamProcessor.h"
37
38 class ConfigRom;
39 class Ieee1394Service;
40
41 namespace Digidesign {
42
43 // The actual values within this enum are arbitary
44 enum EDigidesignModel {
45     DIGIDESIGN_MODEL_NONE          = 0x0000,
46     DIGIDESIGN_MODEL_003_RACK,
47 };
48
49 class Device : public FFADODevice {
50 public:
51
52     Device( DeviceManager& d,
53                ffado_smartptr<ConfigRom>( configRom ));
54     virtual ~Device();
55
56     virtual bool buildMixer();
57     virtual bool destroyMixer();
58
59     static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false );
60     static FFADODevice * createDevice( DeviceManager& d,
61                                         ffado_smartptr<ConfigRom>( configRom ));
62     static int getConfigurationId( );
63     virtual bool discover();
64
65     virtual void showDevice();
66
67     virtual bool setSamplingFrequency( int samplingFrequency );
68     virtual int getSamplingFrequency( );
69     virtual std::vector<int> getSupportedSamplingFrequencies();
70
71     virtual ClockSourceVector getSupportedClockSources();
72     virtual bool setActiveClockSource(ClockSource);
73     virtual ClockSource getActiveClockSource();
74
75     virtual int getStreamCount();
76     virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i);
77
78     virtual bool prepare();
79     virtual bool lock();
80     virtual bool unlock();
81
82     virtual bool startStreamByIndex(int i);
83     virtual bool stopStreamByIndex(int i);
84
85     signed int getNumChannels(void) { return num_channels; };
86     signed int getFramesPerPacket(void);
87
88     bool addPort(Streaming::StreamProcessor *s_processor,
89              char *name, enum Streaming::Port::E_Direction direction,
90              int position, int size);
91     bool addDirPorts(enum Streaming::Port::E_Direction direction);
92
93     unsigned int readRegister(fb_nodeaddr_t reg);
94     signed int readBlock(fb_nodeaddr_t reg, quadlet_t *buf, unsigned int n_quads);
95     signed int writeRegister(fb_nodeaddr_t reg, quadlet_t data);
96     signed int writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads);
97
98     /* General information functions */
99     signed int getDigidesignModel(void) { return m_digidesign_model; }
100
101 protected:
102     enum EDigidesignModel m_digidesign_model;
103
104     // The following two members may not be required for Digidesign hardware.
105     // It depends on whether the information is required in multiple places.
106     // If it turns out that this isn't needed they can be removed.
107     signed int num_channels;
108     signed int frames_per_packet; // 1 frame includes 1 sample from each channel
109
110     signed int iso_tx_channel, iso_rx_channel;
111
112     Streaming::DigidesignReceiveStreamProcessor *m_receiveProcessor;
113     Streaming::DigidesignTransmitStreamProcessor *m_transmitProcessor;
114
115 };
116
117 }
118
119 #endif
Note: See TracBrowser for help on using the browser.