Changeset 1779
- Timestamp:
- 01/04/10 13:10:45 (13 years ago)
- Files:
-
- trunk/libffado/src/dice/dice_eap.cpp (modified) (25 diffs)
- trunk/libffado/src/dice/dice_eap.h (modified) (4 diffs)
- trunk/libffado/src/dice/focusrite/saffire_pro24.cpp (modified) (2 diffs)
- trunk/libffado/support/dbus/controlserver.cpp (modified) (1 diff)
- trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/dice/dice_eap.cpp
r1776 r1779 875 875 EAP::Mixer::updateNameCache() 876 876 { 877 debugWarning("What is this function about?\n"); 878 #if 0 877 879 // figure out the number of i/o's 878 880 int nb_inputs = m_eap.m_mixer_nb_tx; … … 953 955 #endif 954 956 } 957 #endif 955 958 } 956 959 … … 973 976 printMessage("%s\n", tmp); 974 977 975 cnt = 0;978 /*cnt = 0; 976 979 for(int j=0; j < nb_inputs; j++) { 977 980 cnt += snprintf(tmp+cnt, bufflen-cnt, "%s:%02d ", … … 979 982 m_input_route_map[j].srcChannel); 980 983 } 981 printMessage("%s\n", tmp); 984 printMessage("%s\n", tmp);*/ 982 985 983 986 // display coefficients … … 990 993 // construct the set of destinations 991 994 std::string destinations; 992 for ( RouterConfig::RouteVectorIterator it = m_output_route_map[i].begin();995 /*for ( RouterConfig::RouteVectorIterator it = m_output_route_map[i].begin(); 993 996 it != m_output_route_map[i].end(); 994 997 ++it ) … … 1001 1004 destinations += tmp; 1002 1005 } 1003 } 1006 }*/ 1004 1007 1005 1008 cnt += snprintf(tmp+cnt, bufflen-cnt, "=[%02d]=> %s ", i, destinations.c_str()); … … 1076 1079 1077 1080 // Names 1081 #if 0 1078 1082 std::string 1079 1083 EAP::Mixer::getColName(const int col) { … … 1095 1099 return tmp; 1096 1100 } 1101 #endif 1097 1102 1098 1103 // … … 1151 1156 EAP::Router::getDestinationName(const int dstid) 1152 1157 { 1153 debugWarning("TODO: Implement getDestinationName(0x%02x)\n", dstid);1154 1158 for (std::map<std::string, int>::iterator it=m_destinations.begin(); it!=m_destinations.end(); ++it) { 1155 1159 if (it->second == dstid) { … … 1196 1200 stringlist 1197 1201 EAP::Router::getDestinationsForSource(const std::string& srcname) { 1198 debugWarning("TODO: Implement getDestinationsForSource(%s)\n", srcname.c_str()); 1199 return stringlist(); 1202 RouterConfig* rcfg = m_eap.getActiveRouterConfig(); 1203 if(rcfg == NULL) { 1204 debugError("Could not request active router configuration\n"); 1205 return ""; 1206 } 1207 stringlist ret; 1208 std::vector<int> dests = rcfg->getDestinationsForSource(m_sources[srcname]); 1209 for (int i=0; i<dests.size(); ++i) { 1210 ret.push_back(m_destinations[dests[i]]); 1211 } 1212 return ret; 1200 1213 } 1201 1214 std::string … … 1206 1219 return ""; 1207 1220 } 1208 eRouteDestination dst = eRouteDestination(m_destinations[dstname]>>4); 1209 int dstChannel = m_destinations[dstname]&0xf; 1210 RouterConfig::Route r = rcfg->getRouteForDestination(dst, dstChannel); 1211 if (r.src == eRS_Invalid) { 1212 return ""; 1213 } 1214 return getSourceName((r.src<<4)+r.srcChannel); 1221 int source = rcfg->getSourceForDestination(m_destinations[dstname]); 1222 return getSourceName(source); 1215 1223 } 1216 1224 … … 1220 1228 { 1221 1229 debugWarning("TODO: Implement canConnect(0x%02x, 0x%02x)\n", source, dest); 1222 /*if((unsigned)source >= m_sources.size()) {1223 debugWarning("source id out of range (%d)\n", source);1224 return false;1225 }1226 Source s = m_sources.at(source);1227 1228 if((unsigned)dest >= m_destinations.size()) {1229 debugWarning("destination id out of range (%d)\n", dest);1230 return false;1231 }1232 Destination d = m_destinations.at(dest);*/1233 1230 1234 1231 // we can connect anything … … 1240 1237 EAP::Router::setConnectionState(const int source, const int dest, const bool enable) 1241 1238 { 1239 debugOutput(DEBUG_LEVEL_VERBOSE,"Router::setConnectionState(0x%02x -> 0x%02x ? %i)\n", source, dest, enable); 1242 1240 // get the routing configuration 1243 1241 RouterConfig *rcfg = m_eap.getActiveRouterConfig(); … … 1247 1245 } 1248 1246 1249 RouterConfig::Route r = rcfg->getRouteForDestination(eRouteDestination(dest>>4), dest&0xf); 1250 if ( r.srcChannel == -1 && r.dstChannel == -1 && enable ) { 1251 r.src = eRouteSource(source>>4); 1252 r.srcChannel = source&0xf; 1253 r.dst = eRouteDestination(dest>>4); 1254 r.dstChannel = dest&0xf; 1255 int ret = rcfg->insertRoute(r); 1256 m_eap.updateCurrentRouterConfig(*rcfg); 1257 return ret; 1258 } 1259 if ( r.dst != (dest>>4) || r.dstChannel != (dest&0xf) ) { 1260 debugError("Route exists but isn't correct? strange...\n"); 1261 debugError(" wanted: 0x%02x got: 0x%02x\n", dest, (r.dst<<4)+r.dstChannel); 1262 return false; 1263 } 1264 if ( !enable ) { 1265 int ret = rcfg->removeRoute(r); 1266 m_eap.updateCurrentRouterConfig(*rcfg); 1267 return ret; 1268 } 1269 if ( enable ) { 1270 int index = rcfg->getRouteIndex(r); 1271 r.src = eRouteSource(source>>4); 1272 r.srcChannel = (source&0xf); 1273 int ret = rcfg->replaceRoute(index, r); 1274 m_eap.updateCurrentRouterConfig(*rcfg); 1275 return ret; 1276 } 1277 1278 // When we reach this point, something went wrong. Return false by default... 1279 return false; 1247 bool ret = false; 1248 if (enable) { 1249 ret = rcfg->setupRoute(source, dest); 1250 } else { 1251 ret = rcfg->removeRoute(source, dest); 1252 } 1253 m_eap.updateCurrentRouterConfig(*rcfg); 1254 return ret; 1280 1255 } 1281 1256 … … 1289 1264 return false; 1290 1265 } 1291 // Construct a route 1292 RouterConfig::Route r = { eRouteSource(source>>4), source&0xf, eRouteDestination(dest>>4), dest&0xf }; 1293 // get the routes index... 1294 int idx = rcfg->getRouteIndex(r); 1295 // ...and return true if it exists 1296 return (idx>=0); 1266 if (rcfg->getSourceForDestination(dest) == source) { 1267 return true; 1268 } 1269 return false; 1297 1270 } 1298 1271 … … 1422 1395 } 1423 1396 } 1424 //printMessage("Active router config:\n"); 1425 //m_peak.read(); 1426 //m_peak.show(); 1397 printMessage("Active router config:\n"); 1398 m_eap.getActiveRouterConfig()->show(); 1399 printMessage("Active peak config:\n"); 1400 m_peak.read(); 1401 m_peak.show(); 1427 1402 } 1428 1403 … … 1447 1422 { 1448 1423 // first clear the current route vector 1449 m_routes .clear();1424 m_routes2.clear(); 1450 1425 1451 1426 uint32_t nb_routes; … … 1465 1440 } 1466 1441 1467 // decode into the routing vector1442 // decode into the routing map 1468 1443 for(unsigned int i=0; i < nb_routes; i++) { 1469 m_routes .push_back(decodeRoute(tmp_entries[i]));1444 m_routes2[tmp_entries[i]&0xff] = (tmp_entries[i]>>8)&0xff; 1470 1445 } 1471 1446 return true; … … 1475 1450 EAP::RouterConfig::write(enum eRegBase base, unsigned offset) 1476 1451 { 1477 uint32_t nb_routes = m_routes .size();1452 uint32_t nb_routes = m_routes2.size(); 1478 1453 if(nb_routes == 0) { 1479 debugWarning("Writing 0 routes?\n"); 1454 debugWarning("Writing 0 routes? This will deactivate routing and make the device very silent...\n"); 1455 } 1456 if (nb_routes > 128) { 1457 debugError("More then 128 are not possible, only the first 128 routes will get saved!\n"); 1458 nb_routes = 128; 1480 1459 } 1481 1460 uint32_t tmp_entries[nb_routes]; … … 1483 1462 // encode from the routing vector 1484 1463 int i=0; 1485 for ( RouteVectorIterator it = m_routes.begin(); 1486 it != m_routes.end(); 1487 ++it ) 1488 { 1489 tmp_entries[i] = encodeRoute( *it ); 1490 i++; 1464 for (RouteVectorV2::iterator it=m_routes2.begin(); it!=m_routes2.end(); ++it) { 1465 tmp_entries[i] = ((it->second<<8) + it->first)&0xffff; 1466 ++i; 1467 } 1468 1469 uint32_t zeros[129]; 1470 for (int i=0; i<129; ++i) zeros[i] = 0; 1471 if(!m_eap.writeRegBlock(base, offset, zeros, 129*4)) { 1472 debugError("Failed to write zeros to router config block\n"); 1473 return false; 1491 1474 } 1492 1475 … … 1504 1487 1505 1488 bool 1506 EAP::RouterConfig::insertRoute(struct Route r, unsigned int index) 1507 { 1508 unsigned int nb_routes = getNbRoutes(); 1509 if(index > nb_routes) { 1510 debugError("Index out of range\n"); 1511 return false; 1512 } 1513 if (index == nb_routes) { // append 1514 m_routes.push_back(r); 1515 return true; 1516 } 1517 // insert 1518 RouteVectorIterator pos = m_routes.begin() + index; 1519 m_routes.insert(pos, r); 1489 EAP::RouterConfig::setupRoute(unsigned char src, unsigned char dest) { 1490 debugOutput(DEBUG_LEVEL_VERBOSE,"RouterConfig::setupRoute( 0x%02x, 0x%02x )\n", src, dest); 1491 m_routes2[dest] = src; 1520 1492 return true; 1521 1493 } 1522 1494 1523 1495 bool 1524 EAP::RouterConfig::replaceRoute(unsigned int old_index, struct Route new_route) 1525 { 1526 if(old_index >= getNbRoutes()) { 1527 debugError("Index out of range\n"); 1528 return false; 1529 } 1530 if(!removeRoute(old_index)) { 1531 debugError("Could not remove old route\n"); 1532 return false; 1533 } 1534 return insertRoute(new_route, old_index); 1535 } 1536 1537 bool 1538 EAP::RouterConfig::replaceRoute(struct Route old_route, struct Route new_route) 1539 { 1540 int idx = getRouteIndex(old_route); 1541 if(idx < 0) { 1542 debugWarning("Route not found\n"); 1543 return false; 1544 } 1545 return replaceRoute((unsigned int)idx, new_route); 1546 } 1547 1548 bool 1549 EAP::RouterConfig::removeRoute(struct Route r) 1550 { 1551 int idx = getRouteIndex(r); 1552 if(idx < 0) { 1553 debugWarning("Route not found\n"); 1554 return false; 1555 } 1556 return removeRoute((unsigned int)idx); 1557 } 1558 1559 bool 1560 EAP::RouterConfig::removeRoute(unsigned int index) 1561 { 1562 if(index >= getNbRoutes()) { 1563 debugError("Index out of range\n"); 1564 return false; 1565 } 1566 RouteVectorIterator pos = m_routes.begin() + index; 1567 m_routes.erase(pos); 1496 EAP::RouterConfig::removeRoute(unsigned char src, unsigned char dest) { 1497 debugOutput(DEBUG_LEVEL_VERBOSE,"RouterConfig::removeRoute( 0x%02x, 0x%02x )\n", src, dest); 1498 if (m_routes2.count(dest) > 0) { 1499 if (src != m_routes2[dest]) { 1500 return false; 1501 } 1502 return removeRoute(dest); 1503 } 1568 1504 return true; 1569 1505 } 1570 1506 1571 int 1572 EAP::RouterConfig::getRouteIndex(struct Route r) 1573 { 1574 int i = 0; 1575 for ( RouteVectorIterator it = m_routes.begin(); 1576 it != m_routes.end(); 1577 ++it ) 1578 { 1579 struct Route t = *it; 1580 if ((t.src == r.src) && (t.srcChannel == r.srcChannel) && (t.dst == r.dst) && (t.dstChannel == r.dstChannel)) return i; 1581 i++; 1507 bool 1508 EAP::RouterConfig::removeRoute(unsigned char dest) { 1509 debugOutput(DEBUG_LEVEL_VERBOSE,"RouterConfig::removeRoute( 0x%02x )\n", dest); 1510 m_routes2.erase(dest); 1511 if (m_routes2.count(dest) < 1) { 1512 return false; 1513 } 1514 return true; 1515 } 1516 1517 unsigned char 1518 EAP::RouterConfig::getSourceForDestination(unsigned char dest) { 1519 if (m_routes2.count(dest) > 0) { 1520 return m_routes2[dest]; 1582 1521 } 1583 1522 return -1; 1584 1523 } 1585 1524 1586 struct EAP::RouterConfig::Route 1587 EAP::RouterConfig::getRoute(unsigned int idx) 1588 { 1589 if( (idx < 0) || (idx >= m_routes.size()) ) { 1590 debugWarning("Route index out of range (%d)\n", idx); 1591 Route r = {eRS_Invalid, -1, eRD_Invalid, -1, 0}; 1592 return r; 1593 } 1594 return m_routes.at(idx); 1595 } 1596 1597 #define CASE_INT_EQUAL_RETURN(_x) case (int)(_x): return _x; 1598 enum eRouteDestination 1599 EAP::RouterConfig::intToRouteDestination(int dst) 1600 { 1601 switch(dst) { 1602 CASE_INT_EQUAL_RETURN(eRD_AES); 1603 CASE_INT_EQUAL_RETURN(eRD_ADAT); 1604 CASE_INT_EQUAL_RETURN(eRD_Mixer0); 1605 CASE_INT_EQUAL_RETURN(eRD_Mixer1); 1606 CASE_INT_EQUAL_RETURN(eRD_InS0); 1607 CASE_INT_EQUAL_RETURN(eRD_InS1); 1608 CASE_INT_EQUAL_RETURN(eRD_ARM); 1609 CASE_INT_EQUAL_RETURN(eRD_ATX0); 1610 CASE_INT_EQUAL_RETURN(eRD_ATX1); 1611 CASE_INT_EQUAL_RETURN(eRD_Muted); 1612 default: return eRD_Invalid; 1613 } 1614 } 1615 1616 enum eRouteSource 1617 EAP::RouterConfig::intToRouteSource(int src) 1618 { 1619 switch(src) { 1620 CASE_INT_EQUAL_RETURN(eRS_AES); 1621 CASE_INT_EQUAL_RETURN(eRS_ADAT); 1622 CASE_INT_EQUAL_RETURN(eRS_Mixer); 1623 CASE_INT_EQUAL_RETURN(eRS_InS0); 1624 CASE_INT_EQUAL_RETURN(eRS_InS1); 1625 CASE_INT_EQUAL_RETURN(eRS_ARM); 1626 CASE_INT_EQUAL_RETURN(eRS_ARX0); 1627 CASE_INT_EQUAL_RETURN(eRS_ARX1); 1628 CASE_INT_EQUAL_RETURN(eRS_Muted); 1629 default: return eRS_Invalid; 1630 } 1631 } 1632 1633 struct EAP::RouterConfig::Route 1634 EAP::RouterConfig::decodeRoute(uint32_t val) { 1635 int routerval = val & 0xFFFF; 1636 int peak = (val >> 16) & 0x0FFF; 1637 int src_blk = (routerval >> 12) & 0xF; 1638 int src_ch = (routerval >> 8) & 0xF; 1639 int dst_blk = (routerval >> 4) & 0xF; 1640 int dst_ch = (routerval >> 0) & 0xF; 1641 struct Route r = {intToRouteSource(src_blk), src_ch, intToRouteDestination(dst_blk), dst_ch, peak}; 1642 return r; 1643 } 1644 1645 uint32_t 1646 EAP::RouterConfig::encodeRoute(struct Route r) { 1647 if(r.src == eRS_Invalid || r.dst == eRD_Invalid) { 1648 debugWarning("Encoding invalid source/dest (%d/%d)\n", r.src, r.dst); 1649 // return 0xFFFFFFFF; 1650 } 1651 unsigned int src_blk = ((unsigned int)r.src) & 0xF; 1652 unsigned int src_ch = ((unsigned int)r.srcChannel) & 0xF; 1653 unsigned int dst_blk = ((unsigned int)r.dst) & 0xF; 1654 unsigned int dst_ch = ((unsigned int)r.dstChannel) & 0xF; 1655 uint32_t routerval = 0; 1656 routerval |= (src_blk << 12); 1657 routerval |= (src_ch << 8); 1658 routerval |= (dst_blk << 4); 1659 routerval |= (dst_ch << 0); 1660 return routerval; 1661 } 1662 1663 struct EAP::RouterConfig::Route 1664 EAP::RouterConfig::getRouteForDestination(enum eRouteDestination dst, int channel) 1665 { 1666 for ( RouteVectorIterator it = m_routes.begin(); 1667 it != m_routes.end(); 1668 ++it ) 1669 { 1670 struct Route r = *it; 1671 if((r.dst == (int)dst) && (r.dstChannel == channel)) { 1672 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "%s:%02d comes from %s:%02d\n", 1673 dstBlockToString(r.dst), r.dstChannel, 1674 srcBlockToString(r.src), r.srcChannel); 1675 return r; 1676 } 1677 } 1678 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "%s:%02d source can't be found\n", 1679 dstBlockToString((int)dst), channel); 1680 struct Route r = {eRS_Invalid, -1, eRD_Invalid, -1, 0}; 1681 return r; 1682 } 1683 1684 std::vector<struct EAP::RouterConfig::Route> 1685 EAP::RouterConfig::getRoutesForSource(enum eRouteSource src, int channel) 1686 { 1687 std::vector<struct Route>routes; 1688 for ( RouteVectorIterator it = m_routes.begin(); 1689 it != m_routes.end(); 1690 ++it ) 1691 { 1692 struct Route r = *it; 1693 if((r.src == (int)src) && (r.srcChannel == channel)) { 1694 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "%s:%02d goes to %s:%02d\n", 1695 srcBlockToString(r.src), r.srcChannel, 1696 dstBlockToString(r.dst), r.dstChannel); 1697 routes.push_back(r); 1698 } 1699 } 1700 return routes; 1525 std::vector<unsigned char> 1526 EAP::RouterConfig::getDestinationsForSource(unsigned char source) { 1527 std::vector<unsigned char> ret; 1528 for (RouteVectorV2::iterator it=m_routes2.begin(); it!=m_routes2.end(); ++it) { 1529 if (it->second == source) { 1530 ret.push_back(it->first); 1531 } 1532 } 1533 return ret; 1701 1534 } 1702 1535 … … 1704 1537 EAP::RouterConfig::show() 1705 1538 { 1706 for ( RouteVectorIterator it = m_routes.begin(); 1707 it != m_routes.end(); 1708 ++it ) 1709 { 1710 struct Route r = *it; 1711 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "%s:%02d => %s:%02d\n", 1712 srcBlockToString(r.src), r.srcChannel, 1713 dstBlockToString(r.dst), r.dstChannel); 1714 } 1715 } 1716 1717 1539 for ( RouteVectorV2::iterator it=m_routes2.begin(); it!=m_routes2.end(); ++it ) { 1540 printMessage("0x%02x -> 0x%02x\n", it->second, it->first); 1541 } 1542 } 1543 1544 // 1718 1545 // ----------- peak space ------------- 1546 // 1719 1547 1720 1548 bool 1721 1549 EAP::PeakSpace::read(enum eRegBase base, unsigned offset) 1722 1550 { 1551 #warning "Implement me again!" 1552 #if 0 1723 1553 // first clear the current route vector 1724 1554 m_routes.clear(); … … 1746 1576 } 1747 1577 // show(); 1578 #endif 1748 1579 return true; 1749 1580 } … … 1759 1590 EAP::PeakSpace::show() 1760 1591 { 1592 debugError("PeakSpace::show() is currently not implemented!\n"); 1593 #if 0 1761 1594 for ( RouteVectorIterator it = m_routes.begin(); 1762 1595 it != m_routes.end(); … … 1764 1597 { 1765 1598 struct Route r = *it; 1766 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "%s:%02d => %s:%02d : %06d\n", 1767 srcBlockToString(r.src), r.srcChannel, 1768 dstBlockToString(r.dst), r.dstChannel, 1769 r.peak); 1770 } 1599 printMessage("%s:%02d => %s:%02d : %06d\n", 1600 srcBlockToString(r.src), r.srcChannel, 1601 dstBlockToString(r.dst), r.dstChannel, 1602 r.peak); 1603 } 1604 #endif 1771 1605 } 1772 1606 trunk/libffado/src/dice/dice_eap.h
r1776 r1779 206 206 207 207 public: 208 struct Route209 {210 enum eRouteSource src;211 int srcChannel;212 enum eRouteDestination dst;213 int dstChannel;214 int peak;215 };216 typedef std::vector<RouterConfig::Route> RouteVector;217 typedef std::vector<RouterConfig::Route>::iterator RouteVectorIterator;218 208 219 209 virtual bool read() {return read(m_base, m_offset);}; … … 223 213 virtual void show(); 224 214 225 bool insertRoute(struct Route r) 226 {return insertRoute(r, m_routes.size());}; 227 bool insertRoute(struct Route r, unsigned int index); 228 bool replaceRoute(unsigned int old_index, struct Route new_route); 229 bool replaceRoute(struct Route old_route, struct Route new_route); 230 bool removeRoute(struct Route r); 231 bool removeRoute(unsigned int index); 232 int getRouteIndex(struct Route r); 233 struct Route getRoute(unsigned int index); 234 235 unsigned int getNbRoutes() {return m_routes.size();}; 236 237 struct Route getRouteForDestination(enum eRouteDestination dst, int channel); 238 RouteVector getRoutesForSource(enum eRouteSource src, int channel); 239 240 struct Route decodeRoute(uint32_t val); 241 uint32_t encodeRoute(struct Route r); 242 public: 243 static enum eRouteDestination intToRouteDestination(int); 244 static enum eRouteSource intToRouteSource(int); 215 /** 216 @brief map for the routes 217 218 The key is the destination as each destination can only have audio from one source. 219 Sources can be routed to several destinations though. 220 */ 221 typedef std::map<unsigned char,unsigned char> RouteVectorV2; 222 223 /** 224 @brief Set up a route between src and dest 225 226 If a route with that destination exists, it will be replaced. If no route to that 227 destination exists, a new route will be established. 228 */ 229 bool setupRoute(unsigned char src, unsigned char dest); 230 /** 231 @brief Remove a route 232 233 @todo is this really necessary? 234 */ 235 bool removeRoute(unsigned char src, unsigned char dest); 236 /** 237 @brief Remove the destinations route 238 */ 239 bool removeRoute(unsigned char dest); 240 241 /** 242 @brief Return the source for the given destination 243 244 Returns -1 if the destination is not connected. 245 */ 246 unsigned char getSourceForDestination(unsigned char dest); 247 /** 248 @brief Return a list of destinations for a given source 249 250 Returns an empty list if no destination is connected to this source. 251 */ 252 std::vector<unsigned char> getDestinationsForSource(unsigned char src); 253 254 unsigned int getNbRoutes() {return m_routes2.size();}; 255 245 256 protected: 246 257 EAP &m_eap; 247 258 enum eRegBase m_base; 248 259 unsigned int m_offset; 249 RouteVector m_routes;260 RouteVectorV2 m_routes2; 250 261 protected: 251 262 DECLARE_DEBUG_MODULE_REFERENCE; … … 341 352 virtual double getValue( const int, const int ); 342 353 343 bool hasNames() const { return true; } 344 std::string getRowName( const int ); 345 std::string getColName( const int ); 354 // @TODO: re-implement names 355 bool hasNames() const { return false; } 356 //std::string getRowName( const int ); 357 //std::string getColName( const int ); 346 358 347 359 // TODO: implement connections. … … 356 368 fb_quadlet_t *m_coeff; 357 369 358 std::map<int, RouterConfig::Route> m_input_route_map;359 std::map<int, RouterConfig::RouteVector> m_output_route_map;370 //std::map<int, RouterConfig::Route> m_input_route_map; 371 //std::map<int, RouterConfig::RouteVector> m_output_route_map; 360 372 361 373 DECLARE_DEBUG_MODULE_REFERENCE; trunk/libffado/src/dice/focusrite/saffire_pro24.cpp
r1776 r1779 50 50 addSource("Mixer", 0, 16, eRS_Mixer); 51 51 addSource("1394", 0, 8, eRS_ARX0); 52 addSource("Mute", 0, 1, eRS_Muted); 52 53 } 53 54 void SaffirePro24::SaffirePro24EAP::setupDestinations() { … … 57 58 addDestination("Mixer", 0, 2, eRD_Mixer1, 16); 58 59 addDestination("1394", 0, 16, eRD_ATX0); 60 addDestination("Mute", 0, 1, eRD_Muted); 59 61 } 60 62 trunk/libffado/support/dbus/controlserver.cpp
r1776 r1779 942 942 CrossbarRouter::getPeakValues() 943 943 { 944 return std::vector< DBus::Struct<DBus::String, double> >(); 944 std::map<std::string, double> peakvalues = m_Slave.getPeakValues(); 945 std::vector< DBus::Struct<DBus::String, double> > ret; 946 for (std::map<std::string, double>::iterator it=peakvalues.begin(); it!=peakvalues.end(); ++it) { 947 DBus::Struct<DBus::String, double> tmp; 948 tmp._1 = it->first; 949 tmp._2 = it->second; 950 ret.push_back(tmp); 951 } 952 return ret; 945 953 /*std::vector< DBus::Struct<int, double> > out; 946 954 Control::CrossbarRouter::PeakValues values = m_Slave.getPeakValues(); trunk/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py
r1776 r1779 37 37 38 38 self.output = output 39 if input is None:40 input = int(self.interface.getSourceForDestination(output))41 self.setInput(input)42 43 def setInput(self, input):44 #log.debug("VuMeter.setInput() %i->%i" % (self.output, input))45 self.input = input46 39 47 40 def updateLevel(self, value): … … 80 73 self.layout.addWidget(self.lbl, 0, 0) 81 74 82 #self.vu = VuMeter(self.interface, self.interface.getDestinationIndex(outname), parent=self)83 #self.layout.addWidget(self.vu, 0, 1)75 self.vu = VuMeter(self.interface, outname, parent=self) 76 self.layout.addWidget(self.vu, 0, 1) 84 77 85 78 sources = self.interface.getSourceNames() … … 175 168 #log.debug("CrossbarRouter.updateLevels()") 176 169 peakvalues = self.interface.getPeakValues() 177 #log.debug("Got %i peaks" % len(peakvalues))170 log.debug("Got %i peaks" % len(peakvalues)) 178 171 for peak in peakvalues: 179 172 #log.debug("peak = [%s,%s]" % (str(peak[0]),str(peak[1])))