58 | | printf( "cmd failed\n" ); |
---|
| 62 | debugError( "cmd failed\n" ); |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | if ( bVerbose ) { |
---|
| 66 | CoutSerializer se; |
---|
| 67 | fbCmd.serialize( se ); |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | debugOutput(DEBUG_LEVEL_NORMAL, "Requesting mixer level state...\n"); |
---|
| 71 | |
---|
| 72 | fbCmd.m_pFBProcessing->m_fbInputPlugNumber = 0x00; |
---|
| 73 | fbCmd.m_pFBProcessing->m_inputAudioChannelNumber = 0x00; |
---|
| 74 | fbCmd.m_pFBProcessing->m_outputAudioChannelNumber = 0x00; |
---|
| 75 | fbCmd.m_pFBProcessing->m_pEnhancedMixer->m_statusSelector |
---|
| 76 | = FunctionBlockProcessingEnhancedMixer::eSS_Level; |
---|
| 77 | |
---|
| 78 | if ( !fbCmd.fire() ) { |
---|
| 79 | debugError( "cmd failed\n" ); |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | if ( bVerbose ) { |
---|
| 83 | CoutSerializer se; |
---|
| 84 | fbCmd.serialize( se ); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | return true; |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | bool |
---|
| 91 | doApp2( Ieee1394Service& ieee1394service, int node_id, int fb_id ) |
---|
| 92 | { |
---|
| 93 | FunctionBlockCmd fbCmd( ieee1394service, |
---|
| 94 | FunctionBlockCmd::eFBT_Selector, |
---|
| 95 | fb_id, |
---|
| 96 | FunctionBlockCmd::eCA_Current ); |
---|
| 97 | fbCmd.setNodeId( node_id ); |
---|
| 98 | fbCmd.setSubunitId( 0x00 ); |
---|
| 99 | fbCmd.setCommandType( AVCCommand::eCT_Status ); |
---|
| 100 | fbCmd.m_pFBSelector->m_inputFbPlugNumber=0; |
---|
| 101 | |
---|
| 102 | debugOutput(DEBUG_LEVEL_NORMAL, "Requesting selector state...\n"); |
---|
| 103 | |
---|
| 104 | fbCmd.setVerbose( bVerbose ); |
---|
| 105 | if (bVerbose) { |
---|
| 106 | ieee1394service.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | if ( !fbCmd.fire() ) { |
---|
| 110 | debugError( "cmd failed\n" ); |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | if ( bVerbose ) { |
---|
| 114 | CoutSerializer se; |
---|
| 115 | fbCmd.serialize( se ); |
---|
| 116 | } |
---|
| 117 | |
---|
| 118 | return true; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | bool |
---|
| 122 | doApp3( Ieee1394Service& ieee1394service, int node_id, int fb_id , int val ) |
---|
| 123 | { |
---|
| 124 | FunctionBlockCmd fbCmd( ieee1394service, |
---|
| 125 | FunctionBlockCmd::eFBT_Selector, |
---|
| 126 | fb_id, |
---|
| 127 | FunctionBlockCmd::eCA_Current ); |
---|
| 128 | fbCmd.setNodeId( node_id ); |
---|
| 129 | fbCmd.setSubunitId( 0x00 ); |
---|
| 130 | fbCmd.setCommandType( AVCCommand::eCT_Control ); |
---|
| 131 | fbCmd.m_pFBSelector->m_inputFbPlugNumber=val; |
---|
| 132 | |
---|
| 133 | debugOutput(DEBUG_LEVEL_NORMAL, "Setting selector state to %d...\n", val); |
---|
| 134 | |
---|
| 135 | fbCmd.setVerbose( bVerbose ); |
---|
| 136 | if (bVerbose) { |
---|
| 137 | ieee1394service.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); |
---|
| 138 | } |
---|
| 139 | |
---|
| 140 | if ( !fbCmd.fire() ) { |
---|
| 141 | debugError( "cmd failed\n" ); |
---|
| 181 | doApp2( ieee1394service, node_id, fb_id ); |
---|
| 182 | doApp3( ieee1394service, node_id, fb_id , 0 ); |
---|
| 183 | sleep(1); |
---|
| 184 | doApp3( ieee1394service, node_id, fb_id , 1 ); |
---|
| 185 | sleep(1); |
---|
| 186 | doApp3( ieee1394service, node_id, fb_id , 0 ); |
---|