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

Revision 445, 3.6 kB (checked in by pieterpalmers, 15 years ago)

* name change from FreeBoB to FFADO
* replaced tabs by 4 spaces
* got rid of end-of-line spaces
* made all license and copyrights conform

library becomes LGPL, apps become GPL
explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft)

copyrights are 2005-2007 Daniel & Pieter
except for the MotU stuff (C) Jonathan, Pieter

Line 
1 /*
2  * Copyright (C) 2005-2007 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
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( std::auto_ptr< ConfigRom >( configRom ),
53                     Ieee1394Service& ieee1394service,
54                     int nodeId )
55     :  IAvDevice( configRom, ieee1394service, nodeId )
56     , m_model( NULL )
57
58 {
59     debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n",
60                  nodeId );
61 }
62
63 MHAvDevice::~MHAvDevice()
64 {
65
66 }
67
68 bool
69 MHAvDevice::probe( ConfigRom& configRom )
70 {
71     unsigned int vendorId = configRom.getNodeVendorId();
72     unsigned int modelId = configRom.getModelId();
73
74     for ( unsigned int i = 0;
75           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) );
76           ++i )
77     {
78         if ( ( supportedDeviceList[i].vendor_id == vendorId )
79              && ( supportedDeviceList[i].model_id == modelId )
80            )
81         {
82             return true;
83         }
84     }
85
86     return false;
87 }
88
89 bool
90 MHAvDevice::discover()
91 {
92     unsigned int vendorId = m_pConfigRom->getNodeVendorId();
93     unsigned int modelId = m_pConfigRom->getModelId();
94
95     for ( unsigned int i = 0;
96           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) );
97           ++i )
98     {
99         if ( ( supportedDeviceList[i].vendor_id == vendorId )
100              && ( supportedDeviceList[i].model_id == modelId )
101            )
102         {
103             m_model = &(supportedDeviceList[i]);
104         }
105     }
106
107     if (m_model != NULL) {
108         debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n",
109                 m_model->vendor_name, m_model->model_name);
110         return true;
111     }
112
113     return false;
114 }
115
116 int
117 MHAvDevice::getSamplingFrequency( ) {
118     return 0;
119 }
120
121 bool
122 MHAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency )
123 {
124
125     return false;
126 }
127
128 bool
129 MHAvDevice::lock() {
130
131     return true;
132 }
133
134
135 bool
136 MHAvDevice::unlock() {
137
138     return true;
139 }
140
141 void
142 MHAvDevice::showDevice()
143 {
144     debugOutput(DEBUG_LEVEL_VERBOSE,
145         "%s %s at node %d\n", m_model->vendor_name, m_model->model_name,
146         m_nodeId);
147 }
148
149 bool
150 MHAvDevice::prepare() {
151
152     return true;
153 }
154
155 int
156 MHAvDevice::getStreamCount() {
157     return 0;
158 }
159
160 Streaming::StreamProcessor *
161 MHAvDevice::getStreamProcessorByIndex(int i) {
162
163     return NULL;
164 }
165
166 bool
167 MHAvDevice::startStreamByIndex(int i) {
168     return false;
169 }
170
171 bool
172 MHAvDevice::stopStreamByIndex(int i) {
173     return false;
174 }
175
176 }
Note: See TracBrowser for help on using the browser.