Changeset 404 for branches/streaming-rework/src/motu/motu_avdevice.cpp
- Timestamp:
- 02/18/07 07:09:00 (17 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/streaming-rework/src/motu/motu_avdevice.cpp
r402 r404 1 1 /* motu_avdevice.cpp 2 * Copyright (C) 2006 by Pieter Palmers2 * Copyright (C) 2006,2007 by Pieter Palmers 3 3 * Copyright (C) 2006 by Jonathan Woithe 4 4 * … … 46 46 IMPL_DEBUG_MODULE( MotuDevice, MotuDevice, DEBUG_LEVEL_NORMAL ); 47 47 48 char *motufw_modelname[] = {"[unknown]","828MkII", "Traveler"}; 48 // to define the supported devices 49 static VendorModelEntry supportedDeviceList[] = 50 { 51 // {vendor_id, model_id, unit_version, unit_specifier_id, model, vendor_name,model_name} 52 {0x000001f2, 0, 0x00000003, 0x000001f2, MOTUFW_MODEL_828mkII, "MOTU", "828MkII"}, 53 {0x000001f2, 0, 0x00000009, 0x000001f2, MOTUFW_MODEL_TRAVELER, "MOTU", "Traveler"}, 54 }; 49 55 50 56 /* ======================================================================= */ … … 145 151 } 146 152 147 struct VendorModelEntry {148 unsigned int vendor_id;149 unsigned int model_id;150 };151 152 static VendorModelEntry supportedDeviceList[] =153 {154 {0x0001f2, 0x00000000}, // Motu device, model entry not used155 156 };157 158 153 bool 159 154 MotuDevice::probe( ConfigRom& configRom ) 160 155 { 161 156 unsigned int vendorId = configRom.getNodeVendorId(); 162 unsigned int modelId = configRom.getModelId(); 157 // unsigned int modelId = configRom.getModelId(); 158 unsigned int unitVersion = configRom.getUnitVersion(); 159 unsigned int unitSpecifierId = configRom.getUnitSpecifierId(); 163 160 164 161 for ( unsigned int i = 0; … … 167 164 { 168 165 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 169 //&& ( supportedDeviceList[i].model_id == modelId ) 170 ) 166 // && ( supportedDeviceList[i].model_id == modelId ) 167 && ( supportedDeviceList[i].unit_version == unitVersion ) 168 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 169 ) 171 170 { 172 switch (configRom.getUnitVersion()) { 173 case MOTUFW_UNITVER_828mkII: 174 return true; 175 case MOTUFW_UNITVER_TRAVELER: 176 return true; 177 } 171 return true; 178 172 } 179 173 } … … 185 179 MotuDevice::discover() 186 180 { 187 // Find out if this device is one we know about 188 if (m_configRom->getUnitSpecifierId() == MOTUFW_VENDOR_MOTU) { 189 switch (m_configRom->getUnitVersion()) { 190 case MOTUFW_UNITVER_828mkII: 191 m_motu_model = MOTUFW_MODEL_828mkII; 192 break; 193 case MOTUFW_UNITVER_TRAVELER: 194 m_motu_model = MOTUFW_MODEL_TRAVELER; 195 break; 196 } 181 unsigned int vendorId = m_configRom->getNodeVendorId(); 182 // unsigned int modelId = m_configRom->getModelId(); 183 unsigned int unitVersion = m_configRom->getUnitVersion(); 184 unsigned int unitSpecifierId = m_configRom->getUnitSpecifierId(); 185 186 for ( unsigned int i = 0; 187 i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 188 ++i ) 189 { 190 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 191 // && ( supportedDeviceList[i].model_id == modelId ) 192 && ( supportedDeviceList[i].unit_version == unitVersion ) 193 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 194 ) 195 { 196 m_model = &(supportedDeviceList[i]); 197 m_motu_model=supportedDeviceList[i].model; 197 198 } 198 199 if (m_motu_model != MOTUFW_MODEL_NONE) { 200 debugOutput( DEBUG_LEVEL_VERBOSE, "found MOTU %s\n", 201 motufw_modelname[m_motu_model]); 202 return true; 203 } 204 205 return false; 199 } 200 201 if (m_model != NULL) { 202 debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 203 m_model->vendor_name, m_model->model_name); 204 return true; 205 } 206 207 return false; 206 208 } 207 209 … … 364 366 MotuDevice::showDevice() const 365 367 { 366 367 "MOTU %s at node %d\n", motufw_modelname[m_motu_model],368 368 debugOutput(DEBUG_LEVEL_VERBOSE, 369 "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 370 m_nodeId); 369 371 } 370 372