| 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" ); |
---|
| 142 | } |
---|
| 143 | |
---|
| 144 | if ( bVerbose ) { |
---|
| 145 | CoutSerializer se; |
---|
| 146 | fbCmd.serialize( se ); |
---|
| 147 | } |
---|
| 148 | |
---|
| 149 | return true; |
---|
| 150 | } |
---|
| 151 | |
---|
| 152 | bool |
---|
| 153 | volumeGet( Ieee1394Service& ieee1394service, int node_id, int fb_id, int channel ) |
---|
| 154 | { |
---|
| 155 | FunctionBlockCmd fbCmd( ieee1394service, |
---|
| 156 | FunctionBlockCmd::eFBT_Feature, |
---|
| 157 | fb_id, |
---|
| 158 | FunctionBlockCmd::eCA_Current ); |
---|
| 159 | fbCmd.setNodeId( node_id ); |
---|
| 160 | fbCmd.setSubunitId( 0x00 ); |
---|
| 161 | fbCmd.setCommandType( AVCCommand::eCT_Status ); |
---|
| 162 | fbCmd.m_pFBFeature->m_audioChannelNumber=channel; |
---|
| 163 | fbCmd.m_pFBFeature->m_controlSelector=FunctionBlockFeature::eCSE_Feature_Volume; |
---|
| 164 | fbCmd.m_pFBFeature->m_pVolume->m_volume=0; |
---|
| 165 | |
---|
| 166 | debugOutput(DEBUG_LEVEL_NORMAL, "Requesting volume feature block state...\n"); |
---|
| 167 | |
---|
| 168 | fbCmd.setVerbose( bVerbose ); |
---|
| 169 | if (bVerbose) { |
---|
| 170 | ieee1394service.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); |
---|
| 171 | } |
---|
| 172 | |
---|
| 173 | if ( !fbCmd.fire() ) { |
---|
| 174 | debugError( "cmd failed\n" ); |
---|
| 175 | } |
---|
| 176 | |
---|
| 177 | if ( bVerbose ) { |
---|
| 178 | CoutSerializer se; |
---|
| 179 | fbCmd.serialize( se ); |
---|
| 180 | } |
---|
| 181 | |
---|
| 182 | return true; |
---|
| 183 | } |
---|
| 184 | |
---|
| 185 | bool |
---|
| 186 | volumeSet( Ieee1394Service& ieee1394service, int node_id, int fb_id, int channel, int value ) |
---|
| 187 | { |
---|
| 188 | FunctionBlockCmd fbCmd( ieee1394service, |
---|
| 189 | FunctionBlockCmd::eFBT_Feature, |
---|
| 190 | fb_id, |
---|
| 191 | FunctionBlockCmd::eCA_Current ); |
---|
| 192 | fbCmd.setNodeId( node_id ); |
---|
| 193 | fbCmd.setSubunitId( 0x00 ); |
---|
| 194 | fbCmd.setCommandType( AVCCommand::eCT_Control ); |
---|
| 195 | fbCmd.m_pFBFeature->m_audioChannelNumber=channel; |
---|
| 196 | fbCmd.m_pFBFeature->m_controlSelector=FunctionBlockFeature::eCSE_Feature_Volume; |
---|
| 197 | fbCmd.m_pFBFeature->m_pVolume->m_volume=value; |
---|
| 198 | |
---|
| 199 | debugOutput(DEBUG_LEVEL_NORMAL, "Setting volume feature block channel %d state to %d...\n", channel, value); |
---|
168 | | int fb_id = strtol( argv[3], &tail, 0 ); |
---|
169 | | |
---|
| 234 | int cmd = strtol( argv[3], &tail, 0 ); |
---|
| 235 | int fb_id = strtol( argv[4], &tail, 0 ); |
---|
| 236 | |
---|
| 237 | int value1=-1; |
---|
| 238 | int value2=-1; |
---|
| 239 | |
---|
| 240 | if (argc>=6) |
---|
| 241 | value1 = strtol(argv[5], &tail, 0 ); |
---|
| 242 | |
---|
| 243 | if (argc>=7) |
---|
| 244 | value2 = strtol(argv[6], &tail, 0 ); |
---|
| 245 | |
---|
180 | | doApp( ieee1394service, node_id, fb_id ); |
---|
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 ); |
---|
| 256 | switch(cmd) { |
---|
| 257 | case 0: |
---|
| 258 | doApp( ieee1394service, node_id, fb_id ); |
---|
| 259 | break; |
---|
| 260 | case 1: |
---|
| 261 | selectorGet( ieee1394service, node_id, fb_id ); |
---|
| 262 | break; |
---|
| 263 | case 2: |
---|
| 264 | selectorSet( ieee1394service, node_id, fb_id , value1 ); |
---|
| 265 | break; |
---|
| 266 | case 3: |
---|
| 267 | volumeGet( ieee1394service, node_id, fb_id, value1); |
---|
| 268 | break; |
---|
| 269 | case 4: |
---|
| 270 | volumeSet( ieee1394service, node_id, fb_id, value1, value2); |
---|
| 271 | break; |
---|
| 272 | } |
---|