| 385 | } |
---|
| 386 | |
---|
| 387 | bool |
---|
| 388 | AvDevice::setFeatureFBLRBalanceCurrent(int id, int channel, int v) { |
---|
| 389 | |
---|
| 390 | FunctionBlockCmd fbCmd( get1394Service(), |
---|
| 391 | FunctionBlockCmd::eFBT_Feature, |
---|
| 392 | id, |
---|
| 393 | FunctionBlockCmd::eCA_Current ); |
---|
| 394 | fbCmd.setNodeId( getNodeId() ); |
---|
| 395 | fbCmd.setSubunitId( 0x00 ); |
---|
| 396 | fbCmd.setCommandType( AVCCommand::eCT_Control ); |
---|
| 397 | fbCmd.m_pFBFeature->m_audioChannelNumber = channel; |
---|
| 398 | fbCmd.m_pFBFeature->m_controlSelector = FunctionBlockFeature::eCSE_Feature_LRBalance; |
---|
| 399 | AVC::FunctionBlockFeatureLRBalance bl; |
---|
| 400 | fbCmd.m_pFBFeature->m_pLRBalance = bl.clone(); |
---|
| 401 | fbCmd.m_pFBFeature->m_pLRBalance->m_lrBalance = v; |
---|
| 402 | fbCmd.setVerboseLevel( getDebugLevel() ); |
---|
| 403 | |
---|
| 404 | if ( !fbCmd.fire() ) { |
---|
| 405 | debugError( "cmd failed\n" ); |
---|
| 406 | return false; |
---|
| 407 | } |
---|
| 408 | |
---|
| 409 | // if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { |
---|
| 410 | // Util::Cmd::CoutSerializer se; |
---|
| 411 | // fbCmd.serialize( se ); |
---|
| 412 | // } |
---|
| 413 | |
---|
| 414 | if((fbCmd.getResponse() != AVCCommand::eR_Accepted)) { |
---|
| 415 | debugWarning("fbCmd.getResponse() != AVCCommand::eR_Accepted\n"); |
---|
| 416 | } |
---|
| 417 | |
---|
| 418 | return (fbCmd.getResponse() == AVCCommand::eR_Accepted); |
---|
| 419 | } |
---|
| 420 | |
---|
| 421 | int |
---|
| 422 | AvDevice::getFeatureFBLRBalanceValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute) |
---|
| 423 | { |
---|
| 424 | FunctionBlockCmd fbCmd( get1394Service(), |
---|
| 425 | FunctionBlockCmd::eFBT_Feature, |
---|
| 426 | id, |
---|
| 427 | controlAttribute); |
---|
| 428 | fbCmd.setNodeId( getNodeId() ); |
---|
| 429 | fbCmd.setSubunitId( 0x00 ); |
---|
| 430 | fbCmd.setCommandType( AVCCommand::eCT_Status ); |
---|
| 431 | fbCmd.m_pFBFeature->m_audioChannelNumber = channel; |
---|
| 432 | fbCmd.m_pFBFeature->m_controlSelector = FunctionBlockFeature::eCSE_Feature_LRBalance; |
---|
| 433 | AVC::FunctionBlockFeatureLRBalance bl; |
---|
| 434 | fbCmd.m_pFBFeature->m_pLRBalance = bl.clone(); |
---|
| 435 | fbCmd.m_pFBFeature->m_pLRBalance->m_lrBalance = 0; |
---|
| 436 | fbCmd.setVerboseLevel( getDebugLevel() ); |
---|
| 437 | |
---|
| 438 | if ( !fbCmd.fire() ) { |
---|
| 439 | debugError( "cmd failed\n" ); |
---|
| 440 | return 0; |
---|
| 441 | } |
---|
| 442 | |
---|
| 443 | // if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { |
---|
| 444 | // Util::Cmd::CoutSerializer se; |
---|
| 445 | // fbCmd.serialize( se ); |
---|
| 446 | // } |
---|
| 447 | |
---|
| 448 | if((fbCmd.getResponse() != AVCCommand::eR_Implemented)) { |
---|
| 449 | debugWarning("fbCmd.getResponse() != AVCCommand::eR_Implemented\n"); |
---|
| 450 | } |
---|
| 451 | |
---|
| 452 | int16_t balance=(int16_t)(fbCmd.m_pFBFeature->m_pLRBalance->m_lrBalance); |
---|
| 453 | |
---|
| 454 | return balance; |
---|
| 455 | } |
---|
| 456 | |
---|
| 457 | int |
---|
| 458 | AvDevice::getFeatureFBLRBalanceMinimum(int id, int channel) |
---|
| 459 | { |
---|
| 460 | return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | int |
---|
| 464 | AvDevice::getFeatureFBLRBalanceMaximum(int id, int channel) |
---|
| 465 | { |
---|
| 466 | return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); |
---|
| 467 | } |
---|
| 468 | |
---|
| 469 | int |
---|
| 470 | AvDevice::getFeatureFBLRBalanceCurrent(int id, int channel) |
---|
| 471 | { |
---|
| 472 | return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Current); |
---|