diff --git a/include/plugin_definitions.h b/include/plugin_definitions.h index 104ac17..428e4c2 100644 --- a/include/plugin_definitions.h +++ b/include/plugin_definitions.h @@ -20,9 +20,7 @@ enum PluginItemType { }; enum PluginMenuType { - PLUGIN_MENU_TYPE_GLOBAL = 0, - PLUGIN_MENU_TYPE_CHANNEL, - PLUGIN_MENU_TYPE_CLIENT + PLUGIN_MENU_TYPE_GLOBAL = 0 }; #define PLUGIN_MENU_BUFSZ 128 diff --git a/src/ledhandler.cpp b/src/ledhandler.cpp index cadc4c2..e7f1639 100644 --- a/src/ledhandler.cpp +++ b/src/ledhandler.cpp @@ -39,10 +39,10 @@ void LEDHandler::sendColor(int R, int G, int B, int W, int t) msg.append(3); msg.append((uint)t); for (int n = 0; n < cLEDNUM; n++) { - msg.append((int)R * brightness/100); - msg.append((int)G * brightness/100); - msg.append((int)B * brightness/100); - msg.append((int)W * brightness/100); + msg.append((int)R * mBrightness/100); + msg.append((int)G * mBrightness/100); + msg.append((int)B * mBrightness/100); + msg.append((int)W * mBrightness/100); } mSock->writeDatagram(msg, QHostAddress(cURL), cPORT); diff --git a/src/ledhandler.h b/src/ledhandler.h index 5b47139..1e46fff 100644 --- a/src/ledhandler.h +++ b/src/ledhandler.h @@ -10,7 +10,7 @@ class LEDHandler : public QObject public: QString cURL = "10.0.0.222"; int cPORT = 21324; - int cLEDNUM = 26; + int cLEDNUM = 90; LEDHandler(QUdpSocket* sock, TS3Functions ts3Functions); @@ -27,7 +27,7 @@ public slots: private: QUdpSocket* mSock; TS3Functions mTs3Functions; - int brightness = 80; + int mBrightness = 80; void sendColor(int R, int G, int B, int W, int t); }; diff --git a/src/plugin.cpp b/src/plugin.cpp index 3570ae7..8a9458c 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -522,13 +522,7 @@ static struct PluginMenuItem* createMenuItem(enum PluginMenuType type, int id, c * These IDs are freely choosable by the plugin author. It's not really needed to use an enum, it just looks prettier. */ enum { - MENU_ID_CLIENT_1 = 1, - MENU_ID_CLIENT_2, - MENU_ID_CHANNEL_1, - MENU_ID_CHANNEL_2, - MENU_ID_CHANNEL_3, - MENU_ID_GLOBAL_1, - MENU_ID_GLOBAL_2 + MENU_ID_SETTINGS }; /* @@ -556,13 +550,7 @@ void ts3plugin_initMenus(struct PluginMenuItem*** menuItems, char** menuIcon) { */ BEGIN_CREATE_MENUS(0); /* IMPORTANT: Number of menu items must be correct! */ - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CLIENT, MENU_ID_CLIENT_1, "Client item 1", "1.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CLIENT, MENU_ID_CLIENT_2, "Client item 2", "2.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_1, "Channel item 1", "1.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_2, "Channel item 2", "2.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_3, "Channel item 3", "3.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_GLOBAL, MENU_ID_GLOBAL_1, "Global item 1", "1.png"); - //CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_GLOBAL, MENU_ID_GLOBAL_2, "Global item 2", "2.png"); +// CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_GLOBAL, MENU_ID_SETTINGS, "LED Settings", "1.png"); END_CREATE_MENUS; /* Includes an assert checking if the number of menu items matched */ /* @@ -822,47 +810,13 @@ void ts3plugin_onMenuItemEvent(uint64 serverConnectionHandlerID, enum PluginMenu case PLUGIN_MENU_TYPE_GLOBAL: /* Global menu item was triggered. selectedItemID is unused and set to zero. */ switch(menuItemID) { - case MENU_ID_GLOBAL_1: - /* Menu global 1 was triggered */ - break; - case MENU_ID_GLOBAL_2: - /* Menu global 2 was triggered */ + case MENU_ID_SETTINGS: + // TODO: show dialog break; default: break; } break; - case PLUGIN_MENU_TYPE_CHANNEL: - /* Channel contextmenu item was triggered. selectedItemID is the channelID of the selected channel */ - switch(menuItemID) { - case MENU_ID_CHANNEL_1: - /* Menu channel 1 was triggered */ - break; - case MENU_ID_CHANNEL_2: - /* Menu channel 2 was triggered */ - break; - case MENU_ID_CHANNEL_3: - /* Menu channel 3 was triggered */ - break; - default: - break; - } - break; - case PLUGIN_MENU_TYPE_CLIENT: - /* Client contextmenu item was triggered. selectedItemID is the clientID of the selected client */ - switch(menuItemID) { - case MENU_ID_CLIENT_1: - /* Menu client 1 was triggered */ - break; - case MENU_ID_CLIENT_2: - /* Menu client 2 was triggered */ - break; - default: - break; - } - break; - default: - break; } }