mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Leddevices source tree refactoring (#461)
* rework structure of leddevice source tree * fix data type vor v4l sig detection value in webui * automate leddevicefactory.cpp
This commit is contained in:
27
libsrc/leddevice/dev_hid/LedDeviceRawHID.cpp
Normal file
27
libsrc/leddevice/dev_hid/LedDeviceRawHID.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "LedDeviceRawHID.h"
|
||||
|
||||
// Use feature report HID device
|
||||
LedDeviceRawHID::LedDeviceRawHID(const QJsonObject &deviceConfig)
|
||||
: ProviderHID()
|
||||
{
|
||||
ProviderHID::init(deviceConfig);
|
||||
_useFeature = true;
|
||||
_ledBuffer.resize(_ledRGBCount);
|
||||
}
|
||||
|
||||
LedDevice* LedDeviceRawHID::construct(const QJsonObject &deviceConfig)
|
||||
{
|
||||
return new LedDeviceRawHID(deviceConfig);
|
||||
}
|
||||
|
||||
int LedDeviceRawHID::write(const std::vector<ColorRgb> & ledValues)
|
||||
{
|
||||
// write data
|
||||
memcpy(_ledBuffer.data(), ledValues.data(), _ledRGBCount);
|
||||
return writeBytes(_ledBuffer.size(), _ledBuffer.data());
|
||||
}
|
||||
|
||||
void LedDeviceRawHID::rewriteLeds()
|
||||
{
|
||||
writeBytes(_ledBuffer.size(), _ledBuffer.data());
|
||||
}
|
Reference in New Issue
Block a user