1 |
/* |
---|
2 |
* Copyright (C) 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 |
#include "fireworks_device.h" |
---|
25 |
|
---|
26 |
#include "audiofire/audiofire_device.h" |
---|
27 |
|
---|
28 |
#include "libieee1394/configrom.h" |
---|
29 |
#include "libieee1394/ieee1394service.h" |
---|
30 |
|
---|
31 |
// FireWorks is the platform used and developed by ECHO AUDIO |
---|
32 |
namespace FireWorks { |
---|
33 |
|
---|
34 |
// to define the supported devices |
---|
35 |
static GenericAVC::VendorModelEntry supportedDeviceList[] = |
---|
36 |
{ |
---|
37 |
{FW_VENDORID_ECHO, 0x00000af2, "Echo", "AudioFire2"}, |
---|
38 |
}; |
---|
39 |
|
---|
40 |
Device::Device( Ieee1394Service& ieee1394Service, |
---|
41 |
std::auto_ptr<ConfigRom>( configRom )) |
---|
42 |
: GenericAVC::AvDevice( ieee1394Service, configRom) |
---|
43 |
{ |
---|
44 |
debugOutput( DEBUG_LEVEL_VERBOSE, "Created FireWorks::Device (NodeID %d)\n", |
---|
45 |
getConfigRom().getNodeId() ); |
---|
46 |
} |
---|
47 |
|
---|
48 |
Device::~Device() |
---|
49 |
{ |
---|
50 |
} |
---|
51 |
|
---|
52 |
void |
---|
53 |
Device::showDevice() |
---|
54 |
{ |
---|
55 |
debugOutput(DEBUG_LEVEL_VERBOSE, "This is a FireWorks::Device\n"); |
---|
56 |
GenericAVC::AvDevice::showDevice(); |
---|
57 |
} |
---|
58 |
|
---|
59 |
|
---|
60 |
bool |
---|
61 |
Device::probe( ConfigRom& configRom ) |
---|
62 |
{ |
---|
63 |
unsigned int vendorId = configRom.getNodeVendorId(); |
---|
64 |
unsigned int modelId = configRom.getModelId(); |
---|
65 |
|
---|
66 |
for ( unsigned int i = 0; |
---|
67 |
i < ( sizeof( supportedDeviceList )/sizeof( GenericAVC::VendorModelEntry ) ); |
---|
68 |
++i ) |
---|
69 |
{ |
---|
70 |
if ( ( supportedDeviceList[i].vendor_id == vendorId ) |
---|
71 |
&& ( supportedDeviceList[i].model_id == modelId ) |
---|
72 |
) |
---|
73 |
{ |
---|
74 |
return true; |
---|
75 |
} |
---|
76 |
} |
---|
77 |
|
---|
78 |
return false; |
---|
79 |
} |
---|
80 |
|
---|
81 |
FFADODevice * |
---|
82 |
Device::createDevice( Ieee1394Service& ieee1394Service, |
---|
83 |
std::auto_ptr<ConfigRom>( configRom )) |
---|
84 |
{ |
---|
85 |
unsigned int vendorId = configRom->getNodeVendorId(); |
---|
86 |
unsigned int modelId = configRom->getModelId(); |
---|
87 |
|
---|
88 |
switch(vendorId) { |
---|
89 |
case FW_VENDORID_ECHO: return new ECHO::AudioFire(ieee1394Service, configRom ); |
---|
90 |
default: return new Device(ieee1394Service, configRom ); |
---|
91 |
} |
---|
92 |
} |
---|
93 |
|
---|
94 |
|
---|
95 |
} // FireWorks |
---|