mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	* start ledclone * led cloning: clone scan areas from original led main: show exceptions, better exit * tune json schema for new option. somwe cleanup * fix warnings and bug for framebuffer selection. thx to clang brought by new osx buikld on travis * make ledclone feature work flawlessly for effects too. Effect sees the ledstring without cloned leds. cloned leds will be inserted just before sending to leddevice additional: remove warnings and fix code style * fix warning
		
			
				
	
	
		
			35 lines
		
	
	
		
			745 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			745 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| 
 | |
| // STL includes
 | |
| #include <cstring>
 | |
| #include <cstdio>
 | |
| #include <iostream>
 | |
| 
 | |
| // Linux includes
 | |
| #include <fcntl.h>
 | |
| #include <sys/ioctl.h>
 | |
| 
 | |
| // hyperion local includes
 | |
| #include "LedDeviceUdpRaw.h"
 | |
| 
 | |
| LedDeviceUdpRaw::LedDeviceUdpRaw(const std::string& outputDevice, const unsigned latchTime) :
 | |
| 	LedUdpDevice(outputDevice, latchTime),
 | |
| 	mLedCount(0)
 | |
| {
 | |
| 	// empty
 | |
| }
 | |
| 
 | |
| int LedDeviceUdpRaw::write(const std::vector<ColorRgb> &ledValues)
 | |
| {
 | |
| 	mLedCount = ledValues.size();
 | |
| 
 | |
| 	const unsigned dataLen = ledValues.size() * sizeof(ColorRgb);
 | |
| 	const uint8_t * dataPtr = reinterpret_cast<const uint8_t *>(ledValues.data());
 | |
| 
 | |
| 	return writeBytes(dataLen, dataPtr);
 | |
| }
 | |
| 
 | |
| int LedDeviceUdpRaw::switchOff()
 | |
| {
 | |
| 	return write(std::vector<ColorRgb>(mLedCount, ColorRgb{0,0,0}));
 | |
| }
 |