root/trunk/libffado/src/metrichalo/mh_avdevice.cpp

Revision 864, 4.1 kB (checked in by ppalmers, 16 years ago)

update license to GPLv2 or GPLv3 instead of GPLv2 or any later version. Update copyrights to reflect the new year

Line 
1 /*
2  * Copyright (C) 2005-2008 by Pieter Palmers
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 #warning Metric Halo support is currently useless
25
26 #include "metrichalo/mh_avdevice.h"
27
28 #include "libieee1394/configrom.h"
29 #include "libieee1394/ieee1394service.h"
30
31 #include "libavc/avc_definitions.h"
32
33 #include "debugmodule/debugmodule.h"
34
35 #include <string>
36 #include <stdint.h>
37 #include <assert.h>
38 #include <netinet/in.h>
39 #include <iostream>
40 #include <sstream>
41
42 #include <libraw1394/csr.h>
43
44 namespace MetricHalo {
45
46 // to define the supported devices
47 static VendorModelEntry supportedDeviceList[] =
48 {
49     {0x00000000, 0x0000, "Metric Halo", "XXX"},
50 };
51
52 MHAvDevice::MHAvDevice( Ieee1394Service& ieee1394Service,
53                         std::auto_ptr<ConfigRom>( configRom ))
54     : FFADODevice( ieee1394Service, configRom )
55     , m_model( NULL )
56
57 {
58     debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n",
59                  getConfigRom().getNodeId() );
60 }
61
62 MHAvDevice::~MHAvDevice()
63 {
64
65 }
66
67 bool
68 MHAvDevice::probe( ConfigRom& configRom )
69 {
70     unsigned int vendorId = configRom.getNodeVendorId();
71     unsigned int modelId = configRom.getModelId();
72
73     for ( unsigned int i = 0;
74           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) );
75           ++i )
76     {
77         if ( ( supportedDeviceList[i].vendor_id == vendorId )
78              && ( supportedDeviceList[i].model_id == modelId )
79            )
80         {
81             return true;
82         }
83     }
84
85     return false;
86 }
87
88 FFADODevice *
89 MHAvDevice::createDevice( Ieee1394Service& ieee1394Service,
90                           std::auto_ptr<ConfigRom>( configRom ))
91 {
92     return new MHAvDevice(ieee1394Service, configRom );
93 }
94
95 bool
96 MHAvDevice::discover()
97 {
98     unsigned int vendorId = m_pConfigRom->getNodeVendorId();
99     unsigned int modelId = m_pConfigRom->getModelId();
100
101     for ( unsigned int i = 0;
102           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) );
103           ++i )
104     {
105         if ( ( supportedDeviceList[i].vendor_id == vendorId )
106              && ( supportedDeviceList[i].model_id == modelId )
107            )
108         {
109             m_model = &(supportedDeviceList[i]);
110         }
111     }
112
113     if (m_model != NULL) {
114         debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n",
115                 m_model->vendor_name, m_model->model_name);
116         return true;
117     }
118
119     return false;
120 }
121
122 int
123 MHAvDevice::getSamplingFrequency( ) {
124     return 0;
125 }
126
127 FFADODevice::ClockSourceVector
128 MHAvDevice::getSupportedClockSources() {
129     FFADODevice::ClockSourceVector r;
130     return r;
131 }
132
133 bool
134 MHAvDevice::setActiveClockSource(ClockSource s) {
135     return false;
136 }
137
138 FFADODevice::ClockSource
139 MHAvDevice::getActiveClockSource() {
140     ClockSource s;
141     return s;
142 }
143
144
145 int
146 MHAvDevice::getConfigurationId( ) {
147     return 0;
148 }
149
150 bool
151 MHAvDevice::setSamplingFrequency( int samplingFrequency )
152 {
153
154     return false;
155 }
156
157 bool
158 MHAvDevice::lock() {
159
160     return true;
161 }
162
163
164 bool
165 MHAvDevice::unlock() {
166
167     return true;
168 }
169
170 void
171 MHAvDevice::showDevice()
172 {
173     debugOutput(DEBUG_LEVEL_VERBOSE,
174         "%s %s at node %d\n", m_model->vendor_name, m_model->model_name,
175         getNodeId());
176 }
177
178 bool
179 MHAvDevice::prepare() {
180
181     return true;
182 }
183
184 int
185 MHAvDevice::getStreamCount() {
186     return 0;
187 }
188
189 Streaming::StreamProcessor *
190 MHAvDevice::getStreamProcessorByIndex(int i) {
191
192     return NULL;
193 }
194
195 bool
196 MHAvDevice::startStreamByIndex(int i) {
197     return false;
198 }
199
200 bool
201 MHAvDevice::stopStreamByIndex(int i) {
202     return false;
203 }
204
205 }
Note: See TracBrowser for help on using the browser.