Changeset 830
- Timestamp:
- 01/10/08 13:11:59 (16 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/api-cleanup/src/bebob/focusrite/focusrite_saffirepro.cpp
r783 r830 231 231 "UseHighVoltageRail", "Use High Supply", "Prefer the high voltage power supply rail")); 232 232 233 result &= m_ControlContainer->addElement( 234 new SaffireProMultiControl(*this, SaffireProMultiControl::eTCT_ExitStandalone, 235 "ExitStandalone", "Exit Standalone mode", "Try to leave standalonbe mode")); 236 237 result &= m_ControlContainer->addElement( 238 new SaffireProMultiControl(*this, SaffireProMultiControl::eTCT_PllLockRange, 239 "PllLockRange", "PLL Lock Range", "Get/Set PLL Lock range")); 240 233 241 if (!result) { 234 242 debugWarning("One or more device control elements could not be created."); … … 484 492 485 493 void 494 SaffireProDevice::exitStandalone() { 495 debugOutput( DEBUG_LEVEL_VERBOSE, "exit standalone mode...\n" ); 496 if ( !setSpecificValue(FR_SAFFIREPRO_CMD_ID_EXIT_STANDALONE, 497 FR_SAFFIREPRO_CMD_EXIT_STANDALONE_CODE ) ) { 498 debugError( "setSpecificValue failed\n" ); 499 } 500 } 501 502 void 486 503 SaffireProDevice::flashLed() { 487 504 int ledFlashDuration=2; … … 570 587 } 571 588 589 void 590 SaffireProDevice::setPllLockRange(unsigned int i) { 591 uint32_t reg=i; 592 debugOutput( DEBUG_LEVEL_VERBOSE, "set PLL lock range: %d ...\n", i ); 593 594 if ( !setSpecificValue(FR_SAFFIREPRO_CMD_ID_PLL_LOCK_RANGE, 595 reg ) ) { 596 debugError( "setSpecificValue failed\n" ); 597 } 598 } 599 600 unsigned int 601 SaffireProDevice::getPllLockRange() { 602 uint32_t retval; 603 if ( !getSpecificValue(FR_SAFFIREPRO_CMD_ID_PLL_LOCK_RANGE, &retval ) ) { 604 debugError( "getSpecificValue failed\n" ); 605 return false; 606 } 607 608 debugOutput( DEBUG_LEVEL_VERBOSE, 609 "PLL lock range: %d\n", retval ); 610 return retval; 611 } 612 572 613 // swiss army knife control element 573 SaffireProMultiControl::SaffireProMultiControl(SaffireProDevice& parent, enum e TriggerControlType t)614 SaffireProMultiControl::SaffireProMultiControl(SaffireProDevice& parent, enum eMultiControlType t) 574 615 : Control::Discrete() 575 616 , m_Parent(parent) 576 617 , m_type ( t ) 577 618 {} 578 SaffireProMultiControl::SaffireProMultiControl(SaffireProDevice& parent, enum e TriggerControlType t,619 SaffireProMultiControl::SaffireProMultiControl(SaffireProDevice& parent, enum eMultiControlType t, 579 620 std::string name, std::string label, std::string descr) 580 621 : Control::Discrete() … … 594 635 case eTCT_FlashLed: m_Parent.flashLed(); return true; 595 636 case eTCT_UseHighVoltageRail: m_Parent.useHighVoltageRail(v); return true; 637 case eTCT_ExitStandalone: m_Parent.exitStandalone(); return true; 638 case eTCT_PllLockRange: m_Parent.setPllLockRange(v); return true; 596 639 } 597 640 return false; … … 605 648 case eTCT_FlashLed: return 0; 606 649 case eTCT_UseHighVoltageRail: return m_Parent.usingHighVoltageRail(); 650 case eTCT_ExitStandalone: return 0; 651 case eTCT_PllLockRange: return m_Parent.getPllLockRange(); 607 652 } 608 653 return -1; branches/api-cleanup/src/bebob/focusrite/focusrite_saffirepro.h
r750 r830 254 254 { 255 255 public: 256 enum e TriggerControlType {256 enum eMultiControlType { 257 257 eTCT_Reboot, 258 258 eTCT_FlashLed, 259 259 eTCT_UseHighVoltageRail, 260 eTCT_ExitStandalone, 261 eTCT_PllLockRange, 260 262 }; 261 263 262 264 public: 263 SaffireProMultiControl(SaffireProDevice& parent, enum e TriggerControlType);264 SaffireProMultiControl(SaffireProDevice& parent, enum e TriggerControlType,265 SaffireProMultiControl(SaffireProDevice& parent, enum eMultiControlType); 266 SaffireProMultiControl(SaffireProDevice& parent, enum eMultiControlType, 265 267 std::string name, std::string label, std::string descr); 266 268 … … 270 272 private: 271 273 SaffireProDevice& m_Parent; 272 enum e TriggerControlType m_type;274 enum eMultiControlType m_type; 273 275 }; 274 276 … … 320 322 bool isExtClockLocked(); 321 323 uint32_t getCount32(); 324 void exitStandalone(); 322 325 323 326 void useHighVoltageRail(bool useIt); 324 327 bool usingHighVoltageRail(); 328 unsigned int getPllLockRange(); 329 void setPllLockRange(unsigned int); 330 325 331 private: 326 332 virtual bool setSamplingFrequencyDo( uint32_t );