Changeset 659
- Timestamp:
- 10/18/07 16:45:57 (16 years ago)
- Files:
-
- trunk/libffado/src/motu/motu_avdevice.cpp (modified) (5 diffs)
- trunk/libffado/src/motu/motu_avdevice.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/motu/motu_avdevice.cpp
r658 r659 177 177 }; 178 178 179 const DevicePortsEntry DevicesPorts[] = { 180 { Ports_828MKII, sizeof( Ports_828MKII ) }, 181 { Ports_TRAVELER, sizeof( Ports_TRAVELER ) }, 182 { Ports_ULTRALITE, sizeof( Ports_ULTRALITE ) }, 183 { Ports_8PRE, sizeof( Ports_8PRE ) }, 179 const DevicePropertyEntry DevicesProperty[] = { 180 // { Ports_map, sizeof( Ports_map ), MaxSR }, 181 { Ports_828MKII, sizeof( Ports_828MKII ), 96000 }, 182 { Ports_TRAVELER, sizeof( Ports_TRAVELER ), 192000 }, 183 { Ports_ULTRALITE, sizeof( Ports_ULTRALITE ), 96000 }, 184 { Ports_8PRE, sizeof( Ports_8PRE ), 96000 }, 184 185 }; 185 186 … … 320 321 int i, supported=true, cancel_adat=false; 321 322 323 if ( samplingFrequency > DevicesProperty[m_motu_model-1].MaxSampleRate ) 324 return false; 325 322 326 switch ( samplingFrequency ) { 323 327 case 22050: 324 supported=false;325 break;326 328 case 24000: 327 supported=false;328 break;329 329 case 32000: 330 330 supported=false; … … 343 343 break; 344 344 case 176400: 345 // Currently only the Traveler supports 4x sample rates 346 if (m_motu_model == MOTUFW_MODEL_TRAVELER) { 347 new_rate = MOTUFW_RATE_BASE_44100 | MOTUFW_RATE_MULTIPLIER_4X; 348 cancel_adat = true; 349 } else 350 supported=false; 345 new_rate = MOTUFW_RATE_BASE_44100 | MOTUFW_RATE_MULTIPLIER_4X; 346 cancel_adat = true; // current ADAT protocol doesn't support sample rate > 96000 351 347 break; 352 348 case 192000: 353 // Currently only the Traveler supports 4x sample rates 354 if (m_motu_model == MOTUFW_MODEL_TRAVELER) { 355 new_rate = MOTUFW_RATE_BASE_48000 | MOTUFW_RATE_MULTIPLIER_4X; 356 cancel_adat = true; 357 } else 358 supported=false; 349 new_rate = MOTUFW_RATE_BASE_48000 | MOTUFW_RATE_MULTIPLIER_4X; 350 cancel_adat = true; 359 351 break; 360 352 default: … … 845 837 flags |= MOTUFW_PA_RATE_1x; 846 838 847 for (i=0; i < ( DevicesP orts[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) {848 if (( DevicesP orts[m_motu_model-1].PortsList[i].port_dir & dir ) &&849 ( DevicesP orts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) &&850 ( DevicesP orts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) {839 for (i=0; i < ( DevicesProperty[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) { 840 if (( DevicesProperty[m_motu_model-1].PortsList[i].port_dir & dir ) && 841 ( DevicesProperty[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 842 ( DevicesProperty[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 851 843 size += 3; 852 844 } … … 925 917 } 926 918 927 for (i=0; i < ( DevicesP orts[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) {928 if (( DevicesP orts[m_motu_model-1].PortsList[i].port_dir & dir ) &&929 ( DevicesP orts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) &&930 ( DevicesP orts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) {919 for (i=0; i < ( DevicesProperty[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) { 920 if (( DevicesProperty[m_motu_model-1].PortsList[i].port_dir & dir ) && 921 ( DevicesProperty[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 922 ( DevicesProperty[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 931 923 asprintf(&buff,"%s_%s_%s" , id.c_str(), mode_str, 932 DevicesP orts[m_motu_model-1].PortsList[i].port_name);933 if (!addPort(s_processor, buff, direction, DevicesP orts[m_motu_model-1].PortsList[i].port_offset, 0))924 DevicesProperty[m_motu_model-1].PortsList[i].port_name); 925 if (!addPort(s_processor, buff, direction, DevicesProperty[m_motu_model-1].PortsList[i].port_offset, 0)) 934 926 return false; 935 927 } trunk/libffado/src/motu/motu_avdevice.h
r658 r659 114 114 }; 115 115 116 struct DeviceP ortsEntry {116 struct DevicePropertyEntry { 117 117 const PortEntry* PortsList; 118 118 int PortsListLength; 119 int MaxSampleRate; 119 120 // Others features can be added here like MIDI port presence. 120 121 };