diff --git a/src/ledhandler.cpp b/src/ledhandler.cpp index b6a3610..6e79dee 100644 --- a/src/ledhandler.cpp +++ b/src/ledhandler.cpp @@ -15,7 +15,7 @@ LEDHandler::LEDHandler(QUdpSocket* sock, TS3Functions ts3Functions) void LEDHandler::talkingStarted() { printf("started\n"); - sendColor(0, 0, 125, 0, 255); + sendColor(0, 0, 255, 0, 255); } void LEDHandler::talkingEnded() @@ -33,15 +33,14 @@ void LEDHandler::poked() void LEDHandler::sendColor(int R, int G, int B, int W, int t) { QByteArray msg; - msg.append(2); + msg.append(3); msg.append(t); - msg.append(R); - msg.append(G); - msg.append(B); - msg.append(W); - - printf(msg.toStdString().c_str()); - printf("\n"); + for (int n = 0; n < cLEDNUM; n++) { + msg.append(R); + msg.append(G); + msg.append(B); + msg.append(W); + } mSock->writeDatagram(msg, QHostAddress(cURL), cPORT); } @@ -62,8 +61,10 @@ void LEDHandler::hostFound() { mTs3Functions.logMessage("HOST FOUND", LogLevel_INFO, "Plugin", 0); printf("HOST FOUND\n"); + succesful = true; } + //const char* LED_URL_SAVE = "http://10.0.0.222/win&PS=16&NN"; //const char* LED_URL_ON = "http://10.0.0.222/win&T=1&FX=0&R=0&B=255&G=0&W=0&A=255&NN"; //const char* LED_URL_OFF= "http://10.0.0.222/win&PL=16&NN"; diff --git a/src/ledhandler.h b/src/ledhandler.h index 439755e..63c812e 100644 --- a/src/ledhandler.h +++ b/src/ledhandler.h @@ -10,6 +10,7 @@ class LEDHandler : public QObject public: QString cURL = "10.0.0.222"; int cPORT = 21324; + int cLEDNUM = 26; LEDHandler(QUdpSocket* sock, TS3Functions ts3Functions); @@ -25,6 +26,8 @@ public slots: private: QUdpSocket* mSock; TS3Functions mTs3Functions; + bool succesful = false; + void sendColor(int R, int G, int B, int W, int t); };