Changeset 1063
- Timestamp:
- 04/28/08 15:26:08 (15 years ago)
- Files:
-
- trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp (modified) (3 diffs)
- trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.h (modified) (2 diffs)
- trunk/libffado/src/dice/dice_avdevice.cpp (modified) (2 diffs)
- trunk/libffado/src/dice/dice_avdevice.h (modified) (2 diffs)
- trunk/libffado/src/ffadodevice.cpp (modified) (3 diffs)
- trunk/libffado/src/ffadodevice.h (modified) (2 diffs)
- trunk/libffado/src/libcontrol/Nickname.cpp (added)
- trunk/libffado/src/libcontrol/Nickname.h (added)
- trunk/libffado/src/SConscript (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp
r1047 r1063 37 37 , m_MixerContainer( NULL ) 38 38 , m_ControlContainer( NULL ) 39 , m_deviceNameControl( NULL ) 39 40 { 40 41 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Focusrite::SaffireProDevice (NodeID %d)\n", … … 256 257 "EnableSPDIF1", "Enable S/PDIF 1", "Enable/disable S/PDIF channel")); 257 258 258 result &= m_ControlContainer->addElement(259 new SaffireProDeviceNameControl(*this,260 "DeviceName", "Flash Device Name", "Device name stored in flash memory"));259 m_deviceNameControl = new SaffireProDeviceNameControl(*this, 260 "DeviceName", "Flash Device Name", "Device name stored in flash memory"); 261 result &= m_ControlContainer->addElement(m_deviceNameControl); 261 262 262 263 if (!result) { … … 314 315 315 316 return true; 317 } 318 319 bool 320 SaffireProDevice::setNickname( std::string name) 321 { 322 if(m_deviceNameControl) { 323 return m_deviceNameControl->setValue(name); 324 } else return false; 325 } 326 327 std::string 328 SaffireProDevice::getNickname() 329 { 330 if(m_deviceNameControl) { 331 return m_deviceNameControl->getValue(); 332 } else return "Unknown"; 316 333 } 317 334 trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.h
r957 r1063 337 337 virtual bool destroyMixer(); 338 338 339 virtual std::string getNickname(); 340 virtual bool setNickname(std::string name); 339 341 protected: 340 342 void rebootDevice(); … … 369 371 Control::Container *m_MixerContainer; 370 372 Control::Container *m_ControlContainer; 373 SaffireProDeviceNameControl *m_deviceNameControl; 371 374 }; 372 375 trunk/libffado/src/dice/dice_avdevice.cpp
r1047 r1063 500 500 } 501 501 502 bool 503 DiceAvDevice::setNickname( std::string name) 504 { 505 return setDeviceNickName(name); 506 } 507 508 std::string 509 DiceAvDevice::getNickname() 510 { 511 return getDeviceNickName(); 512 } 513 502 514 void 503 515 DiceAvDevice::showDevice() … … 1300 1312 } 1301 1313 1314 bool 1315 DiceAvDevice::setDeviceNickName(std::string name) { 1316 char namestring[DICE_NICK_NAME_SIZE+1]; 1317 strncpy(namestring, name.c_str(), DICE_NICK_NAME_SIZE); 1318 1319 if (!writeGlobalRegBlock(DICE_REGISTER_GLOBAL_NICK_NAME, 1320 (fb_quadlet_t *)namestring, DICE_NICK_NAME_SIZE)) { 1321 debugError("Could not write nickname string \n"); 1322 return false; 1323 } 1324 return true; 1325 } 1326 1302 1327 DiceAvDevice::diceNameVector 1303 1328 DiceAvDevice::splitNameString(std::string in) { trunk/libffado/src/dice/dice_avdevice.h
r864 r1063 89 89 virtual bool disableStreaming(); 90 90 91 virtual std::string getNickname(); 92 virtual bool setNickname(std::string name); 93 91 94 protected: 92 95 struct VendorModelEntry *m_model; … … 133 136 diceNameVector getClockSourceNameString(); 134 137 std::string getDeviceNickName(); 138 bool setDeviceNickName(std::string name); 135 139 136 140 enum eClockSourceType clockIdToType(unsigned int id); trunk/libffado/src/ffadodevice.cpp
r967 r1063 30 30 #include "libcontrol/Element.h" 31 31 #include "libcontrol/ClockSelect.h" 32 #include "libcontrol/Nickname.h" 32 33 33 34 #include <iostream> … … 63 64 if(!m_genericContainer->addElement(new Control::ClockSelect(*this))) { 64 65 debugWarning("failed to add clock source control to container\n"); 66 } 67 // add a generic control for the nickname 68 if(!m_genericContainer->addElement(new Control::Nickname(*this))) { 69 debugWarning("failed to add Nickname control to container\n"); 65 70 } 66 71 } … … 152 157 m_DeviceMutex.Unlock(); 153 158 return retval; 159 } 160 161 bool 162 FFADODevice::setNickname( std::string name) 163 { 164 return false; 165 } 166 167 std::string 168 FFADODevice::getNickname() 169 { 170 return "Unknown"; 154 171 } 155 172 trunk/libffado/src/ffadodevice.h
r967 r1063 419 419 420 420 /** 421 * @brief return the nick name of this device 422 * 423 * @return string containing the name 424 */ 425 virtual std::string getNickname(); 426 427 /** 428 * @brief set the nick name of this device 429 * @param name new nickname 430 * @return true if successful 431 */ 432 virtual bool setNickname(std::string name); 433 434 /** 421 435 * @brief handle a bus reset 422 436 * … … 425 439 * 426 440 */ 441 // FIXME: not virtual? 427 442 void handleBusReset(); 428 443 trunk/libffado/src/SConscript
r1052 r1063 87 87 libcontrol/MatrixMixer.cpp \ 88 88 libcontrol/ClockSelect.cpp \ 89 libcontrol/Nickname.cpp \ 89 90 ') 90 91