| 611 | // PlaybackRouting controls |
---|
| 612 | |
---|
| 613 | PlaybackRoutingControl::PlaybackRoutingControl(FireWorks::Device& parent) |
---|
| 614 | : Control::Discrete(&parent, "PlaybackRouting") |
---|
| 615 | , m_ParentDevice(parent) |
---|
| 616 | { |
---|
| 617 | } |
---|
| 618 | |
---|
| 619 | PlaybackRoutingControl::PlaybackRoutingControl(FireWorks::Device& parent, std::string n) |
---|
| 620 | : Control::Discrete(&parent, n) |
---|
| 621 | , m_ParentDevice(parent) |
---|
| 622 | { |
---|
| 623 | } |
---|
| 624 | |
---|
| 625 | PlaybackRoutingControl::~PlaybackRoutingControl() |
---|
| 626 | { |
---|
| 627 | } |
---|
| 628 | |
---|
| 629 | void PlaybackRoutingControl::show() |
---|
| 630 | { |
---|
| 631 | debugOutput(DEBUG_LEVEL_NORMAL, "PlaybackRouting\n"); |
---|
| 632 | } |
---|
| 633 | |
---|
| 634 | bool PlaybackRoutingControl::GetState(EfcIsocMapIOConfigCmd *cmd) |
---|
| 635 | { |
---|
| 636 | cmd->m_num_playmap_entries = 3; |
---|
| 637 | cmd->m_playmap[0] = 0; |
---|
| 638 | cmd->m_playmap[1] = 0; |
---|
| 639 | cmd->m_playmap[2] = 0; |
---|
| 640 | |
---|
| 641 | cmd->setType(eCT_Get); |
---|
| 642 | if (!m_ParentDevice.doEfcOverAVC(*cmd)) |
---|
| 643 | return false; |
---|
| 644 | |
---|
| 645 | return true; |
---|
| 646 | } |
---|
| 647 | |
---|
| 648 | |
---|
| 649 | bool PlaybackRoutingControl::setValue(int idx, int v) |
---|
| 650 | { |
---|
| 651 | EfcIsocMapIOConfigCmd setCmd; |
---|
| 652 | |
---|
| 653 | /* |
---|
| 654 | * NOTE: |
---|
| 655 | * Playback Stream ch1/2: 0 |
---|
| 656 | * Playback Stream ch3/4: 2 |
---|
| 657 | * Playback Stream ch5/6: 4 |
---|
| 658 | */ |
---|
| 659 | unsigned int value = v * 2; |
---|
| 660 | |
---|
| 661 | if (!GetState(&setCmd)) { |
---|
| 662 | debugError("Cmd failed\n"); |
---|
| 663 | return false; |
---|
| 664 | } |
---|
| 665 | |
---|
| 666 | setCmd.m_playmap[idx] = value; |
---|
| 667 | |
---|
| 668 | setCmd.setType(eCT_Set); |
---|
| 669 | if (!m_ParentDevice.doEfcOverAVC(setCmd)) { |
---|
| 670 | debugError("Cmd failed\n"); |
---|
| 671 | return false; |
---|
| 672 | } |
---|
| 673 | |
---|
| 674 | debugOutput(DEBUG_LEVEL_VERBOSE, "setValue: result=%d:%d\n", |
---|
| 675 | idx, |
---|
| 676 | setCmd.m_playmap[idx]); |
---|
| 677 | |
---|
| 678 | return true; |
---|
| 679 | } |
---|
| 680 | |
---|
| 681 | int PlaybackRoutingControl::getValue(int idx) |
---|
| 682 | { |
---|
| 683 | EfcIsocMapIOConfigCmd getCmd; |
---|
| 684 | GetState(&getCmd); |
---|
| 685 | |
---|
| 686 | debugOutput(DEBUG_LEVEL_VERBOSE, "getValue: result=[%d][%d][%d]\n", |
---|
| 687 | getCmd.m_playmap[0], |
---|
| 688 | getCmd.m_playmap[1], |
---|
| 689 | getCmd.m_playmap[2]); |
---|
| 690 | |
---|
| 691 | return getCmd.m_playmap[idx] / 2; |
---|
| 692 | } |
---|
| 693 | |
---|