Clean up compiler warnings when compiling on 64-bit systems. These are mostly fixing...
[ffado.git] / libffado / src / metrichalo / mh_avdevice.cpp
blobe8efa787a67028199483c2848d2188af4af68d24
1 /*
2 * Copyright (C) 2005-2008 by Pieter Palmers
4 * This file is part of FFADO
5 * FFADO = Free Firewire (pro-)audio drivers for linux
7 * FFADO is based upon FreeBoB.
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.
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.
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/>.
24 #warning Metric Halo support is currently useless
26 #include "metrichalo/mh_avdevice.h"
28 #include "libieee1394/configrom.h"
29 #include "libieee1394/ieee1394service.h"
31 #include "libavc/avc_definitions.h"
33 #include "debugmodule/debugmodule.h"
35 #include "devicemanager.h"
37 #include <string>
38 #include <stdint.h>
39 #include <assert.h>
40 #include "libutil/ByteSwap.h"
41 #include <iostream>
42 #include <sstream>
44 #include <libraw1394/csr.h>
46 namespace MetricHalo {
48 Device::Device( DeviceManager& d,
49 std::auto_ptr<ConfigRom>( configRom ))
50 : FFADODevice( d, configRom )
52 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::Device (NodeID %d)\n",
53 getConfigRom().getNodeId() );
56 Device::~Device()
61 bool
62 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic )
64 if (generic) {
65 return false;
66 } else {
67 // check if device is in supported devices list
68 unsigned int vendorId = configRom.getNodeVendorId();
69 unsigned int modelId = configRom.getModelId();
71 Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId );
72 return c.isValid(vme) && vme.driver == Util::Configuration::eD_MetricHalo;
76 FFADODevice *
77 Device::createDevice( DeviceManager& d,
78 std::auto_ptr<ConfigRom>( configRom ))
80 return new Device(d, configRom );
83 bool
84 Device::discover()
86 unsigned int vendorId = getConfigRom().getNodeVendorId();
87 unsigned int modelId = getConfigRom().getModelId();
89 Util::Configuration &c = getDeviceManager().getConfiguration();
90 Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId );
92 if (c.isValid(vme) && vme.driver == Util::Configuration::eD_MetricHalo) {
93 debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n",
94 vme.vendor_name.c_str(),
95 vme.model_name.c_str());
96 } else {
97 debugWarning("Using generic Metric Halo support for unsupported device '%s %s'\n",
98 getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str());
101 return false;
105 Device::getSamplingFrequency( ) {
106 return 0;
109 std::vector<int>
110 Device::getSupportedSamplingFrequencies()
112 std::vector<int> frequencies;
113 return frequencies;
116 FFADODevice::ClockSourceVector
117 Device::getSupportedClockSources() {
118 FFADODevice::ClockSourceVector r;
119 return r;
122 bool
123 Device::setActiveClockSource(ClockSource s) {
124 return false;
127 FFADODevice::ClockSource
128 Device::getActiveClockSource() {
129 ClockSource s;
130 return s;
135 Device::getConfigurationId( ) {
136 return 0;
139 bool
140 Device::setSamplingFrequency( int samplingFrequency )
143 return false;
146 bool
147 Device::lock() {
149 return true;
153 bool
154 Device::unlock() {
156 return true;
159 void
160 Device::showDevice()
162 unsigned int vendorId = getConfigRom().getNodeVendorId();
163 unsigned int modelId = getConfigRom().getModelId();
165 Util::Configuration &c = getDeviceManager().getConfiguration();
166 Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId );
168 debugOutput(DEBUG_LEVEL_VERBOSE,
169 "%s %s at node %d\n", vme.vendor_name.c_str(), vme.model_name.c_str(), getNodeId());
172 bool
173 Device::prepare() {
175 return true;
179 Device::getStreamCount() {
180 return 0;
183 Streaming::StreamProcessor *
184 Device::getStreamProcessorByIndex(int i) {
186 return NULL;
189 bool
190 Device::startStreamByIndex(int i) {
191 return false;
194 bool
195 Device::stopStreamByIndex(int i) {
196 return false;