| 550 | } |
---|
| 551 | |
---|
| 552 | /** |
---|
| 553 | * Set a default configuration for the router. |
---|
| 554 | * This is necessary for somes devices for hardware coherence, in which case the next |
---|
| 555 | * has to be customized |
---|
| 556 | * @param rcfg The new RouterConfig |
---|
| 557 | * @return true if successful, false otherwise |
---|
| 558 | */ |
---|
| 559 | void |
---|
| 560 | EAP::setupDefaultRouterConfig_low() { |
---|
| 561 | unsigned int i; |
---|
| 562 | // add the routing destinations for a DICE chip |
---|
| 563 | switch(m_general_chip) { |
---|
| 564 | case DICE_EAP_CAP_GENERAL_CHIP_DICEII: |
---|
| 565 | // router/EAP currently not supported |
---|
| 566 | break; |
---|
| 567 | case DICE_EAP_CAP_GENERAL_CHIP_DICEJR: |
---|
| 568 | // second audio port (unique to the junior) |
---|
| 569 | addDestination("InS1", 0, 8, eRD_InS1); |
---|
| 570 | case DICE_EAP_CAP_GENERAL_CHIP_DICEMINI: |
---|
| 571 | // the 1394 stream receivers |
---|
| 572 | for (i=0; i<8; i++) { |
---|
| 573 | addRoute(eRS_InS0, i, eRD_ATX0, i); |
---|
| 574 | } |
---|
| 575 | for (i=0; i<8; i++) { |
---|
| 576 | addRoute(eRS_InS1, i, eRD_ATX0, i+8); |
---|
| 577 | } |
---|
| 578 | for (i=0; i<8; i++) { |
---|
| 579 | addRoute(eRS_ADAT, i, eRD_ATX1, i); |
---|
| 580 | } |
---|
| 581 | for (i=0; i<8; i++) { |
---|
| 582 | addRoute(eRS_AES, i, eRD_ATX1, i+8); |
---|
| 583 | } |
---|
| 584 | // The audio ports |
---|
| 585 | // Ensure that audio port are not muted |
---|
| 586 | for (i=0; i<8; i++) { |
---|
| 587 | addRoute(eRS_ARX0, i, eRD_InS0, i); |
---|
| 588 | } |
---|
| 589 | // the AES receiver |
---|
| 590 | for (i=0; i<8; i++) { |
---|
| 591 | addRoute(eRS_Muted, 0, eRD_AES, i); |
---|
| 592 | } |
---|
| 593 | // the ADAT receiver |
---|
| 594 | for (i=0; i<8; i++) { |
---|
| 595 | addRoute(eRS_Muted, 0, eRD_ADAT, i); |
---|
| 596 | } |
---|
| 597 | // the Mixer outputs |
---|
| 598 | for (i=0; i<8; i++) { |
---|
| 599 | addRoute(eRS_InS0, i, eRD_Mixer0, i); |
---|
| 600 | } |
---|
| 601 | for (i=0; i<8; i++) { |
---|
| 602 | addRoute(eRS_ADAT, i, eRD_Mixer0, i+8); |
---|
| 603 | } |
---|
| 604 | for (i=0; i<2; i++) { |
---|
| 605 | addRoute(eRS_Muted, 0, eRD_Mixer0, i+16); |
---|
| 606 | } |
---|
| 607 | // the ARM audio port |
---|
| 608 | for (i=0; i<0; i++) { |
---|
| 609 | addRoute(eRS_Muted, 0, eRD_ARM, i); |
---|
| 610 | } |
---|
| 611 | // mute |
---|
| 612 | addRoute(eRS_Muted, 0, eRD_Muted, 0); |
---|
| 613 | break; |
---|
| 614 | default: |
---|
| 615 | // this is an unsupported chip |
---|
| 616 | break; |
---|
| 617 | } |
---|
| 618 | } |
---|
| 619 | |
---|
| 620 | void |
---|
| 621 | EAP::setupDefaultRouterConfig_mid() { |
---|
| 622 | setupDefaultRouterConfig_low(); |
---|
| 623 | } |
---|
| 624 | |
---|
| 625 | void |
---|
| 626 | EAP::setupDefaultRouterConfig_high() { |
---|
| 627 | setupDefaultRouterConfig_low(); |
---|
| 628 | } |
---|
| 629 | |
---|
| 630 | void |
---|
| 631 | EAP::setupDefaultRouterConfig() { |
---|
| 632 | // First clear routes |
---|
| 633 | RouterConfig *rcfg = getActiveRouterConfig(); |
---|
| 634 | rcfg->clearRoutes(); |
---|
| 635 | |
---|
| 636 | // Then define the configuration depending on the samplerate |
---|
| 637 | switch(m_device.getCurrentConfig()) { |
---|
| 638 | case Device::eDC_Low: setupDefaultRouterConfig_low(); break; |
---|
| 639 | case Device::eDC_Mid: setupDefaultRouterConfig_mid(); break; |
---|
| 640 | case Device::eDC_High: setupDefaultRouterConfig_high(); break; |
---|
| 641 | default: |
---|
| 642 | debugError("Unsupported configuration mode\n"); |
---|
| 643 | return; |
---|
| 644 | } |
---|
| 645 | |
---|
| 646 | updateCurrentRouterConfig(*rcfg); |
---|