Changeset 1902
- Timestamp:
- 09/19/10 05:00:27 (14 years ago)
- Files:
-
- trunk/libffado/src/motu/motu_avdevice.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/motu/motu_avdevice.cpp
r1892 r1902 55 55 56 56 #include <libraw1394/csr.h> 57 58 // FIXME: this allows for easy switching between the old PortEntry and 59 // new PortEntryGroup methods of identifying audio streams in the iso 60 // packets sent to/from the MOTU interfaces. Leave undefined to use 61 // the old method. 62 // 63 // #define USE_PORTGROUPS 64 57 65 58 66 namespace Motu { … … 1485 1493 1486 1494 // Add audio capture ports 1487 #define USEOLD 1488 #ifdef USEOLD 1495 #ifndef USE_PORTGROUPS 1489 1496 if (!addDirPorts(Streaming::Port::E_Capture, samp_freq, optical_in_mode_a, optical_in_mode_b)) { 1490 1497 return false; … … 1549 1556 1550 1557 // Add audio playback ports 1551 #if def USEOLD1558 #ifndef USE_PORTGROUPS 1552 1559 if (!addDirPorts(Streaming::Port::E_Playback, samp_freq, optical_out_mode_a, optical_out_mode_b)) { 1553 1560 return false; … … 1960 1967 unsigned int flags = 0; 1961 1968 unsigned int port_flags; 1969 const DevicePropertyEntry *devprop = &DevicesProperty[m_motu_model-1]; 1962 1970 1963 1971 getOpticalMode(direction, &optical_mode_a, &optical_mode_b); … … 1985 1993 // Don't test for padding port flag here since we need to include such 1986 1994 // pseudo-ports when calculating the event size. 1987 for (i=0; i < DevicesProperty[m_motu_model-1].n_port_entries; i++) { 1988 port_flags = DevicesProperty[m_motu_model-1].port_entry[i].port_flags; 1995 #ifndef USE_PORTGROUPS 1996 for (i=0; i < devprop->n_port_entries; i++) { 1997 port_flags = devprop->port_entry[i].port_flags; 1989 1998 /* Make sure the optical port tests return true for devices without 1990 1999 * one or both optical ports. … … 2003 2012 } 2004 2013 } 2014 #else 2015 for (i=0; i<devprop->n_portgroup_entries; i++) { 2016 unsigned int portgroup_flags = devprop->portgroup_entry[i].flags; 2017 /* For devices without one or more optical ports, ensure the tests 2018 * on the optical ports always returns "true". 2019 */ 2020 if (optical_a_mode == MOTU_OPTICAL_MODE_NONE) { 2021 portgroup_flags |= MOTU_PA_OPTICAL_ANY; 2022 } 2023 if (optical_b_mode == MOTU_OPTICAL_MODE_NONE) { 2024 portgroup_flags |= MOTU_PA_MK3_OPT_B_ANY; 2025 } 2026 if (( portgroup_flags & dir ) && 2027 ( portgroup_flags & MOTU_PA_RATE_MASK & flags ) && 2028 ( portgroup_flags & MOTU_PA_OPTICAL_MASK & flags ) && 2029 ( portgroup_flags & MOTU_PA_MK3_OPT_B_MASK & flags )) { 2030 size += 3*devprop->portgroup_entry[i].n_channels; 2031 } 2032 } 2033 #endif 2005 2034 2006 2035 // Finally round size up to the next quadlet boundary