diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..19f47b1 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: CalcProgrammer1 +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..748077c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,292 @@ +# swy: some useful references; the MSVC part of the CI script is based on the one from bind9, by Michał Kępień: +# https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/blob/master/cookbooks/preinstalled-software/README.md +# https://gitlab.isc.org/isc-projects/bind9/commit/facc6a051fcac70fbbc61cb92a37be8c3e4db5ec#587d266bb27a4dc3022bbed44dfa19849df3044c_718_731 +# https://www.kittell.net/code/powershell-unix-sed-equivalent-change-text-file/ +# https://powershell.org/forums/topic/how-to-use-ansi-vt100-formatting-in-powershell-ooh-pretty-colors/ + +#-----------------------------------------------------------------------# +# OpenRGB GitLab CI Configuration # +#-----------------------------------------------------------------------# +variables: + GIT_SUBMODULE_STRATEGY: recursive + +.shared_windows_runners: + tags: + - shared-windows + - windows + - windows-1809 + +stages: + - build + +before_script: + - echo "started by ${GITLAB_USER_NAME}" + +#reusable templates +.ccache_init: &ccache_init + before_script: + - apt update + - apt install -y build-essential qtcreator qt5-default libopenal-dev pkgconf wget git + +#-----------------------------------------------------------------------# +# Linux (AppImage) 32-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_32: + <<: *ccache_init + image: i386/ubuntu:bionic + stage: build + script: + - export $(dpkg-architecture) + - ./scripts/build-appimage.sh + + artifacts: + paths: + - Keyboard_Visualizer-i386.AppImage + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Linux (AppImage) 64-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_64: + <<: *ccache_init + image: ubuntu:bionic + stage: build + script: + - export $(dpkg-architecture) + - ./scripts/build-appimage.sh + + artifacts: + paths: + - Keyboard_Visualizer-x86_64.AppImage + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Linux (.deb) 32-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_deb32: + <<: *ccache_init + image: i386/ubuntu:bionic + stage: build + script: + - apt install -y debhelper + - dpkg-architecture -l + - dpkg-buildpackage --target-arch i386 -us -B + - rm -v ../keyboardvisualizer-dbgsym*.ddeb + - mv -v ../keyboardvisualizer*.deb ./ + + artifacts: + paths: + - keyboardvisualizer*.deb + exclude: + - keyboardvisualizer-dbgsym*.deb + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Linux (.deb) 64-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_deb64: + <<: *ccache_init + image: ubuntu:bionic + stage: build + script: + - apt install -y debhelper + - dpkg-architecture -l + - dpkg-buildpackage -us -B + - rm -v ../keyboardvisualizer-dbgsym*.ddeb + - mv -v ../keyboardvisualizer*.deb ./ + + artifacts: + paths: + - keyboardvisualizer*.deb + exclude: + - keyboardvisualizer-dbgsym*.deb + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Windows (32-bit) Build Target # +#-----------------------------------------------------------------------# +build_windows_32: + extends: + - .shared_windows_runners + stage: build + script: + - $esc = "$([char]27)" + - $count = 0 + - function _unix_tmsec_ { [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds } + - function _fold_start_ { param( [string]$TEXT_TAG ) $t=_unix_tmsec_; $global:count += 1; Write-Host -NoNewLine "`r`n`r`nsection_start:${t}:sect_${count}`r${esc}[0K${esc}[33m${TEXT_TAG}${esc}[39m`r`n"; } + - function _fold_final_ { $t=_unix_tmsec_; Write-Host -NoNewLine "`r`n`r`nsection_end:${t}:sect_${count}`r${esc}[0K`r`n" ; } + + + - _fold_start_ 'configuring the msvc environment variables' + - Push-Location "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build" + - '& cmd.exe /C "vcvarsall.bat x86 & set" | Foreach-Object { if ($_ -match "(.*?)=(.*)") { Set-Item -force -path "Env:\$($matches[1])" -value "$($matches[2])" } }' + - Pop-Location + - _fold_final_ + + - _fold_start_ 'downloading precompiled versions of qtbase, qttools (for windeployqt) and jom (for a more parallel nmake)' + - mkdir _qt + - mkdir _qt_download + - Push-Location _qt_download + - curl.exe -LJ -o qt-base.7z 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win32_msvc2019/5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86.7z' + - curl.exe -LJ -o qt-tools.7z 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win32_msvc2019/5.15.0-0-202005150700qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86.7z' + - curl.exe -LJ -o qt-jom.zip 'https://download.qt.io/official_releases/jom/jom.zip' + - _fold_final_ + + - _fold_start_ 'extracting the downloaded qt binaries' + - 7z x qt-base.7z '-o../_qt' -y + - 7z x qt-tools.7z '-o../_qt' -y + - 7z x qt-jom.zip '-o../_qt' -y + - _fold_final_ + + - _fold_start_ 'turn the qt install from enterprise to foss; remove the licensing checks' + - ${qconfig-pri-folder} = '..\_qt\5.15.0\msvc2019\mkspecs\qconfig.pri' + - (Get-Content ${qconfig-pri-folder}).replace('QT_EDITION = Enterprise', 'QT_EDITION = OpenSource') | Set-Content ${qconfig-pri-folder} + - (Get-Content ${qconfig-pri-folder}).replace('QT_LICHECK = licheck.exe', '') | Set-Content ${qconfig-pri-folder} + - Pop-Location + - _fold_final_ + + - _fold_start_ 'run qmake and generate the msvc nmake makefile' + - mkdir _build; cd _build + - ..\_qt\5.15.0\msvc2019\bin\qmake ..\KeyboardVisualizer.pro + - _fold_final_ + + - _fold_start_ 'start the actual build with jom instead of nmake; for speed' + - ..\_qt\jom + - _fold_final_ + + - _fold_start_ 'run windeployqt to automatically copy the needed dll files' + - ..\_qt\5.15.0\msvc2019\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\ + - _fold_final_ + + - _fold_start_ 'compressing the release folder so that we can upload it as artifact' + - mv release 'Keyboard Visualizer Windows 32-bit' + - ${datetime} = Get-Date ([datetime]::UtcNow) -Format "yyyy-MM-ddTHH-mm-ss" + - ${revision} = ((git rev-parse --short HEAD) | Out-String).Trim() + - ${rversion} = (((Get-Content '..\KeyboardVisualizer.pro' | Select-String -Pattern "VERSION =") | Out-String).Trim().Split("="))[1].Trim() + - 7z a -mx9 -r -y "KeyboardVisualizer_${rversion}_32_${revision}_nightly_${datetime}.7z" 'Keyboard Visualizer Windows 32-bit' + - _fold_final_ +# cache: +# key: same-key +# paths: +# - C:\vcpkg\installed\ + artifacts: + paths: + - _build/*.7z + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Windows (64-bit) Build Target # +#-----------------------------------------------------------------------# +build_windows_64: + extends: + - .shared_windows_runners + stage: build + script: + - $esc = "$([char]27)" + - $count = 0 + - function _unix_tmsec_ { [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds } + - function _fold_start_ { param( [string]$TEXT_TAG ) $t=_unix_tmsec_; $global:count += 1; Write-Host -NoNewLine "`r`n`r`nsection_start:${t}:sect_${count}`r${esc}[0K${esc}[33m${TEXT_TAG}${esc}[39m`r`n"; } + - function _fold_final_ { $t=_unix_tmsec_; Write-Host -NoNewLine "`r`n`r`nsection_end:${t}:sect_${count}`r${esc}[0K`r`n" ; } + + + - _fold_start_ 'configuring the msvc environment variables' + - Push-Location "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build" + - '& cmd.exe /C "vcvarsall.bat x64 & set" | Foreach-Object { if ($_ -match "(.*?)=(.*)") { Set-Item -force -path "Env:\$($matches[1])" -value "$($matches[2])" } }' + - Pop-Location + - _fold_final_ + + - _fold_start_ 'downloading precompiled versions of qtbase, qttools (for windeployqt) and jom (for a more parallel nmake)' + - mkdir _qt + - mkdir _qt_download + - Push-Location _qt_download + - curl.exe -LJ -o qt-base.7z 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2019_64/5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z' + - curl.exe -LJ -o qt-tools.7z 'https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2019_64/5.15.0-0-202005150700qttools-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z' + - curl.exe -LJ -o qt-jom.zip 'https://download.qt.io/official_releases/jom/jom.zip' + - _fold_final_ + + - _fold_start_ 'extracting the downloaded qt binaries' + - 7z x qt-base.7z '-o../_qt' -y + - 7z x qt-tools.7z '-o../_qt' -y + - 7z x qt-jom.zip '-o../_qt' -y + - _fold_final_ + + - _fold_start_ 'turn the qt install from enterprise to foss; remove the licensing checks' + - ${qconfig-pri-folder} = '..\_qt\5.15.0\msvc2019_64\mkspecs\qconfig.pri' + - (Get-Content ${qconfig-pri-folder}).replace('QT_EDITION = Enterprise', 'QT_EDITION = OpenSource') | Set-Content ${qconfig-pri-folder} + - (Get-Content ${qconfig-pri-folder}).replace('QT_LICHECK = licheck.exe', '') | Set-Content ${qconfig-pri-folder} + - Pop-Location + - _fold_final_ + + - _fold_start_ 'run qmake and generate the msvc nmake makefile' + - mkdir _build; cd _build + - ..\_qt\5.15.0\msvc2019_64\bin\qmake ..\KeyboardVisualizer.pro + - _fold_final_ + + - _fold_start_ 'start the actual build with jom instead of nmake; for speed' + - ..\_qt\jom + - _fold_final_ + + - _fold_start_ 'run windeployqt to automatically copy the needed dll files' + - ..\_qt\5.15.0\msvc2019_64\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\ + - _fold_final_ + + - _fold_start_ 'compressing the release folder so that we can upload it as artifact' + - mv release 'Keyboard Visualizer Windows 64-bit' + - ${datetime} = Get-Date ([datetime]::UtcNow) -Format "yyyy-MM-ddTHH-mm-ss" + - ${revision} = ((git rev-parse --short HEAD) | Out-String).Trim() + - ${rversion} = (((Get-Content '..\KeyboardVisualizer.pro' | Select-String -Pattern "VERSION =") | Out-String).Trim().Split("="))[1].Trim() + - 7z a -mx9 -r -y "KeyboardVisualizer_${rversion}_64_${revision}_nightly_${datetime}.7z" 'Keyboard Visualizer Windows 64-bit' + - _fold_final_ +# cache: +# key: same-key +# paths: +# - C:\vcpkg\installed\ + artifacts: + paths: + - _build/*.7z + expire_in: 30 days + +#-----------------------------------------------------------------------# +# MacOS Build Target # +#-----------------------------------------------------------------------# +build_macos_arm64: + tags: + - macos + stage: build + script: + - eval $(/opt/homebrew/bin/brew shellenv) + - qmake KeyboardVisualizer.pro + - make -j16 + - macdeployqt KeyboardVisualizer.app -codesign=OpenRGB + + artifacts: + paths: + - KeyboardVisualizer.app + expire_in: 30 days + + rules: + - if: '$CI_PROJECT_PATH == "CalcProgrammer1/KeyboardVisualizer"' + when: on_success + - if: '$BUILD_MACOS =~ /.+/' + when: on_success + +build_macos_intel: + tags: + - macos + stage: build + script: + - eval $(/usr/local/bin/brew shellenv) + - arch -x86_64 /usr/local/bin/qmake KeyboardVisualizer.pro + - arch -x86_64 make -j16 + - arch -x86_64 macdeployqt KeyboardVisualizer.app -codesign=OpenRGB + + artifacts: + paths: + - KeyboardVisualizer.app + expire_in: 30 days + + rules: + - if: '$CI_PROJECT_PATH == "CalcProgrammer1/KeyboardVisualizer"' + when: on_success + - if: '$BUILD_MACOS =~ /.+/' + when: on_success \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index c28402e..108e9dd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "Release"] - path = Release - url = https://github.com/CalcProgrammer1/KeyboardVisualizerVCUI_Release +[submodule "OpenRGB"] + path = OpenRGB + url = https://gitlab.com/CalcProgrammer1/OpenRGB diff --git a/KeyboardVisualizer.pro b/KeyboardVisualizer.pro index 7e2105e..e3f05fa 100644 --- a/KeyboardVisualizer.pro +++ b/KeyboardVisualizer.pro @@ -1,64 +1,165 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2016-12-18T13:03:22 -# -#------------------------------------------------- +#-----------------------------------------------------------------------# +# Keyboard Visualizer 4.x QMake Project # +# # +# Adam Honse (CalcProgrammer1) 5/15/2020 # +#-----------------------------------------------------------------------# -QT += core gui +#-----------------------------------------------------------------------# +# Qt Configuration # +#-----------------------------------------------------------------------# +QT += \ + core \ + gui \ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -TARGET = KeyboardVisualizer -TEMPLATE = app +#-----------------------------------------------------------------------# +# Application Configuration # +#-----------------------------------------------------------------------# +VERSION = 4.01 +TARGET = KeyboardVisualizer +TEMPLATE = app +CONFIG += no_batch -LIBS += -lopenal +#-----------------------------------------------------------------------# +# Automatically generated build information # +#-----------------------------------------------------------------------# +win32:BUILDDATE = $$system(date /t) +unix:BUILDDATE = $$system(date -R) +GIT_COMMIT_ID = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse HEAD) +GIT_COMMIT_DATE = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ show -s --format=%ci HEAD) +GIT_BRANCH = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse --abbrev-ref HEAD) -packagesExist(hidapi-libusb) { - unix:LIBS += -lhidapi-libusb -} else { - packagesExist(hidapi) { - unix:LIBS += -lhidapi - } else { - unix:LIBS += -lhidapi-libusb - } -} +DEFINES += \ + VERSION_STRING=\\"\"\"$$VERSION\\"\"\" \ + BUILDDATE_STRING=\\"\"\"$$BUILDDATE\\"\"\" \ + GIT_COMMIT_ID=\\"\"\"$$GIT_COMMIT_ID\\"\"\" \ + GIT_COMMIT_DATE=\\"\"\"$$GIT_COMMIT_DATE\\"\"\" \ + GIT_BRANCH=\\"\"\"$$GIT_BRANCH\\"\"\" \ + +#-----------------------------------------------------------------------# +# Keyboard Visualizer # +#-----------------------------------------------------------------------# +INCLUDEPATH += \ + KeyboardVisualizerCommon/ \ + KeyboardVisualizerQT/ \ + +HEADERS += \ + KeyboardVisualizerCommon/chuck_fft.h \ + KeyboardVisualizerCommon/hsv.h \ + KeyboardVisualizerCommon/Visualizer.h \ + KeyboardVisualizerCommon/VisualizerDefines.h \ + KeyboardVisualizerQT/KeyboardVisDlg.h \ + +SOURCES += \ + KeyboardVisualizerCommon/hsv.cpp \ + KeyboardVisualizerCommon/Visualizer.cpp \ + KeyboardVisualizerCommon/chuck_fft.c \ + KeyboardVisualizerQT/KeyboardVisDlg.cpp \ + KeyboardVisualizerQT/main.cpp \ -DISTFILES += - -HEADERS += \ - KeyboardVisualizerCommon/chuck_fft.h \ - KeyboardVisualizerCommon/hsv.h \ - KeyboardVisualizerCommon/LEDStrip.h \ - KeyboardVisualizerCommon/net_port.h \ - KeyboardVisualizerCommon/serial_port.h \ - KeyboardVisualizerCommon/Visualizer.h \ - KeyboardVisualizerCommon/VisualizerDefines.h \ - KeyboardVisualizerCommon/CorsairCKBLinux.h \ - KeyboardVisualizerCommon/RazerChromaLinux.h \ - KeyboardVisualizerQT/KeyboardVisDlg.h \ - KeyboardVisualizerCommon/UsbDevice.h \ - KeyboardVisualizerCommon/SteelSeriesGameSense.h \ - KeyboardVisualizerCommon/PoseidonZRGBKeyboard.h \ - KeyboardVisualizerCommon/MSIKeyboard.h - -SOURCES += \ - KeyboardVisualizerCommon/hsv.cpp \ - KeyboardVisualizerCommon/LEDStrip.cpp \ - KeyboardVisualizerCommon/net_port.cpp \ - KeyboardVisualizerCommon/serial_port.cpp \ - KeyboardVisualizerCommon/Visualizer.cpp \ - KeyboardVisualizerCommon/chuck_fft.c \ - KeyboardVisualizerCommon/CorsairCKBLinux.cpp \ - KeyboardVisualizerCommon/RazerChromaLinux.cpp \ - KeyboardVisualizerQT/KeyboardVisDlg.cpp \ - KeyboardVisualizerQT/main.cpp \ - KeyboardVisualizerCommon/UsbDevice.cpp \ - KeyboardVisualizerCommon/SteelSeriesGameSense.cpp \ - KeyboardVisualizerCommon/PoseidonZRGBKeyboard.cpp \ - KeyboardVisualizerCommon/MSIKeyboard.cpp - -RESOURCES += \ +RESOURCES += \ KeyboardVisualizerQT/resources.qrc -FORMS += \ +FORMS += \ KeyboardVisualizerQT/keyboardvisualizer.ui + +DISTFILES += \ + +#-----------------------------------------------------------------------# +# OpenRGB SDK # +#-----------------------------------------------------------------------# +INCLUDEPATH += \ + OpenRGB/ \ + OpenRGB/net_port/ \ + OpenRGB/RGBController/ \ + +HEADERS += \ + OpenRGB/NetworkClient.h \ + OpenRGB/NetworkProtocol.h \ + OpenRGB/net_port/net_port.h \ + OpenRGB/RGBController/RGBController.h \ + OpenRGB/RGBController/RGBController_Network.h \ + +SOURCES += \ + OpenRGB/NetworkClient.cpp \ + OpenRGB/net_port/net_port.cpp \ + OpenRGB/RGBController/RGBController.cpp \ + OpenRGB/RGBController/RGBController_Network.cpp \ + +#-----------------------------------------------------------------------# +# Windows-specific Configuration # +#-----------------------------------------------------------------------# +win32:contains(QMAKE_TARGET.arch, x86_64) { + LIBS += \ + -lws2_32 \ + -lole32 \ +} + +win32:contains(QMAKE_TARGET.arch, x86) { + LIBS += \ + -lws2_32 \ + -lole32 \ +} + +win32:DEFINES -= \ + UNICODE + +win32:DEFINES += \ + _MBCS \ + WIN32 \ + _CRT_SECURE_NO_WARNINGS \ + _WINSOCK_DEPRECATED_NO_WARNINGS \ + WIN32_LEAN_AND_MEAN + +win32:RC_ICONS += \ + KeyboardVisualizerQT/KeyboardVisualizer.ico + +#-------------------------------------------------------------------# +# Windows GitLab CI Configuration # +#-------------------------------------------------------------------# +win32:CONFIG(debug, debug|release) { + win32:DESTDIR = debug +} + +win32:CONFIG(release, debug|release) { + win32:DESTDIR = release +} + +win32:OBJECTS_DIR = _intermediate_$$DESTDIR/.obj +win32:MOC_DIR = _intermediate_$$DESTDIR/.moc +win32:RCC_DIR = _intermediate_$$DESTDIR/.qrc +win32:UI_DIR = _intermediate_$$DESTDIR/.ui + +#-----------------------------------------------------------------------# +# Linux-specific Configuration # +#-----------------------------------------------------------------------# +unix:!macx { + LIBS += -lopenal + + #-------------------------------------------------------------------# + # Set up install paths # + # These install paths are used for AppImage and .deb packaging # + #-------------------------------------------------------------------# + isEmpty(PREFIX) { + PREFIX = /usr + } + + target.path=$$PREFIX/bin/ + desktop.path=$$PREFIX/share/applications/ + desktop.files+=KeyboardVisualizerQT/KeyboardVisualizer.desktop + pixmap.path=$$PREFIX/share/pixmaps/ + pixmap.files+=KeyboardVisualizerQT/KeyboardVisualizer.png + INSTALLS += target desktop pixmap +} + +#-----------------------------------------------------------------------# +# MacOS-specific Configuration # +#-----------------------------------------------------------------------# +macx: { + CONFIG += c++14 + LIBS += -framework OpenAL +} + +macx:ICON += \ + KeyboardVisualizerQT/KeyboardVisualizer.icns diff --git a/KeyboardVisualizerCommon/AsusAuraSDK.cpp b/KeyboardVisualizerCommon/AsusAuraSDK.cpp deleted file mode 100644 index 48fcbe9..0000000 --- a/KeyboardVisualizerCommon/AsusAuraSDK.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for ASUS AURA SDK Interface | -| | -| Avinash Raja (avinashraja98@gmail.com), 1/4/2018 | -| Adam Honse (calcprogrammer1@gmail.com) | -\*---------------------------------------------------------*/ - -#include "AsusAuraSDK.h" - -#include "VisualizerDefines.h" - -DWORD mb_ledCount; -//DWORD dram_ledCount; - -BYTE* mb_color; -//BYTE* dram_color; - -MbLightControl* mb_LightCtrl; -//DramLightControl* dram_LightCtrl; - -AsusAuraSDK::AsusAuraSDK() -{ -} - - -AsusAuraSDK::~AsusAuraSDK() -{ - delete[] mb_color; - //delete[] dram_color; - - delete[] mb_LightCtrl; - //delete[] dram_LightCtrl; -} - -void AsusAuraSDK::Initialize() -{ - hModule = LoadLibraryA(ASUSAURASDKDLL); - - if (hModule) - { - dllLoaded = TRUE; - (FARPROC&)EnumerateMbController = GetProcAddress(hModule, "EnumerateMbController"); - (FARPROC&)SetMbMode = GetProcAddress(hModule, "SetMbMode"); - (FARPROC&)SetMbColor = GetProcAddress(hModule, "SetMbColor"); - (FARPROC&)GetMbColor = GetProcAddress(hModule, "GetMbColor"); - (FARPROC&)GetMbLedCount = GetProcAddress(hModule, "GetMbLedCount"); - -#if 0 - (FARPROC&)EnumerateDram = GetProcAddress(hModule, "EnumerateDram"); - (FARPROC&)SetDramMode = GetProcAddress(hModule, "GetDramMode"); - (FARPROC&)SetDramColor = GetProcAddress(hModule, "SetDramColor"); - (FARPROC&)GetDramColor = GetProcAddress(hModule, "GetDramColor"); - (FARPROC&)GetDramLedCount = GetProcAddress(hModule, "GetDramLedCount"); -#endif - - DWORD mb_count = EnumerateMbController(NULL, 0); - //DWORD dram_count = EnumerateDram(NULL, 0); - - mb_LightCtrl = new MbLightControl[mb_count]; - //dram_LightCtrl = new DramLightControl[dram_count]; - - EnumerateMbController(mb_LightCtrl, mb_count); - //EnumerateDram(dram_LightCtrl, dram_count); - - SetMbMode(mb_LightCtrl[0], 1); - //SetDramMode(dram_LightCtrl[0], 1); - - mb_ledCount = GetMbLedCount(mb_LightCtrl[0]); - //dram_ledCount = GetDramLedCount(dram_LightCtrl[0]); - - mb_color = new BYTE[mb_ledCount * 3]; - //dram_color = new BYTE[dram_ledCount * 3]; - - memset(mb_color, 0, mb_ledCount * 3); - //memset(dram_color, 0, dram_ledCount * 3); - } - else - { - dllLoaded = FALSE; - } -} - -bool AsusAuraSDK::SetLEDs(COLORREF pixels[64][256]) -{ - if (dllLoaded) - { - // Following logic is based on results from the Asus ROG Strix Z270I motherboard. - for (size_t i = 0; i < mb_ledCount * 3; ++i) - { - if (i % 3 == 0) - { - mb_color[i] = GetRValue(pixels[0][(128 / mb_ledCount) *(mb_ledCount - (int)((i) / 3))]); - } - if (i % 3 == 1) - { - mb_color[i] = GetBValue(pixels[0][(128 / mb_ledCount)*(mb_ledCount - (int)((i-1) / 3))]); - } - if (i % 3 == 2) - { - mb_color[i] = GetGValue(pixels[0][(128 / mb_ledCount)*(mb_ledCount - (int)((i-2) / 3))]); - } - } - - SetMbColor(mb_LightCtrl[0], mb_color, mb_ledCount * 3); - -#if 0 - for (size_t i = 0; i < dram_ledCount * 3; ++i) - { - if (i % 3 == 0) - { - mb_color[i] = GetRValue(pixels[0][(128 / dram_ledCount) *(dram_ledCount - (int)((i) / 3))]); - } - if (i % 3 == 1) - { - mb_color[i] = GetBValue(pixels[0][(128 / dram_ledCount)*(dram_ledCount - (int)((i - 1) / 3))]); - } - if (i % 3 == 2) - { - mb_color[i] = GetGValue(pixels[0][(128 / dram_ledCount)*(dram_ledCount - (int)((i - 2) / 3))]); - } - } - - SetDramColor(dram_LightCtrl[0], dram_color, dram_ledCount * 3); -#endif - return TRUE; - } - else - { - return FALSE; - } -} diff --git a/KeyboardVisualizerCommon/AsusAuraSDK.h b/KeyboardVisualizerCommon/AsusAuraSDK.h deleted file mode 100644 index 1da7d4b..0000000 --- a/KeyboardVisualizerCommon/AsusAuraSDK.h +++ /dev/null @@ -1,40 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for ASUS AURA SDK Interface | -| | -| Avinash Raja (avinashraja98@gmail.com), 1/4/2018 | -| Adam Honse (calcprogrammer1@gmail.com) | -\*---------------------------------------------------------*/ - -#include "AURALightingSDK.h" -#include "VisualizerDefines.h" - -#define ASUSAURASDKDLL "AURA_SDK.dll" - -class AsusAuraSDK -{ -public: - AsusAuraSDK(); - ~AsusAuraSDK(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); - -private: - - HMODULE hModule = NULL; - - bool dllLoaded = FALSE; - - EnumerateMbControllerFunc EnumerateMbController; - SetMbModeFunc SetMbMode; - SetMbColorFunc SetMbColor; - GetMbColorFunc GetMbColor; - GetMbLedCountFunc GetMbLedCount; - - EnumerateDramFunc EnumerateDram; - SetDramModeFunc SetDramMode; - SetDramColorFunc SetDramColor; - GetDramColorFunc GetDramColor; - GetDramLedCountFunc GetDramLedCount; -}; - diff --git a/KeyboardVisualizerCommon/CmKeyboard.cpp b/KeyboardVisualizerCommon/CmKeyboard.cpp deleted file mode 100644 index 73f937e..0000000 --- a/KeyboardVisualizerCommon/CmKeyboard.cpp +++ /dev/null @@ -1,120 +0,0 @@ -//================================================================================================== -// 2016/7/23 Sen Zhao pz140202@gmail.com -// Powered by Cooler Master SDK v160630 -//================================================================================================== - -#include "CmKeyboard.h" -#include "VisualizerDefines.h" - -#define COOLER_MASTER_ENABLED - -#ifdef COOLER_MASTER_ENABLED -#include - -static COLOR_MATRIX cm; -bool INITED = false; -int device = -1; // device type : 0- Masterkeys Pro L ; 1- Masterkeys Pro S -bool isplug; - -int dev_column; -int y_idx_list[6]; -int col; - -static float LED_TABLE[6][22] = { -/* R\C 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 */ -/* 0 */ {0, 2, 3, 4, 5, -1, 6.5, 7.5, 8.5, 9.5, -1, 11, 12, 13, 14, 15.25, 16.25, 17.25, 18.5, 19.5, 20.5, 21.5}, -/* 1 */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, 13.5, 15.25, 16.25, 17.25, 18.5, 19.5, 20.5, 21.5}, -/* 2 */ {0.25, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, -1, 13.75, 15.25, 16.25, 17.25, 18.5, 19.5, 20.5, 21.5,}, -/* 3 */ {0.375, 1.75, 2.75, 3.75, 4.75, 5.75, 6.75, 7.75, 8.75, 9.75, 10.75, 11.75, -1, -1, 13.375, -1, -1, -1, 18.5, 19.5, 20.5, -1}, -/* 4 */ {0.875, -1, 2.25, 3.25, 4.25, 5.25, 6.25, 7.25, 8.25, 9.25, 10.25, 11.25, -1, -1, 13.125, -1, 16.25, -1, 18.5, 19.5, 20.5, 21.5}, -/* 5 */ {0.125, 1.375, 2.625, -1, -1, -1, 6.375, -1, -1, -1, 10.125, 11.375, 12.625, -1, 13.875, 15.25, 16.25, 17.25, 19.5, -1, 20.5, -1} -}; -#endif - -CmKeyboard::CmKeyboard() -{ -} - -CmKeyboard::~CmKeyboard() -{ -#ifdef COOLER_MASTER_ENABLED - EnableLedControl(false); -#endif -} - -void CmKeyboard::Initialize() -{ -#ifdef COOLER_MASTER_ENABLED - //device selection - SetControlDevice(DEV_MKeys_S); - isplug = IsDevicePlug(); - if (isplug == 1) - { - device = 1; - } - else - { - SetControlDevice(DEV_MKeys_L); - isplug = IsDevicePlug(); - if (isplug == 1) - { - device = 0; - } - } - - for (int y = 0; y < 6; y++) - { - y_idx_list[y] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / 6)) + (0.5f * (SPECTROGRAPH_ROWS / 6))); - } - - // count "col" by device type - if (device == 0) - { - dev_column = 22; - col = (int)(SPECTROGRAPH_END / 22); - } - else if (device == 1) - { - dev_column = 18; - col = (int)(SPECTROGRAPH_END / 18); - } - - // finish init - if (isplug == 1) - { - EnableLedControl(true); - RefreshLed(true); - INITED = true; - } -#endif -} - -bool CmKeyboard::SetLEDs(COLORREF pixels[64][256]) -{ -#ifdef COOLER_MASTER_ENABLED - if (INITED == true) - { - for (int i = 0; i < 6; i++) - { - for (int j = 0; j < dev_column; j++) - { - if (LED_TABLE[i][j] >= 0) - { - cm.KeyColor[i][j].r = GetRValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]); - cm.KeyColor[i][j].g = GetGValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]); - cm.KeyColor[i][j].b = GetBValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]); - } - - } - } - if (SetAllLedColor(cm) == false) - { - SetAllLedColor(cm); - } - } - - return INITED; -#else - return FALSE; -#endif -} \ No newline at end of file diff --git a/KeyboardVisualizerCommon/CmKeyboard.h b/KeyboardVisualizerCommon/CmKeyboard.h deleted file mode 100644 index bfaa774..0000000 --- a/KeyboardVisualizerCommon/CmKeyboard.h +++ /dev/null @@ -1,29 +0,0 @@ -//================================================================================================== -// 2016/7/23 Sen Zhao pz140202@gmail.com -// Powered by Cooler Master SDK v160630 -//================================================================================================== - -#ifndef CM_KEYBOARD_H -#define CM_KEYBOARD_H - -#include "SDKDLL.h" - -//================================================================================================== -// Note:these files belong to Cooler Master RGB SDK, do not remove or edit ~@_@~ -// SDKDLL.h -// SDKDLL.dll -// SDKDLL.lib -//================================================================================================== - -class CmKeyboard -{ -public: - CmKeyboard(); - ~CmKeyboard(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); - -}; - -#endif \ No newline at end of file diff --git a/KeyboardVisualizerCommon/CorsairCKBLinux.cpp b/KeyboardVisualizerCommon/CorsairCKBLinux.cpp deleted file mode 100644 index 677bba4..0000000 --- a/KeyboardVisualizerCommon/CorsairCKBLinux.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "CorsairCKBLinux.h" - -#include -#include -#include -#include -#include - -CorsairCKB::CorsairCKB() -{ - -} - -void CorsairCKB::Initialize() -{ -/* - char activate_cmd[] = "activate\n"; - char dither_cmd[] = "dither 1\n"; - - corsair_fd = open("/dev/input/ckb1/cmd",O_WRONLY); - - if(corsair_fd != -1) - { - write(corsair_fd, activate_cmd, strlen(activate_cmd)); - write(corsair_fd, dither_cmd, strlen(dither_cmd)); - } -*/ -} - -bool CorsairCKB::SetLEDs(COLORREF pixels[64][256]) -{ - return false; -} diff --git a/KeyboardVisualizerCommon/CorsairCKBLinux.h b/KeyboardVisualizerCommon/CorsairCKBLinux.h deleted file mode 100644 index 88d3152..0000000 --- a/KeyboardVisualizerCommon/CorsairCKBLinux.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef CORSAIRCKBLINUX_H -#define CORSAIRCKBLINUX_H - -#include "VisualizerDefines.h" - -class CorsairCKB -{ -public: - CorsairCKB(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); - -private: - int corsair_fd; -}; - -#endif // CORSAIRCKBLINUX_H diff --git a/KeyboardVisualizerCommon/CorsairCUE.cpp b/KeyboardVisualizerCommon/CorsairCUE.cpp deleted file mode 100644 index 645f62e..0000000 --- a/KeyboardVisualizerCommon/CorsairCUE.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Corsair CUE SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "CorsairCUE.h" -#include "VisualizerDefines.h" - -#define CORSAIR_CUE_ENABLED - -static boolean failed; - -#ifdef CORSAIR_CUE_ENABLED -#include - -#pragma comment(lib, "CUESDK_2013.lib") -#pragma comment(lib, "CUESDK.x64_2013.lib") - -CorsairLedColor * colors; -CorsairLedPositions * positions; -int * x_idx; -int * y_idx; -CorsairLedId * led_idx; -#endif - -CorsairCUE::CorsairCUE() -{ -} - - -CorsairCUE::~CorsairCUE() -{ -} - -#ifdef CORSAIR_CUE_ENABLED -double getKeyboardHeight(CorsairLedPositions *ledPositions) -{ - const auto minmaxLeds = std::minmax_element(ledPositions->pLedPosition, ledPositions->pLedPosition + ledPositions->numberOfLed, - [](const CorsairLedPosition &clp1, const CorsairLedPosition &clp2) { - return clp1.top < clp2.top; - }); - return minmaxLeds.second->top + minmaxLeds.second->height - minmaxLeds.first->top; -} - -double getKeyboardWidth(CorsairLedPositions *ledPositions) -{ - const auto minmaxLeds = std::minmax_element(ledPositions->pLedPosition, ledPositions->pLedPosition + ledPositions->numberOfLed, - [](const CorsairLedPosition &clp1, const CorsairLedPosition &clp2) { - return clp1.left < clp2.left; - }); - return minmaxLeds.second->left + minmaxLeds.second->width - minmaxLeds.first->left; -} -#endif - -void CorsairCUE::Initialize() -{ -#ifdef CORSAIR_CUE_ENABLED - CorsairPerformProtocolHandshake(); - if (const auto error = CorsairGetLastError()) - { - failed = TRUE; - } - else - { - failed = FALSE; - - positions = CorsairGetLedPositions(); - - colors = new CorsairLedColor[positions->numberOfLed]; - x_idx = new int[positions->numberOfLed]; - y_idx = new int[positions->numberOfLed]; - led_idx = new CorsairLedId[positions->numberOfLed]; - - double width = getKeyboardWidth(positions); - double height = getKeyboardHeight(positions); - - for (int i = 0; i < positions->numberOfLed; i++) - { - led_idx[i] = positions->pLedPosition[i].ledId; - x_idx[i] = (int)(SPECTROGRAPH_END * (positions->pLedPosition[i].left / width)); - y_idx[i] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (SPECTROGRAPH_ROWS * (positions->pLedPosition[i].top / height)) + (0.5f * (SPECTROGRAPH_ROWS / height))); - } - - failed = FALSE; - } -#else - failed = TRUE; -#endif -} - -bool CorsairCUE::SetLEDs(COLORREF pixels[64][256]) -{ - if (failed) - { - return FALSE; - } - else - { -#ifdef CORSAIR_CUE_ENABLED - for (int i = 0; i < positions->numberOfLed; i++) - { - COLORREF color = pixels[y_idx[i]][x_idx[i]]; - colors[i].r = GetRValue(color); - colors[i].g = GetGValue(color); - colors[i].b = GetBValue(color); - colors[i].ledId = led_idx[i]; - } - - CorsairSetLedsColors(positions->numberOfLed, colors); - return TRUE; -#endif - } -} \ No newline at end of file diff --git a/KeyboardVisualizerCommon/CorsairCUE.h b/KeyboardVisualizerCommon/CorsairCUE.h deleted file mode 100644 index 683935a..0000000 --- a/KeyboardVisualizerCommon/CorsairCUE.h +++ /dev/null @@ -1,26 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Corsair CUE SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#ifndef CORSAIR_CUE_H -#define CORSAIR_CUE_H - -#include "..\KeyboardVisualizerVC\stdafx.h" - -#include "CUESDK.h" - -#include "VisualizerDefines.h" - -class CorsairCUE -{ -public: - CorsairCUE(); - ~CorsairCUE(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); -}; - -#endif \ No newline at end of file diff --git a/KeyboardVisualizerCommon/LEDStrip.cpp b/KeyboardVisualizerCommon/LEDStrip.cpp deleted file mode 100644 index f651494..0000000 --- a/KeyboardVisualizerCommon/LEDStrip.cpp +++ /dev/null @@ -1,554 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Generic LED Strip Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "LEDStrip.h" - -#include -#include -#include - -//Thread functions have different types in Windows and Linux -#ifdef WIN32 -#include -#define THREAD static void -#define THREADRETURN -#else -#define THREAD static void* -#define THREADRETURN return(NULL); -#endif - -//Include pthread and Unix standard libraries if not building for Windows -#ifndef WIN32 -#include "pthread.h" -#include "unistd.h" -#endif - -LEDStrip::LEDStrip() -{ - num_leds = 30; -} - - -LEDStrip::~LEDStrip() -{ -} - -THREAD lsthread(void *param) -{ - LEDStrip* led = static_cast(param); - led->LEDStripUpdateThread(); - THREADRETURN -} - -void LEDStrip::Initialize(int led_type, char* ledstring, int matrix_size, int matrix_pos, int sections, int rotate_x, bool mirror_x, bool mirror_y, bool single_color) -{ - this->led_type = led_type; - - if (led_type == LED_STRIP_HUE_PLUS) - { - InitializeHuePlus(ledstring); - } - else - { - strcpy(led_string, ledstring); - - //Assume serial device unless a different protocol is specified - bool serial = TRUE; - bool udp = FALSE; - bool espurna = FALSE; - LPSTR numleds = NULL; - LPSTR source = NULL; - LPSTR udpport_baud = NULL; - LPSTR next = NULL; - LPSTR apikey = NULL; - - source = strtok_s(ledstring, ",", &next); - - //Check if we are setting up a Keyboard Visualizer UDP protocol device - if (strncmp(source, "udp:", 4) == 0) - { - source = source + 4; - serial = FALSE; - udp = TRUE; - espurna = FALSE; - } - - //Check if we are setting up an Espurna protocol device - if (strncmp(source, "espurna:", 8) == 0) - { - source = source + 8; - serial = FALSE; - udp = FALSE; - espurna = TRUE; - } - - //Check for either the UDP port or the serial baud rate - if (strlen(next)) - { - udpport_baud = strtok_s(next, ",", &next); - } - - //Check for the number of LEDs - if (strlen(next)) - { - numleds = strtok_s(next, ",", &next); - } - - //Espurna protocol requires API key - if (strlen(next)) - { - apikey = strtok_s(next, ",", &next); - } - - if (serial) - { - if (udpport_baud == NULL) - { - //Initialize with default baud rate - InitializeSerial(source, 115200); - } - else - { - //Initialize with custom baud rate - InitializeSerial(source, atoi(udpport_baud)); - } - } - else - { - if (udpport_baud == NULL) - { - //Do something - } - else - { - if (udp) - { - //Initialize UDP port - InitializeUDP(source, udpport_baud); - } - else if (espurna) - { - //Initialize Espurna - InitializeEspurna(source, udpport_baud, apikey); - } - } - } - - if (numleds != NULL && strlen(numleds)) - { - SetNumLEDs(atoi(numleds), matrix_size, matrix_pos, sections, rotate_x, mirror_x, mirror_y, single_color); - } - } - -#ifdef WIN32 - _beginthread(lsthread, 0, this); -#else - pthread_t threads[1]; - - pthread_create(&threads[0], NULL, &lsthread, this); -#endif -} - -void LEDStrip::InitializeHuePlus(char* ledstring) -{ - strcpy(led_string, ledstring); - - LPSTR source = NULL; - LPSTR channels = NULL; - LPSTR numleds = NULL; - LPSTR next = NULL; - - source = strtok_s(ledstring, ",", &next); - - //Check for selected channel 0=both, 1= Ch.1, 2= Ch.2 - if (strlen(next)) - { - channels = strtok_s(next, ",", &next); - } - - switch (atoi(channels)) - { - case 0: - channel = 0x00; - break; - - case 1: - channel = 0x01; - break; - - case 2: - channel = 0x02; - break; - } - - //Check for the number of LEDs, sets the corresponding variable with the counter for the fans - if (strlen(next)) - { - numleds = strtok_s(next, ",", &next); - } - - switch (atoi(numleds) / 8) - { - case 1: - fans = 0x00; - break; - - case 2: - fans = 0x01; - break; - - case 3: - fans = 0x02; - break; - - case 4: - fans = 0x03; - break; - - case 5: - fans = 0x04; - break; - } - - //Initialize with default baud rate - InitializeSerial(source, 256000); - - if (numleds != NULL && strlen(numleds)) - { - SetNumLEDs(atoi(numleds), 0, 0, 1, 0, false, false, false); - } -} - -void LEDStrip::InitializeSerial(char* portname, int baud) -{ - portname = strtok(portname, "\r"); - strcpy(port_name, portname); - baud_rate = baud; - serialport = new serial_port(port_name, baud_rate); - udpport = NULL; - tcpport = NULL; -} - -void LEDStrip::InitializeUDP(char * clientname, char * port) -{ - strcpy(client_name, clientname); - strcpy(port_name, port); - - udpport = new net_port(client_name, port_name); - serialport = NULL; -} - -void LEDStrip::InitializeEspurna(char * clientname, char * port, char * apikey) -{ - strcpy(client_name, clientname); - strcpy(port_name, port); - strcpy(espurna_apikey, apikey); - tcpport = new net_port; - serialport = NULL; - udpport = NULL; - tcpport->tcp_client(client_name, port_name); -} - -char* LEDStrip::GetLEDString() -{ - return(led_string); -} - -void LEDStrip::SetNumLEDs(int numleds, int matrix_size, int matrix_pos, int sections, int rotate_x, bool mirror_x, bool mirror_y, bool single_color) -{ - int y_index = ROW_IDX_BAR_GRAPH; - - num_leds = numleds; - - LEDStripXIndex = new int[num_leds]; - LEDStripYIndex = new int[num_leds]; - - if ((num_leds % 2) == 0) - { - //for vertical strips - //for (int section = 0; section < sections; section++) - //{ - // //Even number of LEDs - // for (int i = 0; i < (num_leds / sections); i++) - // { - // int led_idx = (section * (num_leds / sections)) + i; - // int matrix_pos_adj = matrix_pos + section; - - // LEDStripXIndex[led_idx] = (int)((section * (256.0f / (sections - 1)))); - - // if (sections == ((num_leds / sections) - 1)) - // { - // LEDStripXIndex[led_idx] = LEDStripXIndex[led_idx] - 1; - // } - - // if (matrix_size > 0) - // { - // y_index = (int)(ROW_IDX_SPECTROGRAPH_TOP + ((i)* (SPECTROGRAPH_ROWS / (num_leds / sections))) + (0.5f * (SPECTROGRAPH_ROWS / (num_leds / sections)))); - // } - - // LEDStripYIndex[led_idx] = y_index; - // } - //} - //Even number of LEDs - - //For horizontal strips - for (int section = 0; section < sections; section++) - { - //Even number of LEDs - for (int i = 0; i < (num_leds / sections); i++) - { - int x_index = i + rotate_x; - int led_idx = (section * (num_leds / sections)) + i; - int matrix_pos_adj = matrix_pos + section; - - if (x_index >= (num_leds / sections)) - { - x_index = (num_leds / sections) - x_index; - } - - if (x_index < 0) - { - x_index = (num_leds / sections) + x_index; - } - - if (mirror_x) - { - LEDStripXIndex[led_idx] = (int)(num_leds / sections) - ((x_index * (256.0f / ((num_leds / sections) - 1)))); - } - else - { - LEDStripXIndex[led_idx] = (int)((x_index * (256.0f / ((num_leds / sections) - 1)))); - } - - if (x_index == ((num_leds / sections) - 1)) - { - LEDStripXIndex[led_idx] = LEDStripXIndex[led_idx] - 1; - } - - if (matrix_size > 0) - { - if (single_color) - { - y_index = ROW_IDX_SINGLE_COLOR; - } - else - { - if (mirror_y) - { - y_index = (int)(ROW_IDX_SPECTROGRAPH_TOP + (((matrix_pos + sections - 1) - (matrix_pos + section - 1)) * (SPECTROGRAPH_ROWS / matrix_size)) + (0.5f * (SPECTROGRAPH_ROWS / matrix_size))); - } - else - { - y_index = (int)(ROW_IDX_SPECTROGRAPH_TOP + ((matrix_pos + section - 1) * (SPECTROGRAPH_ROWS / matrix_size)) + (0.5f * (SPECTROGRAPH_ROWS / matrix_size))); - } - } - } - - LEDStripYIndex[led_idx] = y_index; - } - } - } - else - { - //Odd number of LEDs - for (int i = 0; i < num_leds; i++) - { - sections = 1; - int x_index = i + rotate_x; - - if (x_index >= (num_leds / sections)) - { - x_index = (num_leds / sections) - x_index; - } - - if (x_index < 0) - { - x_index = (num_leds / sections) + x_index; - } - - if (single_color) - { - LEDStripYIndex[i] = ROW_IDX_SINGLE_COLOR; - } - else - { - LEDStripYIndex[i] = y_index; - } - - if (x_index == (num_leds / 2)) - { - LEDStripXIndex[i] = 128; - } - else if (x_index < ((num_leds / 2) + 1)) - { - LEDStripXIndex[i] = (num_leds / 2) + ((x_index + 1) * (256 / (num_leds + 1))); - } - else - { - LEDStripXIndex[i] = ((num_leds / 2) + 1) + (x_index * (256 / (num_leds + 1))); - } - } - } -} - -void LEDStrip::SetLEDs(COLORREF pixels[64][256]) -{ - if (serialport != NULL || udpport != NULL) - { - unsigned char *serial_buf; - - serial_buf = new unsigned char[(num_leds * 3) + 3]; - - serial_buf[0] = 0xAA; - - for (int idx = 0; idx < (num_leds * 3); idx += 3) - { - int pixel_idx = idx / 3; - COLORREF color = pixels[LEDStripYIndex[pixel_idx]][LEDStripXIndex[pixel_idx]]; - serial_buf[idx + 1] = GetRValue(color); - serial_buf[idx + 2] = GetGValue(color); - serial_buf[idx + 3] = GetBValue(color); - } - - unsigned short sum = 0; - - for (int i = 0; i < (num_leds * 3) + 1; i++) - { - sum += serial_buf[i]; - } - - serial_buf[(num_leds * 3) + 1] = sum >> 8; - serial_buf[(num_leds * 3) + 2] = sum & 0x00FF; - - if (serialport != NULL) - { - serialport->serial_write((char *)serial_buf, (num_leds * 3) + 3); - serialport->serial_flush_tx(); - } - else if (udpport != NULL) - { - udpport->udp_write((char *)serial_buf, (num_leds * 3) + 3); - } - - delete[] serial_buf; - } - else - { - SetLEDsEspurna(pixels); - } -} - -void LEDStrip::SetLEDsEspurna(COLORREF pixels[64][256]) -{ - if (tcpport != NULL) - { - COLORREF color = pixels[ROW_IDX_SINGLE_COLOR][128]; - char get_request[1024]; - snprintf(get_request, 1024, "GET /api/rgb?apikey=%s&value=%%23%02X%02X%02X HTTP/1.1\r\nHost: %s\r\n\r\n", espurna_apikey, GetRValue(color), GetGValue(color), GetBValue(color), client_name); - tcpport->tcp_client_connect(); - tcpport->tcp_client_write(get_request, strlen(get_request)); - tcpport->tcp_close(); - } -} - -void LEDStrip::SetLEDsXmas(COLORREF pixels[64][256]) -{ - unsigned char xmas_buf[5*25]; - - for (int idx = 0; idx < 25; idx++) - { - COLORREF color = pixels[LEDStripYIndex[idx]][LEDStripXIndex[idx]]; - unsigned int xmas_color = ((GetBValue(color)/16)<<8) - | ((GetGValue(color)/16)<<4) - | ((GetRValue(color)/16)); - - xmas_buf[(idx * 5)] = 0x00; - xmas_buf[(idx * 5) + 1] = idx + 1; - xmas_buf[(idx * 5) + 2] = xmas_color >> 8; - xmas_buf[(idx * 5) + 3] = xmas_color & 0xFF; - xmas_buf[(idx * 5) + 4] = 0xFE; - - if (idx == 24) - { - xmas_buf[(idx * 5) + 4] = 0xFF; - } - } - - serialport->serial_write((char *)xmas_buf, 5*25); - serialport->serial_flush_tx(); -}; - -void LEDStrip::SetLEDsHuePlus(COLORREF pixels[64][256]) -{ - if (serialport != NULL) - { - unsigned char *serial_buf; - - serial_buf = new unsigned char[hueSize]; //Size of Message always 5 XX Blocks (Mode Selection) + 3 XX for each LED (1 color) - //-> max of 40 LEDs per Channel (or 5 Fans a 8 LEDs) -> 125 Blocks (empty LEDs are written, too - serial_buf[0] = 0x4b; - serial_buf[1] = channel; - serial_buf[2] = 0x0e; - serial_buf[3] = fans; - serial_buf[4] = 0x00; - - for (int i = 5; i < hueSize; i++) - { - //clearing the buf otherwise sometimes strange things are written to the COM Port - serial_buf[i] = 0x00; - } - - for (int idx = 0; idx < (num_leds * 3); idx += 3) - { - int pixel_idx = idx / 3; - COLORREF color = pixels[LEDStripYIndex[pixel_idx]][LEDStripXIndex[pixel_idx]]; - serial_buf[idx + 5] = GetGValue(color); - serial_buf[idx + 6] = GetRValue(color); - serial_buf[idx + 7] = GetBValue(color); - } - - serialport->serial_write((char *)serial_buf, hueSize); - serialport->serial_flush_tx(); - - delete[] serial_buf; - } -} - -void LEDStrip::SetPixels(COLORREF pixels[64][256]) -{ - led_pixels = pixels; -} - -void LEDStrip::SetDelay(int delay) -{ - led_delay = delay; -} - -void LEDStrip::LEDStripUpdateThread() -{ - while (TRUE) - { - if (led_pixels != NULL) - { - switch (led_type) - { - case LED_STRIP_NORMAL: - SetLEDs(led_pixels); - break; - - case LED_STRIP_XMAS: - SetLEDsXmas(led_pixels); - break; - - case LED_STRIP_HUE_PLUS: - SetLEDsHuePlus(led_pixels); - break; - } - } - - Sleep(led_delay); - } -} \ No newline at end of file diff --git a/KeyboardVisualizerCommon/LEDStrip.h b/KeyboardVisualizerCommon/LEDStrip.h deleted file mode 100644 index 9da7619..0000000 --- a/KeyboardVisualizerCommon/LEDStrip.h +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Generic LED Strip Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#ifndef LED_STRIP_H -#define LED_STRIP_H - -#include "net_port.h" -#include "serial_port.h" - -#include "VisualizerDefines.h" - -#ifndef TRUE -#define TRUE true -#define FALSE false -#endif - -enum -{ - LED_STRIP_NORMAL, - LED_STRIP_XMAS, - LED_STRIP_HUE_PLUS -}; - -class LEDStrip -{ -public: - LEDStrip(); - ~LEDStrip(); - - void Initialize(int led_type, char* ledstring, int matrix_size, int matrix_pos, int sections, int rotate_x, bool mirror_x, bool mirror_y, bool single_color); - void InitializeHuePlus(char * ledstring); - void InitializeSerial(char* portname, int baud); - void InitializeUDP(char* clientname, char* port); - void InitializeEspurna(char* clientname, char* port, char * apikey); - char* GetLEDString(); - void SetNumLEDs(int numleds, int matrix_size, int matrix_pos, int sections, int rotate_x, bool mirror_x, bool mirror_y, bool single_color); - void SetLEDs(COLORREF pixels[64][256]); - void SetLEDsEspurna(COLORREF pixels[64][256]); - void SetLEDsXmas(COLORREF pixels[64][256]); - void SetLEDsHuePlus(COLORREF pixels[64][256]); - void SetPixels(COLORREF pixels[64][256]); - void SetDelay(int delay); - void LEDStripUpdateThread(); - - int led_type = LED_STRIP_NORMAL; - -private: - int baud_rate; - int num_leds; - int fans; - int channel; - int led_delay = 10; - const int hueSize = 125; - - int * LEDStripXIndex; - int * LEDStripYIndex; - - char led_string[1024]; - char port_name[128]; - char client_name[1024]; - char espurna_apikey[128]; - COLORREF (*led_pixels)[256] = NULL; - serial_port *serialport; - net_port *udpport; - net_port *tcpport; -}; - -#endif diff --git a/KeyboardVisualizerCommon/LogitechSDK.cpp b/KeyboardVisualizerCommon/LogitechSDK.cpp deleted file mode 100644 index e3b0473..0000000 --- a/KeyboardVisualizerCommon/LogitechSDK.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Logitech Gaming LED SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 2/5/2017 | -\*---------------------------------------------------------*/ - -#include "LogitechSDK.h" -#include "VisualizerDefines.h" - -static boolean failed; - -//Index lists for BlackWidow -int LogitechXIndex[21]; -int LogitechYIndex[6]; - -static void SetupKeyboardGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list) -{ - for (int x = 0; x < x_count; x++) - { - if (x_count < 10) - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count))) + (0.5f * (SPECTROGRAPH_COLS / (x_count)))); - } - else if (x < ((x_count) / 2)) - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) + (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); - } - else - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) - (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); - } - - } - for (int y = 0; y < y_count; y++) - { - y_idx_list[y] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / y_count)) + (0.5f * (SPECTROGRAPH_ROWS / y_count))); - } -} - -LogitechSDK::LogitechSDK() -{ -} - - -LogitechSDK::~LogitechSDK() -{ -} - -void LogitechSDK::Initialize() -{ - failed = !LogiLedInit(); - - if (!failed) - { - SetupKeyboardGrid(21, 6, LogitechXIndex, LogitechYIndex); - } -} - -bool LogitechSDK::SetLEDs(COLORREF pixels[64][256]) -{ - if (failed) - { - return FALSE; - } - else - { - unsigned char LogitechBitmap[LOGI_LED_BITMAP_SIZE]; - - for (int y = 0; y < 6; y++) - { - for (int x = 0; x < 21; x++) - { - ((int *)LogitechBitmap)[(21 * y) + x] = RGB2BGR(pixels[LogitechYIndex[y]][LogitechXIndex[x]]) | 0xFF000000; - } - } - - LogiLedSetTargetDevice(LOGI_DEVICETYPE_PERKEY_RGB); - if (!LogiLedSetLightingFromBitmap(LogitechBitmap)) - { - failed = TRUE; - return FALSE; - } - - COLORREF single_color = pixels[ROW_IDX_SINGLE_COLOR][0]; - - LogiLedSetTargetDevice(LOGI_DEVICETYPE_RGB | LOGI_DEVICETYPE_MONOCHROME); - if (!LogiLedSetLighting(GetRValue(single_color) / 2.55f, GetGValue(single_color) / 2.55f, GetBValue(single_color) / 2.55f)) - { - failed = TRUE; - return FALSE; - } - - return TRUE; - } -} \ No newline at end of file diff --git a/KeyboardVisualizerCommon/LogitechSDK.h b/KeyboardVisualizerCommon/LogitechSDK.h deleted file mode 100644 index 4662f7a..0000000 --- a/KeyboardVisualizerCommon/LogitechSDK.h +++ /dev/null @@ -1,27 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Logitech Gaming LED SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 2/5/2017 | -\*---------------------------------------------------------*/ - -#ifndef LOGITECH_SDK_H -#define LOGITECH_SDK_H - -#include "..\KeyboardVisualizerVC\stdafx.h" - -#include "LogitechLEDLib.h" -#pragma comment(lib, "LogitechLEDLib.lib") - -#include "VisualizerDefines.h" - -class LogitechSDK -{ -public: - LogitechSDK(); - ~LogitechSDK(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); -}; - -#endif diff --git a/KeyboardVisualizerCommon/MSIKeyboard.cpp b/KeyboardVisualizerCommon/MSIKeyboard.cpp deleted file mode 100644 index 0fcab93..0000000 --- a/KeyboardVisualizerCommon/MSIKeyboard.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for MSI SteelSeries Keyboard Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "MSIKeyboard.h" - -#include "UsbDevice.h" - -static UsbDevice usb; -static bool init_ok = true; - -MSIKeyboard::MSIKeyboard() -{ -} - - -MSIKeyboard::~MSIKeyboard() -{ -} - - -void MSIKeyboard::Initialize() -{ - //Look for MSI SteelSeries Keyboard - if (usb.OpenDevice(0x1770, 0xFF00, 0)) - { - init_ok = true; - } - else - { - init_ok = false; - } -} - -bool MSIKeyboard::SetLEDs(COLORREF pixels[64][256]) -{ - //Shout out to bparker06 for reverse engineering the MSI keyboard USB protocol! - // https://github.com/bparker06/msi-keyboard/blob/master/keyboard.cpp for original implementation - - if(!init_ok) - { - return false; - } - - unsigned char buf[8] = { 0 }; - - buf[0] = 1; - buf[1] = 2; - buf[2] = 64; - buf[3] = 1; - buf[4] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][160]); - buf[5] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][160]); - buf[6] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][160]); - buf[7] = 236; - - usb.SendToDevice(buf, 8); - - buf[3] = 2; - buf[4] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][192]); - buf[5] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][192]); - buf[6] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][192]); - - usb.SendToDevice(buf, 8); - - buf[3] = 3; - buf[4] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][224]); - buf[5] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][224]); - buf[6] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][224]); - - usb.SendToDevice(buf, 8); - - buf[3] = 4; - buf[4] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][192]); - buf[5] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][192]); - buf[6] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][192]); - - usb.SendToDevice(buf, 8); - - buf[3] = 5; - - usb.SendToDevice(buf, 8); - - buf[3] = 6; - - usb.SendToDevice(buf, 8); - - buf[3] = 7; - - usb.SendToDevice(buf, 8); - - return init_ok; -} diff --git a/KeyboardVisualizerCommon/MSIKeyboard.h b/KeyboardVisualizerCommon/MSIKeyboard.h deleted file mode 100644 index 449279c..0000000 --- a/KeyboardVisualizerCommon/MSIKeyboard.h +++ /dev/null @@ -1,26 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for MSI SteelSeries Keyboard Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#ifndef MSI_KEYBOARD_H -#define MSI_KEYBOARD_H - -#include -#include -#include - -#include "VisualizerDefines.h" - -class MSIKeyboard -{ -public: - MSIKeyboard(); - ~MSIKeyboard(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); -}; - -#endif diff --git a/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.cpp b/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.cpp deleted file mode 100644 index ab0855a..0000000 --- a/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Thermaltake Poseidon Z RGB Keyboard | -| Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 2/12/2017 | -\*---------------------------------------------------------*/ - -#include "PoseidonZRGBKeyboard.h" - -#include "UsbDevice.h" - -static UsbDevice usb; -static bool init_ok = true; - -#define POSEIDONZ_START 0x07 -#define POSEIDONZ_PROFILE 0x01 -#define POSEIDONZ_LED_CMD 0x0E -#define POSEIDONZ_RED_GRN_CH 0x01 -#define POSEIDONZ_BLU_CH 0x02 - -static unsigned int keymap[6][23] = - { { 8, 0, 16, 24, 32, 40, 0, 48, 56, 64, 72, 0, 80, 88, 96, 104, 112, 120, 128, 0, 0, 0, 0 }, - { 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 0, 97, 105, 129, 0, 15, 31, 47, 63, 79, 95, 111 }, - { 10, 0, 18, 26, 34, 42, 0, 50, 58, 66, 74, 82, 90, 98, 106, 114, 23, 39, 55, 71, 87, 103, 102 }, - { 11, 0, 19, 27, 35, 43, 0, 51, 59, 67, 75, 83, 91, 99, 115, 0, 0, 0, 0, 46, 119, 78, 0 }, - { 12, 0, 36, 44, 52, 60, 0, 68, 0, 76, 84, 92, 100, 108, 124, 0, 0, 38, 0, 54, 62, 86, 118 }, - { 13, 21, 29, 0, 0, 0, 0, 45, 0, 0, 0, 0, 85, 93, 109, 117, 14, 22, 30, 70, 0, 94, 0 } }; - -int PoseidonZXIndex[23]; -int PoseidonZYIndex[6]; - -static void SetupKeyboardGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list) -{ - for (int x = 0; x < x_count; x++) - { - if (x < ((x_count) / 2)) - { - x_idx_list[x] = (x * (SPECTROGRAPH_COLS / (x_count - 1))) + (0.5f * (SPECTROGRAPH_COLS / (x_count - 1))); - } - else - { - x_idx_list[x] = (x * (SPECTROGRAPH_COLS / (x_count - 1))) - (0.5f * (SPECTROGRAPH_COLS / (x_count - 1))); - } - - } - for (int y = 0; y < y_count; y++) - { - y_idx_list[y] = ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / y_count)) + (0.5f * (SPECTROGRAPH_ROWS / y_count)); - } -} - -PoseidonZRGBKeyboard::PoseidonZRGBKeyboard() -{ -} - - -PoseidonZRGBKeyboard::~PoseidonZRGBKeyboard() -{ -} - - -void PoseidonZRGBKeyboard::Initialize() -{ - //Look for Thermaltake Poseidon Z RGB Keyboard - if(usb.OpenDevice(0x264a, 0x3006, 0)) - { - init_ok = true; - } - else - { - init_ok = false; - } - - SetupKeyboardGrid(23, 6, PoseidonZXIndex, PoseidonZYIndex); -} - -bool PoseidonZRGBKeyboard::SetLEDs(COLORREF pixels[64][256]) -{ - if(!init_ok) - { - return false; - } - - unsigned char red_grn_buf[264]; - unsigned char blu_buf[264]; - - for(int i = 0; i < 264; i++) - { - red_grn_buf[i] = 0x00; - blu_buf[i] = 0x00; - } - - red_grn_buf[0] = POSEIDONZ_START; - red_grn_buf[1] = POSEIDONZ_LED_CMD; - red_grn_buf[2] = POSEIDONZ_PROFILE; - red_grn_buf[3] = POSEIDONZ_RED_GRN_CH; - red_grn_buf[4] = 0x00; - red_grn_buf[5] = 0x00; - red_grn_buf[6] = 0x00; - red_grn_buf[7] = 0x00; - - blu_buf[0] = POSEIDONZ_START; - blu_buf[1] = POSEIDONZ_LED_CMD; - blu_buf[2] = POSEIDONZ_PROFILE; - blu_buf[3] = POSEIDONZ_BLU_CH; - blu_buf[4] = 0x00; - blu_buf[5] = 0x00; - blu_buf[6] = 0x00; - blu_buf[7] = 0x00; - - for(int x = 0; x < 23; x++) - { - for(int y = 0; y < 6; y++) - { - COLORREF color = pixels[PoseidonZYIndex[y]][PoseidonZXIndex[x]]; - unsigned int idx = keymap[y][x]; - - if(idx != 0) - { - red_grn_buf[idx] = GetRValue(color); - red_grn_buf[idx + 128 ] = GetGValue(color); - blu_buf[idx] = GetBValue(color); - } - } - } - - usb.SendToDevice(red_grn_buf, 264); - Sleep(1); - usb.SendToDevice(blu_buf, 264); - - return init_ok; -} diff --git a/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.h b/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.h deleted file mode 100644 index f91aaa3..0000000 --- a/KeyboardVisualizerCommon/PoseidonZRGBKeyboard.h +++ /dev/null @@ -1,27 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Thermaltake Poseidon Z RGB Keyboard | -| Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 2/12/2017 | -\*---------------------------------------------------------*/ - -#ifndef POSEIDON_ZRGB_KEYBOARD_H -#define POSEIDON_ZRGB_KEYBOARD_H - -#include -#include -#include - -#include "VisualizerDefines.h" - -class PoseidonZRGBKeyboard -{ -public: - PoseidonZRGBKeyboard(); - ~PoseidonZRGBKeyboard(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); -}; - -#endif diff --git a/KeyboardVisualizerCommon/RazerChroma.cpp b/KeyboardVisualizerCommon/RazerChroma.cpp deleted file mode 100644 index b2c0d30..0000000 --- a/KeyboardVisualizerCommon/RazerChroma.cpp +++ /dev/null @@ -1,582 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Razer Chroma SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "RazerChroma.h" - -#include - -//Index lists for BlackWidow -int BlackWidowXIndex[22]; -int BlackWidowYIndex[6]; - -//Index lists for BlackWidow TE -int BlackWidowTEXIndex[18]; -int BlackWidowTEYIndex[6]; - -//Index lists for Blade Stealth -int BladeStealthXIndex[16]; -int BladeStealthYIndex[6]; - -//Index list for Firefly -int FireflyIndex[15]; - -//Index lists for Nommo Chroma/Pro -int NommoChromaXIndex[24]; -int NommoProXIndex[8]; - -//Index list for mice (Mamba TE, DeathAdder) -int MouseXIndex[9][7]; -int MouseYIndex[9][7]; - -//Index list for Razer Core -int CoreXIndex[8]; - -//Index list for DeathStalker -static int DeathStalkerXLEDIndex[] = { 1, 4, 8, 12, 15, 18 }; -int DeathStalkerXIndex[6]; - -//Index lists for Orbweaver -int OrbweaverXIndex[5]; -int OrbweaverYIndex[4]; - -//Index list for ChromaLink -int ChromaLinkXIndex[ChromaSDK::ChromaLink::MAX_LEDS]; - -//Index list for Chroma HDK Matrix (Chroma Box) -int ChromaBoxXIndex[16]; -int ChromaBoxYIndex[4]; - -//Index list for individual strips bar graph Chroma HDK -int ChromaBox1BarXIndex[4][16]; - -//Index list for 2 strips bar graph Chroma HDK -int ChromaBox2BarXIndex[4][16]; - -//Index list for 4 strips bar graph Chroma HDK -int ChromaBox4BarXIndex[4][16]; - -//Previous color for Kraken headset -COLORREF kraken_last_color = 0; -DWORD kraken_last_color_change = 0; - -RazerChroma::RazerChroma() -{ -} - - -RazerChroma::~RazerChroma() -{ - if (hModule) - { - UNINIT UnInit = (UNINIT)GetProcAddress(hModule, "UnInit"); - if (UnInit) - { - UnInit(); - } - } -} - - -static void SetupKeyboardGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list) -{ - for (int x = 0; x < x_count; x++) - { - if (x_count < 10) - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count))) + (0.5f * (SPECTROGRAPH_COLS / (x_count)))); - } - else if (x < ((x_count) / 2)) - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) + (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); - } - else - { - x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) - (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); - } - - } - for (int y = 0; y < y_count; y++) - { - y_idx_list[y] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / y_count)) + (0.5f * (SPECTROGRAPH_ROWS / y_count))); - } -} - -void FillCustomGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list, ChromaSDK::CUSTOM_EFFECT_TYPE * effect, COLORREF pixels[64][256]) -{ - for (int x = 0; x < x_count; x++) - { - for (int y = 0; y < y_count; y++) - { - effect->Color[y][x] = (pixels[y_idx_list[y]][x_idx_list[x]] & 0x00FFFFFF); - } - } -} - -void FillKeyboardGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list, ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE * effect, COLORREF pixels[64][256]) -{ - for (int x = 0; x < x_count; x++) - { - for (int y = 0; y < y_count; y++) - { - effect->Color[y][x] = (pixels[y_idx_list[y]][x_idx_list[x]] & 0x00FFFFFF); - } - } -} - - -void FillKeypadGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list, ChromaSDK::Keypad::CUSTOM_EFFECT_TYPE * effect, COLORREF pixels[64][256]) -{ - for (int x = 0; x < x_count; x++) - { - for (int y = 0; y < y_count; y++) - { - effect->Color[y][x] = (pixels[y_idx_list[y]][x_idx_list[x]] & 0x00FFFFFF); - } - } -} - - -void RazerChroma::Initialize() -{ - // Initialize variables - use_keyboard_custom_effect = false; - use_headset_custom_effect = false; - use_chromalink_single_color = false; - disable_chromalink = false; - chroma_box_mode = 1; - - // Dynamically loads the Chroma SDK library. - hModule = LoadLibrary(CHROMASDKDLL); - if (hModule) - { - INIT Init = (INIT)GetProcAddress(hModule, "Init"); - if (Init) - { - //Initialize the SDK - Init(); - - //Build index list for BlackWidow - SetupKeyboardGrid(22, 6, BlackWidowXIndex, BlackWidowYIndex); - - //Build index list for BlackWidow TE - SetupKeyboardGrid(18, 6, BlackWidowTEXIndex, BlackWidowTEYIndex); - - //Build index list for Blade Stealth - SetupKeyboardGrid(16, 6, BladeStealthXIndex, BladeStealthYIndex); - - //Build index list for Chroma Box - SetupKeyboardGrid(16, 4, ChromaBoxXIndex, ChromaBoxYIndex); - - //Build index list for OrbWeaver - SetupKeyboardGrid(5, 4, OrbweaverXIndex, OrbweaverYIndex); - - //Build index list for Firefly - for (int x = 0; x < 15; x++) - { - if (x == 7) - { - FireflyIndex[x] = 128; - } - else if (x < 8) - { - FireflyIndex[x] = 7 + ((x+1) * 16); - } - else - { - FireflyIndex[x] = 8 + (x * 16); - } - } - - //Build index list for Nommo Pro - for (int x = 0; x < 8; x++) - { - if (x >= 4) - { - NommoProXIndex[x-4] = (x * (256 / 8)) + (256 / 16); - } - else - { - NommoProXIndex[x+(8-4)] = (x * (256 / 8)) + (256 / 16); - } - } - - //Build index list for Nommo Chroma - for (int x = 0; x < 24; x++) - { - if (x >= 10) - { - NommoChromaXIndex[x-10] = (x * (256 / 24)) + (256 / 48); - } - else - { - NommoChromaXIndex[x+(24-10)] = (x * (256 / 24)) + (256 / 48); - } - - } - - //Build index list for mice - for (int x = 0; x < 7; x++) - { - for (int y = 0; y < 9; y++) - { - //Set scroll wheel LED - if ((x == 3) && (y == 2)) - { - MouseXIndex[y][x] = 0; - MouseYIndex[y][x] = ROW_IDX_SINGLE_COLOR; - } - //Set logo LED - else if ((x == 3) && (y == 7)) - { - MouseXIndex[y][x] = 14 * 5; - MouseYIndex[y][x] = ROW_IDX_SINGLE_COLOR; - } - //Set keypad LED - else if ((x == 3) && (y == 4)) - { - MouseXIndex[y][x] = 14 * 5; - MouseYIndex[y][x] = ROW_IDX_SINGLE_COLOR; - } - //Set side LEDs - else if (((x == 0) || (x == 6)) && (y > 0) && (y < 8)) - { - MouseXIndex[y][x] = 14 * ( y ); - MouseYIndex[y][x] = ROW_IDX_BAR_GRAPH; - } - //Set bottom LEDs - else if ((y == 8) && (x > 0) && (x < 6)) - { - if ((x == 1) || (x == 5)) - { - MouseXIndex[y][x] = 14 * (y); - MouseYIndex[y][x] = ROW_IDX_BAR_GRAPH; - } - else if ((x == 2) || (x == 4)) - { - MouseXIndex[y][x] = 14 * (y + 1); - MouseYIndex[y][x] = ROW_IDX_BAR_GRAPH; - } - else if (x == 3) - { - MouseXIndex[y][x] = 14 * (y + 2); - MouseYIndex[y][x] = ROW_IDX_BAR_GRAPH; - } - } - } - } - - //Build index list for Core - for (int x = 0; x < 8; x++) - { - CoreXIndex[x] = (x * (256 / 8)) + (256 / 16); - } - - //Build index list for DeathStalker - for (int x = 0; x < 6; x++) - { - DeathStalkerXIndex[x] = 128 + (x * (256 / 12) + (256 / 24)); - } - - //Build index list for ChromaLink Matrix - for (int x = 0; x < ChromaSDK::ChromaLink::MAX_LEDS; x++) - { - ChromaLinkXIndex[x] = (x * (256 / ChromaSDK::ChromaLink::MAX_LEDS)) + (256 / (ChromaSDK::ChromaLink::MAX_LEDS * 2)); - } - - //Build index list for ChromaLink 1 Strip Bar Graph - for (int y = 0; y < 4; y++) - { - for (int x = 0; x < 16; x++) - { - ChromaBox1BarXIndex[y][x] = (x * (256 / 16)) + (256 / 32); - } - } - - //Build index list for ChromaLink 2 Strip Bar Graph - for (int y = 0; y < 4; y += 2) - { - for (int x = 0; x < 32; x++) - { - if (x < 16) - { - ChromaBox2BarXIndex[y][x] = (x * (256 / 32)) + (256 / 64); - } - else - { - ChromaBox2BarXIndex[y+1][x-16] = (x * (256 / 32)) + (256 / 64); - } - } - } - - //Build index list for ChromaLink 4 Strip Bar Graph - for (int x = 0; x < 64; x++) - { - if (x < 16) - { - ChromaBox4BarXIndex[0][15-x] = (x * (256 / 64)) + (256 / 128); - } - else if (x < 32) - { - ChromaBox4BarXIndex[1][15-(x-16)] = (x * (256 / 64)) + (256 / 128); - } - else if (x < 48) - { - ChromaBox4BarXIndex[2][x-32] = (x * (256 / 64)) + (256 / 128); - } - else - { - ChromaBox4BarXIndex[3][x-48] = (x * (256 / 64)) + (256 / 128); - } - } - } - } -} - - -bool RazerChroma::SetLEDs(COLORREF pixels[64][256]) -{ - CreateEffect = (CREATEEFFECT)GetProcAddress(hModule, "CreateEffect"); - CreateKeyboardEffect = (CREATEKEYBOARDEFFECT)GetProcAddress(hModule, "CreateKeyboardEffect"); - CreateMouseEffect = (CREATEMOUSEEFFECT)GetProcAddress(hModule, "CreateMouseEffect"); - CreateMousepadEffect = (CREATEMOUSEPADEFFECT)GetProcAddress(hModule, "CreateMousepadEffect"); - CreateHeadsetEffect = (CREATEHEADSETEFFECT)GetProcAddress(hModule, "CreateHeadsetEffect"); - CreateChromaLinkEffect = (CREATECHROMALINKEFFECT)GetProcAddress(hModule, "CreateChromaLinkEffect"); - - if (CreateEffect == NULL || pixels == NULL) - { - return FALSE; - } - else - { - //The use_generic_keyboard option uses the generic keyboard effect to apply the same pattern - //to all Chroma SDK supported keyboards. This effect is a workaround for missing Blade Stealth - //Kaby Lake support in the SDK, as the generic effect seems to be the only working way to - //support this product - if (use_keyboard_custom_effect) - { - //Blackwidow Chroma - ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE BlackWidowEffect; - - FillKeyboardGrid(22, 6, BlackWidowXIndex, BlackWidowYIndex, &BlackWidowEffect, pixels); - - //Set Razer "Three Headed Snake" logo to the background color of the 11th column - BlackWidowEffect.Color[0][20] = pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]; - - CreateEffect(ChromaSDK::BLACKWIDOW_CHROMA, ChromaSDK::CHROMA_CUSTOM, &BlackWidowEffect, NULL); - CreateEffect(ChromaSDK::BLACKWIDOW_X_CHROMA, ChromaSDK::CHROMA_CUSTOM, &BlackWidowEffect, NULL); - CreateEffect(ChromaSDK::BLACKWIDOW_X_TE_CHROMA, ChromaSDK::CHROMA_CUSTOM, &BlackWidowEffect, NULL); - CreateEffect(ChromaSDK::OVERWATCH_KEYBOARD, ChromaSDK::CHROMA_CUSTOM, &BlackWidowEffect, NULL); - CreateEffect(ChromaSDK::ORNATA_CHROMA, ChromaSDK::CHROMA_CUSTOM, &BlackWidowEffect, NULL); - - //Blackwidow Chroma Tournament Edition - ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE BlackWidowTEEffect; - - FillKeyboardGrid(18, 6, BlackWidowTEXIndex, BlackWidowTEYIndex, &BlackWidowTEEffect, pixels); - - //Set Razer "Three Headed Snake" logo to the background color of the 11th column - BlackWidowTEEffect.Color[0][20] = pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]; - - CreateEffect(ChromaSDK::BLACKWIDOW_CHROMA_TE, ChromaSDK::CHROMA_CUSTOM, &BlackWidowTEEffect, NULL); - - //Blade Stealth and Blade 14 - ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE BladeStealthEffect; - - FillKeyboardGrid(16, 6, BladeStealthXIndex, BladeStealthYIndex, &BladeStealthEffect, pixels); - - CreateEffect(ChromaSDK::BLADE_STEALTH, ChromaSDK::CHROMA_CUSTOM, &BladeStealthEffect, NULL); - CreateEffect(ChromaSDK::BLADE, ChromaSDK::CHROMA_CUSTOM, &BladeStealthEffect, NULL); - - //DeathStalker Chroma - ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE DeathStalkerEffect; - - for (int x = 0; x < 6; x++) - { - DeathStalkerEffect.Color[1][DeathStalkerXLEDIndex[x]] = (pixels[ROW_IDX_BAR_GRAPH][DeathStalkerXIndex[x]] & 0x00FFFFFF); - } - - CreateEffect(ChromaSDK::DEATHSTALKER_CHROMA, ChromaSDK::CHROMA_CUSTOM, &DeathStalkerEffect, NULL); - } - else - { - //Keyboard Effect - ChromaSDK::Keyboard::CUSTOM_EFFECT_TYPE KeyboardEffect; - - FillKeyboardGrid(22, 6, BlackWidowXIndex, BlackWidowYIndex, &KeyboardEffect, pixels); - //Set Razer "Three Headed Snake" logo to the background color of the 11th column - KeyboardEffect.Color[0][20] = pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]; - - CreateKeyboardEffect(ChromaSDK::Keyboard::CHROMA_CUSTOM, &KeyboardEffect, NULL); - } - - //Orbweaver Chroma - ChromaSDK::Keypad::CUSTOM_EFFECT_TYPE OrbweaverEffect; - - FillKeypadGrid(5, 4, OrbweaverXIndex, OrbweaverYIndex, &OrbweaverEffect, pixels); - - CreateEffect(ChromaSDK::ORBWEAVER_CHROMA, ChromaSDK::CHROMA_CUSTOM, &OrbweaverEffect, NULL); - - //Tartarus Chroma - ChromaSDK::Keypad::CUSTOM_EFFECT_TYPE TartarusEffect; - - TartarusEffect.Color[0][0] = pixels[ROW_IDX_SINGLE_COLOR][0]; - - CreateEffect(ChromaSDK::TARTARUS_CHROMA, ChromaSDK::CHROMA_CUSTOM, &TartarusEffect, NULL); - - //Firefly Chroma - ChromaSDK::Mousepad::CUSTOM_EFFECT_TYPE FireflyEffect = {}; - - for (int x = 0; x < 15; x++) - { - FireflyEffect.Color[x] = pixels[ROW_IDX_BAR_GRAPH][FireflyIndex[x]]; - } - - CreateMousepadEffect(ChromaSDK::Mousepad::CHROMA_CUSTOM, &FireflyEffect, NULL); - - //Razer Nommo Chroma - ChromaSDK::CUSTOM_EFFECT_TYPE NommoChromaEffect = {}; - - for (int x = 0; x < 24; x++) - { - NommoChromaEffect.Color[0][x] = pixels[ROW_IDX_BAR_GRAPH][NommoChromaXIndex[x]]; - NommoChromaEffect.Color[1][x] = pixels[ROW_IDX_BAR_GRAPH][NommoChromaXIndex[x]]; - } - - CreateEffect(ChromaSDK::NOMMO_CHROMA, ChromaSDK::CHROMA_CUSTOM, &NommoChromaEffect, NULL); - - //Razer Nommo Pro - ChromaSDK::CUSTOM_EFFECT_TYPE NommoProEffect = {}; - - for (int x = 0; x < 8; x++) - { - NommoProEffect.Color[0][x] = pixels[ROW_IDX_BAR_GRAPH][NommoProXIndex[x]]; - NommoProEffect.Color[1][x] = pixels[ROW_IDX_BAR_GRAPH][NommoProXIndex[x]]; - } - - CreateEffect(ChromaSDK::NOMMO_CHROMA_PRO, ChromaSDK::CHROMA_CUSTOM, &NommoProEffect, NULL); - - //Razer Core - ChromaSDK::Mousepad::CUSTOM_EFFECT_TYPE CoreEffect = {}; - - for (int x = 0; x < 8; x++) - { - CoreEffect.Color[x+3] = pixels[ROW_IDX_BAR_GRAPH][CoreXIndex[x]]; - } - - //Razer Core internal LEDs are a single color zone - CoreEffect.Color[2] = pixels[ROW_IDX_SINGLE_COLOR][0]; - - CreateEffect(ChromaSDK::CORE_CHROMA, ChromaSDK::CHROMA_CUSTOM, &CoreEffect, NULL); - - //Mamba Chroma Tournament Edition - ChromaSDK::Mouse::CUSTOM_EFFECT_TYPE2 MouseEffect = {}; - - for (int x = 0; x < 7; x++) - { - for (int y = 0; y < 9; y++) - { - MouseEffect.Color[y][x] = pixels[MouseYIndex[y][x]][MouseXIndex[y][x]]; - } - } - - CreateEffect(ChromaSDK::OROCHI_CHROMA, ChromaSDK::CHROMA_NONE, NULL, NULL); // Quick-fix for "lazy" Orochi Chroma color transition effect, see https://gfycat.com/DiscreteDisfiguredBluetickcoonhound - CreateMouseEffect(ChromaSDK::Mouse::CHROMA_CUSTOM2, &MouseEffect, NULL); - - //The Kraken 7.1 Chroma v1 headset (as well as possibly others) does not support custom effects. - //To work around this, I set a NONE effect followed by a STATIC effect, which instantly updates - //the color at the expense of a slight flicker. - //The Kraken 7.1 Chroma v2 does support custom effects, but using them means the v1 gets no - //pattern at all. Until the SDK is updated to break these two devices into separate IDs, - //I'm adding a workaround to select whether to use custom or static effects. - if (use_headset_custom_effect) - { - //Kraken Chroma V2 - ChromaSDK::Headset::STATIC_EFFECT_TYPE KrakenEffect; - - KrakenEffect.Color = pixels[ROW_IDX_SINGLE_COLOR][0]; - - CreateHeadsetEffect(ChromaSDK::Headset::CHROMA_CUSTOM, &KrakenEffect, NULL); - } - else - { - if (kraken_last_color != pixels[ROW_IDX_SINGLE_COLOR][0]) - { - if ((GetTickCount() - kraken_last_color_change) > 50) - { - //Kraken Chroma V1 - ChromaSDK::Headset::STATIC_EFFECT_TYPE KrakenEffect; - - KrakenEffect.Color = pixels[ROW_IDX_SINGLE_COLOR][0]; - - CreateHeadsetEffect(ChromaSDK::Headset::CHROMA_NONE, &KrakenEffect, NULL); - CreateHeadsetEffect(ChromaSDK::Headset::CHROMA_STATIC, &KrakenEffect, NULL); - kraken_last_color_change = GetTickCount(); - } - kraken_last_color = pixels[ROW_IDX_SINGLE_COLOR][0]; - } - } - - if (!disable_chromalink) - { - //Chroma Link SDK - ChromaSDK::ChromaLink::CUSTOM_EFFECT_TYPE ChromaLinkEffect = {}; - - for (int x = 0; x < ChromaSDK::ChromaLink::MAX_LEDS; x++) - { - if (use_chromalink_single_color) - { - ChromaLinkEffect.Color[x] = pixels[ROW_IDX_SINGLE_COLOR][ChromaLinkXIndex[x]]; - } - else - { - ChromaLinkEffect.Color[x] = pixels[ROW_IDX_BAR_GRAPH][ChromaLinkXIndex[x]]; - } - - } - CreateChromaLinkEffect(ChromaSDK::ChromaLink::CHROMA_CUSTOM, &ChromaLinkEffect, NULL); - } - - ChromaSDK::CUSTOM_EFFECT_TYPE ChromaBoxEffect; - - switch (chroma_box_mode) - { - case 0: - FillCustomGrid(16, 4, ChromaBoxXIndex, ChromaBoxYIndex, &ChromaBoxEffect, pixels); - break; - default: - case 1: - for (int x = 0; x < 16; x++) - { - for (int y = 0; y < 4; y++) - { - ChromaBoxEffect.Color[y][x] = pixels[ROW_IDX_BAR_GRAPH][ChromaBox1BarXIndex[y][x]]; - } - } - break; - case 2: - for (int x = 0; x < 16; x++) - { - for (int y = 0; y < 4; y++) - { - ChromaBoxEffect.Color[y][x] = pixels[ROW_IDX_BAR_GRAPH][ChromaBox2BarXIndex[y][x]]; - } - } - break; - case 3: - for (int x = 0; x < 16; x++) - { - for (int y = 0; y < 4; y++) - { - ChromaBoxEffect.Color[y][x] = pixels[ROW_IDX_BAR_GRAPH][ChromaBox4BarXIndex[y][x]]; - } - } - break; - } - - CreateEffect(ChromaSDK::CHROMABOX, ChromaSDK::CHROMA_CUSTOM, &ChromaBoxEffect, NULL); - - return TRUE; - } -}; \ No newline at end of file diff --git a/KeyboardVisualizerCommon/RazerChroma.h b/KeyboardVisualizerCommon/RazerChroma.h deleted file mode 100644 index 68b6c31..0000000 --- a/KeyboardVisualizerCommon/RazerChroma.h +++ /dev/null @@ -1,62 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Razer Chroma SDK Interface | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#ifndef RAZER_CHROMA_H -#define RAZER_CHROMA_H - -#include "..\KeyboardVisualizerVC\stdafx.h" - -#include "RzChromaSDKDefines.h" -#include "RzChromaSDKTypes.h" -#include "RzErrors.h" - -#include "VisualizerDefines.h" - -using namespace ChromaSDK::Keyboard; - -typedef RZRESULT(*INIT)(void); -typedef RZRESULT(*UNINIT)(void); -typedef RZRESULT(*CREATEEFFECT)(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); -typedef RZRESULT(*CREATEKEYBOARDEFFECT)(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); -typedef RZRESULT(*CREATEMOUSEEFFECT)(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); -typedef RZRESULT(*CREATEMOUSEPADEFFECT)(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); -typedef RZRESULT(*CREATEHEADSETEFFECT)(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); -typedef RZRESULT(*CREATECHROMALINKEFFECT)(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - -#ifdef _WIN64 -#define CHROMASDKDLL _T("RzChromaSDK64.dll") -#else -#define CHROMASDKDLL _T("RzChromaSDK.dll") -#endif - -class RazerChroma -{ -public: - RazerChroma(); - ~RazerChroma(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); - - bool use_keyboard_custom_effect; - bool use_headset_custom_effect; - bool use_chromalink_single_color; - int chroma_box_mode; - bool disable_chromalink; - -private: - HMODULE hModule = NULL; - CREATEEFFECT CreateEffect; - CREATEKEYBOARDEFFECT CreateKeyboardEffect; - CREATEMOUSEEFFECT CreateMouseEffect; - CREATEMOUSEPADEFFECT CreateMousepadEffect; - CREATEHEADSETEFFECT CreateHeadsetEffect; - CREATECHROMALINKEFFECT CreateChromaLinkEffect; - - RZEFFECTID effect; -}; - -#endif \ No newline at end of file diff --git a/KeyboardVisualizerCommon/RazerChromaLinux.cpp b/KeyboardVisualizerCommon/RazerChromaLinux.cpp deleted file mode 100644 index 767450d..0000000 --- a/KeyboardVisualizerCommon/RazerChromaLinux.cpp +++ /dev/null @@ -1,772 +0,0 @@ -#include "RazerChromaLinux.h" - -#include -#include -#include -#include -#include -#include - -enum -{ - RAZER_NO_DEVICE, - RAZER_BLACKWIDOW_CHROMA, - RAZER_DEATHSTALKER_CHROMA, - RAZER_ORNATA_CHROMA, - RAZER_BLADE_STEALTH, - RAZER_BLADE_PRO, - RAZER_TARTARUS_CHROMA, - RAZER_DEATHADDER_CHROMA, - RAZER_DEATHADDER_ELITE, - RAZER_NAGA_CHROMA, - RAZER_DIAMONDBACK_CHROMA, - RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA, - RAZER_FIREFLY_CHROMA, - RAZER_MUG_HOLDER, - RAZER_CORE, - RAZER_KRAKEN_V1, - RAZER_KRAKEN_V2, - RAZER_NUM_DEVICES -}; - -//Index lists for BlackWidow -int BlackWidowXIndex[22]; -int BlackWidowYIndex[6]; - -//Index lists for Blade -int BladeXIndex[16]; -int BladeYIndex[6]; - -//Index lists for Blade Pro 2016 -int BladeProXIndex[25]; -int BladeProYIndex[6]; - -//Index list for Firefly -int FireflyIndex[15]; - -//Index list for Razer Core -int CoreXIndex[8]; - -RazerChroma::RazerChroma() -{ - -} - -RazerChroma::~RazerChroma() -{ - -} - -void SetupKeyboardGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list) -{ - for (int x = 0; x < x_count; x++) - { - if (x < ((x_count) / 2)) - { - x_idx_list[x] = (x * (SPECTROGRAPH_COLS / (x_count - 1))) + (0.5f * (SPECTROGRAPH_COLS / (x_count - 1))); - } - else - { - x_idx_list[x] = (x * (SPECTROGRAPH_COLS / (x_count - 1))) - (0.5f * (SPECTROGRAPH_COLS / (x_count - 1))); - } - - } - for (int y = 0; y < y_count; y++) - { - y_idx_list[y] = ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / y_count)) + (0.5f * (SPECTROGRAPH_ROWS / y_count)); - } -} - -void RazerChroma::Initialize() -{ - char driver_path[512]; - DIR *dir; - struct dirent *ent; - int test_fd; - bool done = false; - int driver_to_read = 0; - - while(driver_to_read < 6) - { - switch(driver_to_read) - { - case 0: - strcpy(driver_path, "/sys/bus/hid/drivers/razerkbd/"); - break; - - case 1: - strcpy(driver_path, "/sys/bus/hid/drivers/razermouse/"); - break; - - case 2: - strcpy(driver_path, "/sys/bus/hid/drivers/razerfirefly/"); - break; - - case 3: - strcpy(driver_path, "/sys/bus/hid/drivers/razermug/"); - break; - - case 4: - strcpy(driver_path, "/sys/bus/hid/drivers/razercore/"); - break; - - case 5: - strcpy(driver_path, "/sys/bus/hid/drivers/razerkraken/"); - break; - } - - done = false; - - dir = opendir(driver_path); - - if(dir == NULL) - { - driver_to_read++; - continue; - } - - ent = readdir(dir); - - while(ent != NULL) - { - if(ent->d_type == DT_DIR || ent->d_type == DT_LNK) - { - if(!strcmp(ent->d_name, ".")) - { - if(done == false) - { - done = true; - } - else - { - break; - } - } - else if(!strcmp(ent->d_name, "..") || !strcmp(ent->d_name, "module")) - { - } - else - { - int device_type; - char device_string[1024]; - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/device_type"); - test_fd = open(device_string, O_RDONLY); - - if(test_fd) - { - read(test_fd, device_string, sizeof(device_string)); - close(test_fd); - - device_type = RAZER_NO_DEVICE; - - if(!strncmp(device_string, "Razer BlackWidow Chroma", strlen("Razer BlackWidow Chroma"))) - { - //Device is Razer BlackWidow Chroma - printf("BlackWidow Chroma Detected\r\n"); - - device_type = RAZER_BLACKWIDOW_CHROMA; - } - if(!strncmp(device_string, "Razer DeathStalker Chroma", strlen("Razer DeathStalker Chroma"))) - { - //Device is Razer DeathStalker Chroma - printf("DeathStalker Chroma Detected\r\n"); - - device_type = RAZER_DEATHSTALKER_CHROMA; - } - else if(!strncmp(device_string, "Razer Ornata Chroma", strlen("Razer Ornata Chroma"))) - { - //Device is Razer Ornata Chroma - printf("Ornata Chroma Detected\r\n"); - - device_type = RAZER_ORNATA_CHROMA; - } - else if(!strncmp(device_string, "Razer Blade Stealth", strlen("Razer Blade Stealth"))) - { - //Device is Razer Blade Stealth - printf("Blade Stealth Detected\r\n"); - - device_type = RAZER_BLADE_STEALTH; - } - else if(!strncmp(device_string, "Razer Blade Pro (Late 2016)", strlen("Razer Blade Pro (Late 2016)"))) - { - //Device is Razer Blade Pro 2016 - printf("Blade Pro 2016 Detected\r\n"); - - device_type = RAZER_BLADE_PRO; - } - else if(!strncmp(device_string, "Razer Tartarus Chroma", strlen("Razer Tartarus Chroma"))) - { - //Device is Razer Tartarus Chroma - printf("Tartarus Chroma Detected\r\n"); - - device_type = RAZER_TARTARUS_CHROMA; - } - else if(!strncmp(device_string, "Razer DeathAdder Chroma", strlen("Razer DeathAdder Chroma"))) - { - //Device is Razer DeathAdder Chroma - printf("DeathAdder Chroma Detected\r\n"); - - device_type = RAZER_DEATHADDER_CHROMA; - } - else if(!strncmp(device_string, "Razer DeathAdder Elite", strlen("Razer DeathAdder Elite"))) - { - //Device is Razer DeathAdder Elite - printf("DeathAdder Elite Detected\r\n"); - - device_type = RAZER_DEATHADDER_ELITE; - } - else if(!strncmp(device_string, "Razer Naga Chroma", strlen("Razer Naga Chroma"))) - { - //Device is Razer Naga Chroma - printf("Naga Chroma Detected\r\n"); - - device_type = RAZER_NAGA_CHROMA; - } - else if(!strncmp(device_string, "Razer Diamondback Chroma", strlen("Razer Diamondback Chroma"))) - { - //Device is Razer Diamondback Chroma - printf("Diamondback Chroma Detected\r\n"); - - device_type = RAZER_DIAMONDBACK_CHROMA; - } - else if(!strncmp(device_string, "Razer Mamba Tournament Edition", strlen("Razer Mamba Tournament Edition"))) - { - //Device is Razer Mamba Tournament Edition - printf("Mamba Tournament Edition Detected\r\n"); - - device_type = RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA; - } - else if(!strncmp(device_string, "Razer Firefly", strlen("Razer Firefly"))) - { - //Device is Razer Firefly - printf("Firefly Detected\r\n"); - - device_type = RAZER_FIREFLY_CHROMA; - } - else if(!strncmp(device_string, "Razer Chroma Mug Holder", strlen("Razer Chroma Mug Holder"))) - { - //Device is Razer Chroma Mug Holder - printf("Mug Holder Detected\r\n"); - - device_type = RAZER_MUG_HOLDER; - } - else if(!strncmp(device_string, "Razer Core", strlen("Razer Core"))) - { - //Device is Razer Core - printf("Core Detected\r\n"); - - device_type = RAZER_CORE; - } - else if(!strncmp(device_string, "Razer Kraken 7.1 Chroma", strlen("Razer Kraken 7.1 Chroma"))) - { - //Device is Razer Kraken 7.1 Chroma - printf("Kraken 7.1 Chroma Detected\r\n"); - - device_type = RAZER_KRAKEN_V1; - } - else if(!strncmp(device_string, "Razer Kraken 7.1 V2", strlen("Razer Kraken 7.1 V2"))) - { - //Device is Razer Kraken 7.1 V2 - printf("Kraken 7.1 V2 Detected\r\n"); - - device_type = RAZER_KRAKEN_V2; - } - - if(device_type != RAZER_NO_DEVICE) - { - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/device_serial"); - test_fd = open(device_string, O_RDONLY); - - printf("Reading serial from %s\r\n", device_string); - if(test_fd) - { - //Device has a serial number - bool match = false; - - //Serial numbers are 15 characters - char * serial = new char[16]; - read(test_fd, serial, 15); - close(test_fd); - - //Null terminate for printing - serial[15] = '\0'; - - //Make sure this serial number isn't already registered - for(unsigned int i = 0; i < razer_device_serial.size(); i++) - { - printf("Comparing serial %s with %s\r\n", serial, razer_device_serial[i]); - if(strncmp(serial, razer_device_serial[i], 15) == 0) - { - match = true; - } - } - - if(match) - { - printf("Ignoring duplicate serial %s\r\n", serial); - } - else - { - printf("Unique serial %s detected\r\n", serial); - - switch(device_type) - { - //Devices with custom effect type and matrix - case RAZER_BLACKWIDOW_CHROMA: - case RAZER_DEATHSTALKER_CHROMA: - case RAZER_ORNATA_CHROMA: - case RAZER_BLADE_STEALTH: - case RAZER_BLADE_PRO: - case RAZER_FIREFLY_CHROMA: - case RAZER_MUG_HOLDER: - case RAZER_CORE: - case RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA: - case RAZER_DIAMONDBACK_CHROMA: - { - //Device is unique, go ahead and register it - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/matrix_custom_frame"); - int fd_1 = open(device_string, O_WRONLY); - - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/matrix_effect_custom"); - int fd_2 = open(device_string, O_WRONLY); - - //We need placeholders for the unused update fds to keep the vectors the same length - int fd_3 = 0; - int fd_4 = 0; - - if(fd_1 && fd_2) - { - razer_device_serial.push_back(serial); - razer_device_type.push_back(device_type); - razer_fd_1.push_back(fd_1); - razer_fd_2.push_back(fd_2); - razer_fd_3.push_back(fd_3); - razer_fd_4.push_back(fd_4); - } - } - break; - - //Devices with only static effect - case RAZER_TARTARUS_CHROMA: - { - //Device is unique, go ahead and register it - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/matrix_effect_static"); - int fd_1 = open(device_string, O_WRONLY); - - //We need placeholders for the unused update fds to keep the vectors the same length - int fd_2 = 0; - int fd_3 = 0; - int fd_4 = 0; - - if(fd_1) - { - razer_device_serial.push_back(serial); - razer_device_type.push_back(device_type); - razer_fd_1.push_back(fd_1); - razer_fd_2.push_back(fd_2); - razer_fd_3.push_back(fd_3); - razer_fd_4.push_back(fd_4); - } - } - break; - - //Devices with only custom effect - case RAZER_KRAKEN_V1: - case RAZER_KRAKEN_V2: - { - //Device is unique, go ahead and register it - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/matrix_effect_custom"); - int fd_1 = open(device_string, O_WRONLY); - - //We need placeholders for the unused update fds to keep the vectors the same length - int fd_2 = 0; - int fd_3 = 0; - int fd_4 = 0; - - if(fd_1) - { - razer_device_serial.push_back(serial); - razer_device_type.push_back(device_type); - razer_fd_1.push_back(fd_1); - razer_fd_2.push_back(fd_2); - razer_fd_3.push_back(fd_3); - razer_fd_4.push_back(fd_4); - } - } - break; - //Devices with logo LED rgb and effect parameters - case RAZER_DEATHADDER_CHROMA: - case RAZER_NAGA_CHROMA: - case RAZER_DEATHADDER_ELITE: - { - //Device is unique, go ahead and register it - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/logo_led_rgb"); - int fd_1 = open(device_string, O_WRONLY); - - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/logo_led_effect"); - int fd_2 = open(device_string, O_WRONLY); - - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/scroll_led_rgb"); - int fd_3 = open(device_string, O_WRONLY); - - strcpy(device_string, driver_path); - strcat(device_string, ent->d_name); - strcat(device_string, "/scroll_led_effect"); - int fd_4 = open(device_string, O_WRONLY); - - if(fd_1 && fd_2 && fd_3 && fd_4) - { - razer_device_serial.push_back(serial); - razer_device_type.push_back(device_type); - razer_fd_1.push_back(fd_1); - razer_fd_2.push_back(fd_2); - razer_fd_3.push_back(fd_3); - razer_fd_4.push_back(fd_4); - } - } - break; - } - } - } - } - } - } - } - ent = readdir(dir); - } - driver_to_read++; - } - - - //Build index list for BlackWidow - SetupKeyboardGrid(22, 6, BlackWidowXIndex, BlackWidowYIndex); - - //Build index list for Blade - SetupKeyboardGrid(16, 6, BladeXIndex, BladeYIndex); - - //Build index list for Blade Pro 2016 - SetupKeyboardGrid(25, 6, BladeProXIndex, BladeProYIndex); - - //Build index list for Firefly - for (int x = 0; x < 15; x++) - { - if (x == 7) - { - FireflyIndex[x] = 128; - } - else if (x < 8) - { - FireflyIndex[x] = 7 + ((x+1) * 16); - } - else - { - FireflyIndex[x] = 8 + (x * 16); - } - } - - //Build index list for Core - for (int x = 0; x < 8; x++) - { - CoreXIndex[x] = (x * (256 / 8)) + (256 / 16); - } -} - -bool RazerChroma::SetLEDs(COLORREF pixels[64][256]) -{ - { - for(unsigned int i = 0; i < razer_fd_1.size(); i++) - { - switch(razer_device_type[i]) - { - case RAZER_ORNATA_CHROMA: - case RAZER_BLACKWIDOW_CHROMA: - { - char BlackWidowEffect[((3 * 22)) + 3]; - - BlackWidowEffect[1] = 0; - BlackWidowEffect[2] = 21; - - for(int y = 0; y < 6; y++) - { - BlackWidowEffect[0] = y; - - for(int x = 0; x < 22; x++) - { - BlackWidowEffect[3 + (x * 3)] = GetRValue(pixels[BlackWidowYIndex[y]][BlackWidowXIndex[x]]); - BlackWidowEffect[4 + (x * 3)] = GetGValue(pixels[BlackWidowYIndex[y]][BlackWidowXIndex[x]]); - BlackWidowEffect[5 + (x * 3)] = GetBValue(pixels[BlackWidowYIndex[y]][BlackWidowXIndex[x]]); - - if(y == 0 && x == 20) - { - BlackWidowEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]); - BlackWidowEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]); - BlackWidowEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][11 * (256 / 22)]); - } - } - - write(razer_fd_1[i], &BlackWidowEffect, sizeof(BlackWidowEffect)); - } - write(razer_fd_2[i], &BlackWidowEffect, 1); - } - break; - - case RAZER_BLADE_STEALTH: - { - char BladeEffect[((3 * 16)) + 3]; - - BladeEffect[1] = 0; - BladeEffect[2] = 15; - - for(int y = 0; y < 6; y++) - { - BladeEffect[0] = y; - - for(int x = 0; x < 16; x++) - { - BladeEffect[3 + (x * 3)] = GetRValue(pixels[BladeYIndex[y]][BladeXIndex[x]]); - BladeEffect[4 + (x * 3)] = GetGValue(pixels[BladeYIndex[y]][BladeXIndex[x]]); - BladeEffect[5 + (x * 3)] = GetBValue(pixels[BladeYIndex[y]][BladeXIndex[x]]); - } - - write(razer_fd_1[i], &BladeEffect, sizeof(BladeEffect)); - } - write(razer_fd_2[i], &BladeEffect, 1); - } - break; - - case RAZER_BLADE_PRO: - { - char BladeEffect[((3 * 25)) + 3]; - - BladeEffect[1] = 0; - BladeEffect[2] = 24; - - for(int y = 0; y < 6; y++) - { - BladeEffect[0] = y; - - for(int x = 0; x < 25; x++) - { - BladeEffect[3 + (x * 3)] = GetRValue(pixels[BladeProYIndex[y]][BladeProXIndex[x]]); - BladeEffect[4 + (x * 3)] = GetGValue(pixels[BladeProYIndex[y]][BladeProXIndex[x]]); - BladeEffect[5 + (x * 3)] = GetBValue(pixels[BladeProYIndex[y]][BladeProXIndex[x]]); - } - - write(razer_fd_1[i], &BladeEffect, sizeof(BladeEffect)); - } - write(razer_fd_2[i], &BladeEffect, 1); - } - break; - - case RAZER_DEATHSTALKER_CHROMA: - { - char DeathStalkerEffect[(3 * 12) + 3]; - - DeathStalkerEffect[0] = 0; - DeathStalkerEffect[1] = 0; - DeathStalkerEffect[2] = 11; - - for(int x = 0; x < 12; x++) - { - DeathStalkerEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][(11 - x) * (128 / 12)]); - DeathStalkerEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][(11 - x) * (128 / 12)]); - DeathStalkerEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][(11 - x) * (128 / 12)]); - } - - write(razer_fd_1[i], &DeathStalkerEffect, sizeof(DeathStalkerEffect)); - write(razer_fd_2[i], &DeathStalkerEffect, 1); - } - break; - - case RAZER_FIREFLY_CHROMA: - case RAZER_MUG_HOLDER: - { - char FireflyEffect[(3 * 15) + 3]; - - FireflyEffect[0] = 0; - FireflyEffect[1] = 0; - FireflyEffect[2] = 14; - - for(int x = 0; x < 15; x++) - { - FireflyEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][FireflyIndex[x]]); - FireflyEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][FireflyIndex[x]]); - FireflyEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][FireflyIndex[x]]); - } - - write(razer_fd_1[i], &FireflyEffect, sizeof(FireflyEffect)); - write(razer_fd_2[i], &FireflyEffect, 1); - } - break; - - case RAZER_CORE: - { - char CoreEffect[(3 * 9) + 3]; - - CoreEffect[0] = 0; - CoreEffect[1] = 0; - CoreEffect[2] = 8; - - CoreEffect[3] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - CoreEffect[4] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - CoreEffect[5] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - - for (int x = 0; x < 8; x++) - { - CoreEffect[6 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][CoreXIndex[x]]); - CoreEffect[7 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][CoreXIndex[x]]); - CoreEffect[8 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][CoreXIndex[x]]); - } - - write(razer_fd_1[i], &CoreEffect, sizeof(CoreEffect)); - write(razer_fd_2[i], &CoreEffect, 1); - } - break; - - case RAZER_MAMBA_TOURNAMENT_EDITION_CHROMA: - { - char MambaTEEffect[(3 * 16) + 3]; - - MambaTEEffect[0] = 0; - MambaTEEffect[1] = 0; - MambaTEEffect[2] = 15; - - for(int x = 0; x < 16; x++) - { - if(x < 7) - { - MambaTEEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][x * (128 / 7)]); - MambaTEEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][x * (128 / 7)]); - MambaTEEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][x * (128 / 7)]); - } - else if(x < 14) - { - MambaTEEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][(x - 7) * (128 / 7)]); - MambaTEEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][(x - 7) * (128 / 7)]); - MambaTEEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][(x - 7) * (128 / 7)]); - } - else if(x == 14) - { - MambaTEEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - MambaTEEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - MambaTEEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - } - else if(x == 15) - { - MambaTEEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - MambaTEEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - MambaTEEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - } - } - - write(razer_fd_1[i], &MambaTEEffect, sizeof(MambaTEEffect)); - write(razer_fd_2[i], &MambaTEEffect, 1); - } - break; - - case RAZER_DIAMONDBACK_CHROMA: - { - char DiamondbackEffect[(3 * 21) + 3]; - - DiamondbackEffect[0] = 0; - DiamondbackEffect[1] = 0; - DiamondbackEffect[2] = 20; - - for(int x = 0; x < 21; x++) - { - if(x < 9) - { - DiamondbackEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][(x * (128 / 9)) + (128/18)]); - DiamondbackEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][(x * (128 / 9)) + (128/18)]); - DiamondbackEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][(x * (128 / 9)) + (128/18)]); - } - else if(x == 9) - { - DiamondbackEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][128]); - DiamondbackEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][128]); - DiamondbackEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][128]); - } - else if(x < 19) - { - DiamondbackEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_BAR_GRAPH][((18 - x) * (128 / 9)) + (128/18)]); - DiamondbackEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_BAR_GRAPH][((18 - x) * (128 / 9)) + (128/18)]); - DiamondbackEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_BAR_GRAPH][((18 - x) * (128 / 9)) + (128/18)]); - } - else if(x == 19) - { - DiamondbackEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - DiamondbackEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - DiamondbackEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][14 * 5]); - } - else if(x == 20) - { - DiamondbackEffect[3 + (x * 3)] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - DiamondbackEffect[4 + (x * 3)] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - DiamondbackEffect[5 + (x * 3)] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - } - } - - write(razer_fd_1[i], &DiamondbackEffect, sizeof(DiamondbackEffect)); - write(razer_fd_2[i], &DiamondbackEffect, 1); - } - break; - - case RAZER_TARTARUS_CHROMA: - case RAZER_KRAKEN_V1: - case RAZER_KRAKEN_V2: - { - char TartarusEffect[3]; - - TartarusEffect[0] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - TartarusEffect[1] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - TartarusEffect[2] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - - write(razer_fd_1[i], &TartarusEffect, sizeof(TartarusEffect)); - } - break; - - case RAZER_DEATHADDER_CHROMA: - case RAZER_NAGA_CHROMA: - case RAZER_DEATHADDER_ELITE: - { - char DeathAdderEffect[3]; - - DeathAdderEffect[0] = 3; - write(razer_fd_2[i], &DeathAdderEffect, 1); - write(razer_fd_4[i], &DeathAdderEffect, 1); - - DeathAdderEffect[0] = GetRValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - DeathAdderEffect[1] = GetGValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - DeathAdderEffect[2] = GetBValue(pixels[ROW_IDX_SINGLE_COLOR][0]); - - write(razer_fd_1[i], &DeathAdderEffect, sizeof(DeathAdderEffect)); - write(razer_fd_3[i], &DeathAdderEffect, sizeof(DeathAdderEffect)); - - DeathAdderEffect[0] = 0; - write(razer_fd_2[i], &DeathAdderEffect, 1); - write(razer_fd_4[i], &DeathAdderEffect, 1); - } - break; - } - } - return true; - } -} diff --git a/KeyboardVisualizerCommon/RazerChromaLinux.h b/KeyboardVisualizerCommon/RazerChromaLinux.h deleted file mode 100644 index 34f8c8c..0000000 --- a/KeyboardVisualizerCommon/RazerChromaLinux.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RAZERCHROMALINUX_H -#define RAZERCHROMALINUX_H - -#include "VisualizerDefines.h" -#include - -class RazerChroma -{ -public: - RazerChroma(); - ~RazerChroma(); - - void Initialize(); - bool SetLEDs(COLORREF pixels[64][256]); - -private: - std::vector razer_fd_1; - std::vector razer_fd_2; - std::vector razer_fd_3; - std::vector razer_fd_4; - std::vector razer_device_type; - std::vectorrazer_device_serial; -}; - -#endif // RAZERCHROMALINUX_H diff --git a/KeyboardVisualizerCommon/SteelSeriesGameSense.cpp b/KeyboardVisualizerCommon/SteelSeriesGameSense.cpp deleted file mode 100644 index 6f66bf7..0000000 --- a/KeyboardVisualizerCommon/SteelSeriesGameSense.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for SteelSeries Apex M800 | -| | -| saltybot@gmail.com, 12/13/2016 | -\*---------------------------------------------------------*/ - -#include "SteelSeriesGameSense.h" -#include "VisualizerDefines.h" - -#include "UsbDevice.h" - -UsbDevice usb; - -namespace -{ -const int ROWS = 6; -const int COLS = 23; - -bool init_ok = false; - -int y_idx_list[ROWS]; -int x_idx_list[COLS]; - -const unsigned char APEX_M800_KEYMAP_US[ROWS][COLS] = { - 0xe8, 0x29, 0xff, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0xff, 0x00, 0xff, 0xff, - 0xe9, 0x35, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2d, 0x2e, 0xff, 0x2a, 0x49, 0x4a, 0x4b, 0x53, 0x54, 0x55, 0x56, - 0xea, 0x2b, 0x14, 0x1a, 0x08, 0x15, 0x17, 0x1c, 0x18, 0x0c, 0x12, 0x13, 0x2f, 0x30, 0xff, 0x31, 0x4c, 0x4d, 0x4e, 0x5f, 0x60, 0x61, 0x57, - 0xeb, 0x39, 0x04, 0x16, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x33, 0x34, 0xff, 0xff, 0x28, 0xff, 0xff, 0xff, 0x5c, 0x5d, 0x5e, 0xff, - 0xec, 0xe1, 0xff, 0x1d, 0x1b, 0x06, 0x19, 0x05, 0x11, 0x10, 0x36, 0x37, 0x38, 0xe5, 0xff, 0xff, 0xff, 0x52, 0xff, 0x59, 0x5a, 0x5b, 0x58, - 0xed, 0xe0, 0xe3, 0xff, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xe7, 0x65, 0xef, 0xe4, 0x50, 0x51, 0x4f, 0x62, 0xff, 0x63, 0xff -}; - -const unsigned char APEX_M800_KEYMAP_UK[ROWS][COLS] = { - 0xe8, 0x29, 0xff, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0xff, 0x00, 0xff, 0xff, - 0xe9, 0x35, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2d, 0x2e, 0xff, 0x2a, 0x49, 0x4a, 0x4b, 0x53, 0x54, 0x55, 0x56, - 0xea, 0x2b, 0x14, 0x1a, 0x08, 0x15, 0x17, 0x1c, 0x18, 0x0c, 0x12, 0x13, 0x2f, 0xff, 0xff, 0x31, 0x4c, 0x4d, 0x4e, 0x5f, 0x60, 0x61, 0x57, - 0xeb, 0x39, 0x04, 0x16, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x33, 0x32, 0x34, 0xff, 0x28, 0xff, 0xff, 0xff, 0x5c, 0x5d, 0x5e, 0xff, - 0xec, 0xe1, 0x30, 0x1d, 0x1b, 0x06, 0x19, 0x05, 0x11, 0x10, 0x36, 0x37, 0x38, 0xe5, 0xff, 0xff, 0xff, 0x52, 0xff, 0x59, 0x5a, 0x5b, 0x58, - 0xed, 0xe0, 0xe3, 0xff, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xe7, 0x65, 0xef, 0xe4, 0x50, 0x51, 0x4f, 0x62, 0xff, 0x63, 0xff -}; - -const unsigned char(*KeyMap)[ROWS][COLS]; - -} - -SteelSeriesGameSense::SteelSeriesGameSense() -{ - KeyMap = &APEX_M800_KEYMAP_US; -} - -SteelSeriesGameSense::~SteelSeriesGameSense() -{ - ResetLighting(); -} - -void SteelSeriesGameSense::Initialize() -{ - init_ok = usb.OpenDevice(0x1038, 0x1600, 0x0000); - - for (int y = 0; y < ROWS; y++) - { - y_idx_list[y] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / ROWS)) + (0.5f * (SPECTROGRAPH_ROWS / ROWS))); - } - for (int x = 0; x < COLS; x++) - { - x_idx_list[x] = x * (SPECTROGRAPH_END / COLS); - } - - SetMode(0x02); - - ResetLighting(); -} - -void SteelSeriesGameSense::SetKeyboardLayout(SS_KEYBOARD_LAYOUT layout) -{ - switch (layout) - { - case SS_APEX_M800_LAYOUT_US: - KeyMap = &APEX_M800_KEYMAP_US; - break; - case SS_APEX_M800_LAYOUT_UK: - KeyMap = &APEX_M800_KEYMAP_UK; - break; - default: - break; - } -} - -bool SteelSeriesGameSense::SetLEDs(COLORREF pixels[64][256]) -{ - if(!init_ok) - { - return false; - } - - memset(FeatureReportBuf, 0, sizeof(FeatureReportBuf)); - FeatureReportBuf[0] = 0x00; - FeatureReportBuf[1] = 0x0c; - FeatureReportBuf[2] = 0x00; - FeatureReportBuf[3] = 0x6e; - FeatureReportBuf[4] = 0x00; - - int i = 5; - - for (int y = 0; y < ROWS; y++) - { - for (int x = 0; x < COLS; x++) - { - unsigned char key = (*KeyMap)[y][x]; - if (key != 0xff) - { - COLORREF color = pixels[y_idx_list[y]][x_idx_list[x]]; - FeatureReportBuf[i++] = key; - FeatureReportBuf[i++] = GetRValue(color); - FeatureReportBuf[i++] = GetGValue(color); - FeatureReportBuf[i++] = GetBValue(color); - } - } - } - - return (usb.SendToDevice(FeatureReportBuf, sizeof(FeatureReportBuf))) ? true : false; -} - -void SteelSeriesGameSense::SetMode(unsigned char mode) -{ - if (init_ok) - { - memset(FeatureReportBuf, 0, sizeof(FeatureReportBuf)); - FeatureReportBuf[0] = 0x00; - FeatureReportBuf[1] = 0x0e; - FeatureReportBuf[2] = 0x00; - FeatureReportBuf[3] = 0x2a; - FeatureReportBuf[4] = 0x00; - - int stride = 12; - for (int y = 0; y < ROWS; ++y) - { - int i = 5; - memset(&FeatureReportBuf[i], 0, COLS * stride); - - for (int x = 0; x < COLS; ++x) - { - unsigned char key = (*KeyMap)[y][x]; - if (key != 0xff) - { - FeatureReportBuf[i + 9] = mode; - FeatureReportBuf[i + 11] = key; - i += stride; - } - } - - FeatureReportBuf[3] = i / stride; - - usb.SendToDevice(FeatureReportBuf, sizeof(FeatureReportBuf)); - Sleep(10); - } - } -} - -void SteelSeriesGameSense::ResetLighting() -{ - if (init_ok) - { - unsigned char buf[33]; - memset(buf, 0, sizeof(buf)); - buf[0] = 0x00; - buf[1] = 0x0d; - buf[2] = 0x00; - buf[3] = 0x00; - - //HidD_SetOutputReport(Dev, buf, sizeof(buf)); - } -} diff --git a/KeyboardVisualizerCommon/SteelSeriesGameSense.h b/KeyboardVisualizerCommon/SteelSeriesGameSense.h deleted file mode 100644 index 93e4b9b..0000000 --- a/KeyboardVisualizerCommon/SteelSeriesGameSense.h +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for SteelSeries Apex M800 | -| | -| saltybot@gmail.com, 12/13/2016 | -\*---------------------------------------------------------*/ - -#ifndef STEELSERIESGAMESENSE_H -#define STEELSERIESGAMESENSE_H - -#include -#include -#include -#include "VisualizerDefines.h" - -enum SS_KEYBOARD_LAYOUT -{ - SS_APEX_M800_LAYOUT_US, - SS_APEX_M800_LAYOUT_UK -}; - -class SteelSeriesGameSense -{ -public: - SteelSeriesGameSense(); - ~SteelSeriesGameSense(); - - void Initialize(); - void SetKeyboardLayout(SS_KEYBOARD_LAYOUT layout); - bool SetLEDs(COLORREF pixels[64][256]); - -private: - void ResetLighting(); - void SetMode(unsigned char mode); - - unsigned char FeatureReportBuf[515]; -}; - -#endif diff --git a/KeyboardVisualizerCommon/UsbDevice.cpp b/KeyboardVisualizerCommon/UsbDevice.cpp deleted file mode 100644 index 90839c5..0000000 --- a/KeyboardVisualizerCommon/UsbDevice.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include "UsbDevice.h" - -//Helper functions for native Windows USB -//These functions courtesy of http://www.reddit.com/user/chrisgzy -#if defined(WIN32) && !defined(HIDAPI) -#pragma comment(lib, "hid.lib") -#pragma comment(lib, "setupapi.lib") - -bool IsMatchingDevice(wchar_t *pDeviceID, unsigned int uiVID, unsigned int uiPID, unsigned int uiMI) -{ - unsigned int uiLocalVID = 0, uiLocalPID = 0, uiLocalMI = 0; - - LPWSTR pszNextToken = 0; - LPWSTR pszToken = wcstok(pDeviceID, L"\\#&"); - while (pszToken) - { - std::wstring tokenStr(pszToken); - if (tokenStr.find(L"VID_", 0, 4) != std::wstring::npos) - { - std::wistringstream iss(tokenStr.substr(4)); - iss >> std::hex >> uiLocalVID; - } - else if (tokenStr.find(L"PID_", 0, 4) != std::wstring::npos) - { - std::wistringstream iss(tokenStr.substr(4)); - iss >> std::hex >> uiLocalPID; - } - else if (tokenStr.find(L"MI_", 0, 3) != std::wstring::npos) - { - std::wistringstream iss(tokenStr.substr(3)); - iss >> std::hex >> uiLocalMI; - } - - pszToken = wcstok(0, L"\\#&"); - } - - if (uiVID != uiLocalVID || uiPID != uiLocalPID || uiMI != uiLocalMI) - return false; - - return true; -} - -HANDLE GetDeviceHandle(unsigned int uiVID, unsigned int uiPID, unsigned int uiMI) -{ - const GUID GUID_DEVINTERFACE_HID = { 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 }; - HDEVINFO hDevInfo = SetupDiGetClassDevs(&GUID_DEVINTERFACE_HID, 0, 0, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); - if (hDevInfo == INVALID_HANDLE_VALUE) - return 0; - - HANDLE hReturn = 0; - - SP_DEVINFO_DATA deviceData = { 0 }; - deviceData.cbSize = sizeof(SP_DEVINFO_DATA); - - for (unsigned int i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &deviceData); ++i) - { - wchar_t wszDeviceID[MAX_DEVICE_ID_LEN]; - if (CM_Get_Device_IDW(deviceData.DevInst, wszDeviceID, MAX_DEVICE_ID_LEN, 0)) - continue; - - if (!IsMatchingDevice(wszDeviceID, uiVID, uiPID, uiMI)) - continue; - - SP_INTERFACE_DEVICE_DATA interfaceData = { 0 }; - interfaceData.cbSize = sizeof(SP_INTERFACE_DEVICE_DATA); - - if (!SetupDiEnumDeviceInterfaces(hDevInfo, &deviceData, &GUID_DEVINTERFACE_HID, 0, &interfaceData)) - break; - - DWORD dwRequiredSize = 0; - SetupDiGetDeviceInterfaceDetail(hDevInfo, &interfaceData, 0, 0, &dwRequiredSize, 0); - - SP_INTERFACE_DEVICE_DETAIL_DATA *pData = (SP_INTERFACE_DEVICE_DETAIL_DATA *)new unsigned char[dwRequiredSize]; - pData->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA); - - if (!SetupDiGetDeviceInterfaceDetail(hDevInfo, &interfaceData, pData, dwRequiredSize, 0, 0)) - { - delete pData; - break; - } - - HANDLE hDevice = CreateFile(pData->DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); - if (hDevice == INVALID_HANDLE_VALUE) - { - delete pData; - break; - } - - hReturn = hDevice; - break; - } - - SetupDiDestroyDeviceInfoList(hDevInfo); - - return hReturn; -} -#endif - -UsbDevice::UsbDevice() -{ - -} - -bool UsbDevice::OpenDevice(unsigned short vendor, unsigned short product, unsigned int MI) -{ -#ifdef HIDAPI - device = hid_open(vendor, product, 0); - - if (device == NULL) - { - return false; - } - - return true; -#elif defined(WIN32) - handle = GetDeviceHandle(vendor, product, MI); - - if (handle == NULL) - { - return false; - } - - return true; -#endif -} - -bool UsbDevice::SendToDevice(unsigned char* data, unsigned int length) -{ -#ifdef HIDAPI - hid_send_feature_report(device, data, length); - return true; -#elif defined(WIN32) - return(HidD_SetFeature(handle, data, length)); -#endif -} diff --git a/KeyboardVisualizerCommon/UsbDevice.h b/KeyboardVisualizerCommon/UsbDevice.h deleted file mode 100644 index 97709c1..0000000 --- a/KeyboardVisualizerCommon/UsbDevice.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef USB_DEVICE_H -#define USB_DEVICE_H - -#ifndef WIN32 -#define HIDAPI -#endif - -#include -#ifdef HIDAPI -#include -#elif defined(WIN32) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -class UsbDevice -{ -public: - UsbDevice(); - - bool OpenDevice(unsigned short vendor, unsigned short product, unsigned int MI); - - bool SendToDevice(unsigned char* data, unsigned int length); - -private: -#ifdef HIDAPI - hid_device* device; -#elif defined(WIN32) - HANDLE handle; -#endif - -}; -#endif diff --git a/KeyboardVisualizerCommon/Visualizer.cpp b/KeyboardVisualizerCommon/Visualizer.cpp index 04fe7eb..1514f8b 100644 --- a/KeyboardVisualizerCommon/Visualizer.cpp +++ b/KeyboardVisualizerCommon/Visualizer.cpp @@ -6,269 +6,32 @@ #include "Visualizer.h" -//Thread functions have different types in Windows and Linux -#ifdef WIN32 -#define THREAD static void -#define THREADRETURN -#else -#define THREAD static void* -#define THREADRETURN return(NULL); -#endif - -//Include pthread and Unix standard libraries if not building for Windows -#ifndef WIN32 -#include "pthread.h" -#include "unistd.h" -#endif - -//Includes for devices supported only under Windows -#ifdef WIN32 -#include "RazerChroma.h" -#include "CorsairCUE.h" -#include "CmKeyboard.h" -#include "LogitechSDK.h" -#include "AsusAuraSDK.h" - -//Includes for devices supported only under Linux -#else -#include "RazerChromaLinux.h" -#include "CorsairCKBLinux.h" -#endif - -//Includes for devices supported on both Windows and Linux -#include "SteelSeriesGameSense.h" -#include "MSIKeyboard.h" -#include "PoseidonZRGBKeyboard.h" -#include "LEDStrip.h" - -//Devices supported only under Windows -#ifdef WIN32 -CorsairCUE ckb; -CmKeyboard cmkb; -LogitechSDK lkb; -AsusAuraSDK asa; - -//Devices supported only under Linux -#else -CorsairCKB ckb; -#endif - -//Devices supported on both Windows and Linux -RazerChroma rkb; -SteelSeriesGameSense skb; -MSIKeyboard mkb; -PoseidonZRGBKeyboard pkb; -std::vector str; - -std::vector device_properties; - -char * net_string; -int ledstrip_sections_size = 1; -int matrix_setup_pos; -int matrix_setup_size; -float fft_nrml[256]; -float fft_fltr[256]; -bool ledstrip_mirror_x = false; -bool ledstrip_mirror_y = false; -bool ledstrip_single_color = false; -int ledstrip_rotate_x = 0; - -//Threads for Visualizer.cpp -THREAD thread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->VisThread(); - THREADRETURN -} - -THREAD netconthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->NetConnectThread(); - THREADRETURN -} - -THREAD netupdthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->NetUpdateThread(); - THREADRETURN -} - -//Threads for devices supported only under Windows -#ifdef WIN32 -THREAD cmkbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->CmKeyboardUpdateThread(); - THREADRETURN -} - -THREAD lkbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->LogitechSDKUpdateThread(); - THREADRETURN -} - -THREAD asathread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->AuraSDKUpdateThread(); - THREADRETURN -} - -//Threads for devices supported only under Linux -#else - +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 #endif -//Threads for devices supported on both Windows and Linux -THREAD rkbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->RazerChromaUpdateThread(); - THREADRETURN -} - -THREAD ckbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->CorsairKeyboardUpdateThread(); - THREADRETURN -} - -THREAD skbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->SteelSeriesKeyboardUpdateThread(); - THREADRETURN -} - -THREAD mkbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->MSIKeyboardUpdateThread(); - THREADRETURN -} - -THREAD pkbthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->PoseidonZRGBKeyboardUpdateThread(); - THREADRETURN -} - -THREAD lsthread(void *param) -{ - Visualizer* vis = static_cast(param); - vis->LEDStripUpdateThread(); - THREADRETURN -} - -//Visualizer class functions start here +/*---------------------------------------------------------*\ +| Global variables | +\*---------------------------------------------------------*/ +int ledstrip_sections_size = 1; +int matrix_setup_pos; +int matrix_setup_size; +float fft_nrml[256]; +float fft_fltr[256]; +bool ledstrip_mirror_x = false; +bool ledstrip_mirror_y = false; +bool ledstrip_single_color = false; +int ledstrip_rotate_x = 0; +/*---------------------------------------------------------*\ +| Visualizer class implementation | +\*---------------------------------------------------------*/ Visualizer::Visualizer() { } -void Visualizer::BeginLEDMatrix(int size) -{ - matrix_setup_size = size; - matrix_setup_pos = 1; -} - -void Visualizer::LEDStripSections(int size) -{ - ledstrip_sections_size = size; -} - -void Visualizer::LEDMirrorX() -{ - ledstrip_mirror_x = true; -} - -void Visualizer::LEDMirrorY() -{ - ledstrip_mirror_y = true; -} - -void Visualizer::LEDSingleColor() -{ - ledstrip_single_color = true; -} - -void Visualizer::LEDRotateX(int rotate) -{ - ledstrip_rotate_x = rotate; -} - -void Visualizer::AddLEDStrip(int led_type, char* ledstring) -{ - //Scan through already registered LED strips and - //verify that the port name is not already in use - for (unsigned int i = 0; i < str.size(); i++) - { - if (strcmp(str[i]->GetLEDString(), ledstring) == 0) - { - return; - } - } - - LEDStrip *newstr = new LEDStrip(); - newstr->Initialize(led_type, ledstring, matrix_setup_size, matrix_setup_pos, ledstrip_sections_size, ledstrip_rotate_x, ledstrip_mirror_x, ledstrip_mirror_y, ledstrip_single_color); - str.push_back(newstr); - - ledstrip_sections_size = 1; - ledstrip_mirror_x = false; - ledstrip_mirror_y = false; - ledstrip_single_color = false; - ledstrip_rotate_x = 0; - - if (matrix_setup_pos < matrix_setup_size) - { - matrix_setup_pos += ledstrip_sections_size; - } - else - { - matrix_setup_size = 0; - matrix_setup_pos = 0; - } -} - -void Visualizer::SetDeviceProperty(char * devprop, char * argument) -{ - //Save device property to list of device properties - char * buf = new char[strlen(devprop) + 1]; - strcpy(buf, devprop); - device_properties.push_back(buf); - - //Parse device properties exclusive to Windows -#ifdef WIN32 - if (strcmp(devprop, "razer_use_keyboard_custom_effect") == 0) - { - rkb.use_keyboard_custom_effect = true; - } - else if (strcmp(devprop, "razer_use_headset_custom_effect") == 0) - { - rkb.use_headset_custom_effect = true; - } - else if (strcmp(devprop, "razer_use_chromalink_single_color") == 0) - { - rkb.use_chromalink_single_color = true; - } - else if (strcmp(devprop, "razer_disable_chromalink") == 0) - { - rkb.disable_chromalink = true; - } - else if (strcmp(devprop, "razer_chroma_box_mode") == 0) - { - rkb.chroma_box_mode = atoi(argument); - } -#endif -} - void Visualizer::InitAudioDeviceList() { #ifdef WIN32 @@ -294,10 +57,10 @@ void Visualizer::InitAudioDeviceList() isCapture.clear(); //Enumerate default audio output - pMMDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pEndpoint); - audio_devices.push_back("Default Loopback Device"); - pMMDevices.push_back(pEndpoint); - isCapture.push_back(false); + //pMMDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pEndpoint); + //audio_devices.push_back("Default Loopback Device"); + //pMMDevices.push_back(pEndpoint); + //isCapture.push_back(false); //Enumerate audio outputs pMMDeviceEnumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &pMMDeviceCollection); @@ -466,25 +229,6 @@ void Visualizer::Initialize() { InitAudioDeviceList(); - //Initialize devices supported only under Windows -#ifdef WIN32 - cmkb.Initialize(); - lkb.Initialize(); - asa.Initialize(); - - //Initialize devices supported only under Linux -#else - -#endif - - //Initialize devices supported by both Windows and Linux - rkb.Initialize(); - ckb.Initialize(); - skb.Initialize(); - mkb.Initialize(); - pkb.Initialize(); - - netmode = NET_MODE_DISABLED; background_timer = 0; background_timeout = 120; @@ -495,7 +239,7 @@ void Visualizer::Initialize() bkgd_step = 0; bkgd_bright = 100; bkgd_mode = VISUALIZER_PATTERN_ANIM_RAINBOW_SINUSOIDAL; - delay = 50; + delay = 25; window_mode = 1; decay = 80; frgd_mode = VISUALIZER_PATTERN_STATIC_GREEN_YELLOW_RED; @@ -522,34 +266,6 @@ void Visualizer::Initialize() SetNormalization(nrml_ofst, nrml_scl); } -void Visualizer::InitClient(char * clientstring) -{ - if (netmode == NET_MODE_DISABLED) - { - net_string = new char[strlen(clientstring) + 1]; - strcpy(net_string, clientstring); - LPSTR client_name; - LPSTR port_name; - client_name = strtok_s(clientstring, ",", &port_name); - - netmode = NET_MODE_CLIENT; - port = new net_port(); - port->tcp_client(client_name, port_name); - } -} - -void Visualizer::InitServer(char * serverstring) -{ - if (netmode == NET_MODE_DISABLED) - { - net_string = new char[strlen(serverstring) + 1]; - strcpy(net_string, serverstring); - netmode = NET_MODE_SERVER; - port = new net_port(); - port->tcp_server(serverstring); - } -} - void Visualizer::SaveSettings() { std::ofstream outfile; @@ -562,18 +278,8 @@ void Visualizer::SaveSettings() silent_bkgd = FALSE; } - //Get file path in executable directory -#ifdef WIN32 - GetModuleFileName(NULL, filename, 2048); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "\\settings.txt"); -#else - char arg1[64]; - snprintf(arg1, 64, "/proc/%d/exe", getpid()); - readlink(arg1, filename, 1024); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "/settings.txt"); -#endif + //Set filename + strcpy(filename, "settings.txt"); //Open settings file outfile.open(filename); @@ -650,55 +356,6 @@ void Visualizer::SaveSettings() snprintf(out_str, 1024, "audio_device_idx=%d\r\n", audio_device_idx); outfile.write(out_str, strlen(out_str)); - //Save LED Strip Configurations - for (unsigned int i = 0; i < str.size(); i++) - { - switch (str[i]->led_type) - { - case LED_STRIP_NORMAL: - //Save LED Strip Configuration - snprintf(out_str, 1024, "ledstrip=%s\r\n", str[i]->GetLEDString()); - outfile.write(out_str, strlen(out_str)); - break; - - case LED_STRIP_XMAS: - //Save Xmas Strip Configuration - snprintf(out_str, 1024, "xmas=%s\r\n", str[i]->GetLEDString()); - outfile.write(out_str, strlen(out_str)); - break; - - case LED_STRIP_HUE_PLUS: - //Save HuePlus Configuration - snprintf(out_str, 1024, "hueplus=%s\r\n", str[i]->GetLEDString()); - outfile.write(out_str, strlen(out_str)); - break; - } - } - - //Save Network Mode - switch (netmode) - { - case NET_MODE_CLIENT: - //Save Client Configuration - snprintf(out_str, 1024, "client=%s\r\n", net_string); - outfile.write(out_str, strlen(out_str)); - break; - - case NET_MODE_SERVER: - //Save Server Configuration - snprintf(out_str, 1024, "server=%s\r\n", net_string); - outfile.write(out_str, strlen(out_str)); - break; - } - - //Save Device Properties - for (int i = 0; i < device_properties.size(); i++) - { - //Save Device Property - snprintf(out_str, 1024, "%s\r\n", device_properties[i]); - outfile.write(out_str, strlen(out_str)); - } - //Close Output File outfile.close(); } @@ -717,32 +374,6 @@ void Visualizer::OnSettingsChanged() settings_changed = true; } -void Visualizer::SendSettings() -{ - if (netmode == NET_MODE_SERVER) - { - settings_pkt_type settings; - settings.amplitude = amplitude; - settings.avg_mode = avg_mode; - settings.avg_size = avg_size; - settings.window_mode = window_mode; - settings.decay = decay; - settings.delay = delay; - settings.anim_speed = anim_speed; - settings.bkgd_bright = bkgd_bright; - settings.bkgd_mode = bkgd_mode; - settings.single_color_mode = single_color_mode; - settings.nrml_ofst = nrml_ofst; - settings.nrml_scl = nrml_scl; - settings.filter_constant = filter_constant; - settings.frgd_mode = frgd_mode; - settings.reactive_bkgd = reactive_bkgd; - settings.silent_bkgd = silent_bkgd; - settings.background_timeout = background_timeout; - port->tcp_write((char *)&settings, sizeof(settings)); - } -} - void Visualizer::Update() { float fft_tmp[512]; @@ -961,33 +592,7 @@ void Visualizer::StartThread() //Set application running flag to TRUE before starting threads running = true; -#ifdef WIN32 - _beginthread(thread, 0, this); - _beginthread(netconthread, 0, this); - _beginthread(netupdthread, 0, this); - _beginthread(rkbthread, 0, this); - _beginthread(ckbthread, 0, this); - _beginthread(cmkbthread, 0, this); - _beginthread(lkbthread, 0, this); - _beginthread(skbthread, 0, this); - _beginthread(mkbthread, 0, this); - _beginthread(pkbthread, 0, this); - _beginthread(lsthread, 0, this); - _beginthread(asathread, 0, this); - -#else - pthread_t threads[10]; - - pthread_create(&threads[0], NULL, &thread, this); - pthread_create(&threads[1], NULL, &netconthread, this); - pthread_create(&threads[2], NULL, &netupdthread, this); - pthread_create(&threads[3], NULL, &rkbthread, this); - pthread_create(&threads[4], NULL, &ckbthread, this); - pthread_create(&threads[5], NULL, &skbthread, this); - pthread_create(&threads[6], NULL, &mkbthread, this); - pthread_create(&threads[7], NULL, &pkbthread, this); - pthread_create(&threads[8], NULL, &lsthread, this); -#endif + VisThread = new std::thread(&Visualizer::VisThreadFunction, this); } void Visualizer::Shutdown() @@ -1003,7 +608,7 @@ void Visualizer::Shutdown() } } -void DrawSolidColor(int bright, COLORREF color, vis_pixels *pixels) +void DrawSolidColor(int bright, RGBColor color, vis_pixels *pixels) { bright = (int)(bright * (255.0f / 100.0f)); for (int x = 0; x < 256; x++) @@ -1015,7 +620,7 @@ void DrawSolidColor(int bright, COLORREF color, vis_pixels *pixels) } } -void DrawVerticalBars(int bright, COLORREF * colors, int num_colors, vis_pixels *pixels) +void DrawVerticalBars(int bright, RGBColor * colors, int num_colors, vis_pixels *pixels) { bright = (int)(bright * (255.0f / 100.0f)); for (int x = 0; x < 256; x++) @@ -1028,7 +633,7 @@ void DrawVerticalBars(int bright, COLORREF * colors, int num_colors, vis_pixels } } -void DrawHorizontalBars(int bright, COLORREF * colors, int num_colors, vis_pixels *pixels) +void DrawHorizontalBars(int bright, RGBColor * colors, int num_colors, vis_pixels *pixels) { bright = (int)(bright * (255.0f / 100.0f)); for (int x = 0; x < 256; x++) @@ -1084,7 +689,10 @@ void DrawRainbow(int bright, float bkgd_step, vis_pixels *pixels) for (int y = 0; y < 64; y++) { int hsv_h = ((int)(bkgd_step + (256 - x)) % 360); - hsv_t hsv = { hsv_h, 255, (unsigned char)bright }; + hsv_t hsv = { 0, 0, 0 }; + hsv.hue = hsv_h; + hsv.saturation = 255; + hsv.value = (unsigned char)bright; pixels->pixels[y][x] = hsv2rgb(&hsv); } } @@ -1098,7 +706,10 @@ void DrawColorWheel(int bright, float bkgd_step, int center_x, int center_y, vis for (int y = 0; y < 64; y++) { float hue = (float)(bkgd_step + (int)(180 + atan2(y - center_y, x - center_x) * (180.0 / 3.14159)) % 360); - hsv_t hsv2 = { (int)hue, 255, (unsigned char)bright }; + hsv_t hsv2 = { 0, 0, 0 }; + hsv2.hue = (int)hue; + hsv2.saturation = 255; + hsv2.value = (unsigned char)bright; pixels->pixels[y][x] = hsv2rgb(&hsv2); } } @@ -1107,8 +718,11 @@ void DrawColorWheel(int bright, float bkgd_step, int center_x, int center_y, vis void DrawSpectrumCycle(int bright, float bkgd_step, vis_pixels *pixels) { bright = (int)(bright * (255.0f / 100.0f)); - hsv_t hsv2 = { (int)bkgd_step, 255, (unsigned char)bright }; - COLORREF color = hsv2rgb(&hsv2); + hsv_t hsv2 = { 0, 0, 0 }; + hsv2.hue = (int)bkgd_step; + hsv2.saturation = 255; + hsv2.value = (unsigned char)bright; + RGBColor color = hsv2rgb(&hsv2); for (int x = 0; x < 256; x++) { @@ -1121,7 +735,7 @@ void DrawSpectrumCycle(int bright, float bkgd_step, vis_pixels *pixels) void DrawSinusoidalCycle(int bright, float bkgd_step, vis_pixels *pixels) { - COLORREF color; + RGBColor color; bright = (int)(bright * (255.0f / 100.0f)); int red = (int)(127 * (sin(((((int)(((360 / 255.0f)) - bkgd_step) % 360) / 360.0f) * 2 * 3.14f)) + 1)); int grn = (int)(127 * (sin(((((int)(((360 / 255.0f)) - bkgd_step) % 360) / 360.0f) * 2 * 3.14f) - (6.28f / 3)) + 1)); @@ -1181,7 +795,7 @@ void Visualizer::DrawSingleColorForeground(float amplitude, vis_pixels *fg_pixel } } -void DrawSingleColorStatic(float amplitude, COLORREF in_color, vis_pixels *out_pixels) +void DrawSingleColorStatic(float amplitude, RGBColor in_color, vis_pixels *out_pixels) { if (amplitude >= 1.0f) { @@ -1216,7 +830,7 @@ void Visualizer::DrawPattern(VISUALIZER_PATTERN pattern, int bright, vis_pixels break; case VISUALIZER_PATTERN_SOLID_ORANGE: - DrawSolidColor(bright, 0x000060FF, pixels); + DrawSolidColor(bright, 0x000040FF, pixels); break; case VISUALIZER_PATTERN_SOLID_YELLOW: @@ -1236,47 +850,47 @@ void Visualizer::DrawPattern(VISUALIZER_PATTERN pattern, int bright, vis_pixels break; case VISUALIZER_PATTERN_SOLID_PURPLE: - DrawSolidColor(bright, 0x00FF0060, pixels); + DrawSolidColor(bright, 0x00FF0040, pixels); break; case VISUALIZER_PATTERN_STATIC_GREEN_YELLOW_RED: { - COLORREF colors[] = { 0x0000FF00, 0x0000FFFF, 0x000000FF }; + RGBColor colors[] = { 0x0000FF00, 0x0000FFFF, 0x000000FF }; DrawHorizontalBars(bright, colors, 3, pixels); } break; case VISUALIZER_PATTERN_STATIC_GREEN_WHITE_RED: { - COLORREF colors[] = { 0x0000FF00, 0x00FFFFFF, 0x000000FF }; + RGBColor colors[] = { 0x0000FF00, 0x00FFFFFF, 0x000000FF }; DrawHorizontalBars(bright, colors, 3, pixels); } break; case VISUALIZER_PATTERN_STATIC_BLUE_CYAN_WHITE: { - COLORREF colors[] = { 0x00FF0000, 0x00FFFF00, 0x00FFFFFF }; + RGBColor colors[] = { 0x00FF0000, 0x00FFFF00, 0x00FFFFFF }; DrawHorizontalBars(bright, colors, 3, pixels); } break; case VISUALIZER_PATTERN_STATIC_RED_WHITE_BLUE: { - COLORREF colors[] = { 0x000000FF, 0x00FFFFFF, 0x00FF0000 }; + RGBColor colors[] = { 0x000000FF, 0x00FFFFFF, 0x00FF0000 }; DrawHorizontalBars(bright, colors, 3, pixels); } break; case VISUALIZER_PATTERN_STATIC_RAINBOW: { - COLORREF colors[] = { 0x000000FF, 0x0000FFFF, 0x0000FF00, 0x00FFFF00, 0x00FF0000, 0x00FF00FF }; + RGBColor colors[] = { 0x000000FF, 0x0000FFFF, 0x0000FF00, 0x00FFFF00, 0x00FF0000, 0x00FF00FF }; DrawHorizontalBars(bright, colors, 6, pixels); } break; case VISUALIZER_PATTERN_STATIC_RAINBOW_INVERSE: { - COLORREF colors[] = { 0x00FF00FF, 0x00FF0000, 0x00FFFF00, 0x0000FF00, 0x0000FFFF, 0x000000FF }; + RGBColor colors[] = { 0x00FF00FF, 0x00FF0000, 0x00FFFF00, 0x0000FF00, 0x0000FFFF, 0x000000FF }; DrawHorizontalBars(bright, colors, 6, pixels); } break; @@ -1307,122 +921,11 @@ void Visualizer::DrawPattern(VISUALIZER_PATTERN pattern, int bright, vis_pixels } } -void Visualizer::NetConnectThread() -{ - while (1) - { - switch (netmode) - { - case NET_MODE_DISABLED: - return; - break; - - case NET_MODE_SERVER: - //Listen for new clients - port->tcp_server_listen(); - - //When a new client connects, send settings - SendSettings(); - break; - - case NET_MODE_CLIENT: - //Try to connect to server - port->tcp_client_connect(); - - //Wait 1 second between tries; - Sleep(1000); - break; - } - } -} - -void Visualizer::NetUpdateThread() -{ - int counter = 0; - char buf[sizeof(fft_fltr)]; - - while (1) - { - switch (netmode) - { - case NET_MODE_DISABLED: - return; - break; - - case NET_MODE_SERVER: - port->tcp_write((char *)fft_fltr, sizeof(fft_fltr)); - if (counter++ > 30) - { - port->tcp_write((char *)&bkgd_step, sizeof(bkgd_step)); - } - if (settings_changed) - { - SendSettings(); - settings_changed = false; - } - Sleep(20); - break; - - case NET_MODE_CLIENT: - if (port->connected) - { - int size = port->tcp_listen((char *)buf, sizeof(buf)); - - if (size == sizeof(fft_fltr)) - { - memcpy(&fft_fltr, buf, sizeof(fft_fltr)); - } - else if (size == sizeof(bkgd_step)) - { - memcpy(&bkgd_step, buf, sizeof(bkgd_step)); - } - else if (size == sizeof(settings_pkt_type)) - { - amplitude = ((settings_pkt_type *)buf)->amplitude; - avg_mode = ((settings_pkt_type *)buf)->avg_mode; - avg_size = ((settings_pkt_type *)buf)->avg_size; - window_mode = ((settings_pkt_type *)buf)->window_mode; - decay = ((settings_pkt_type *)buf)->decay; - delay = ((settings_pkt_type *)buf)->delay; - anim_speed = ((settings_pkt_type *)buf)->anim_speed; - bkgd_bright = ((settings_pkt_type *)buf)->bkgd_bright; - bkgd_mode = ((settings_pkt_type *)buf)->bkgd_mode; - single_color_mode = ((settings_pkt_type *)buf)->single_color_mode; - nrml_ofst = ((settings_pkt_type *)buf)->nrml_ofst; - nrml_scl = ((settings_pkt_type *)buf)->nrml_scl; - filter_constant = ((settings_pkt_type *)buf)->filter_constant; - frgd_mode = ((settings_pkt_type *)buf)->frgd_mode; - reactive_bkgd = ((settings_pkt_type *)buf)->reactive_bkgd; - silent_bkgd = ((settings_pkt_type *)buf)->silent_bkgd; - background_timeout = ((settings_pkt_type *)buf)->background_timeout; - SetNormalization(nrml_ofst, nrml_scl); - - //Check background flags, they both should not be set - if ((silent_bkgd == TRUE) && (reactive_bkgd == TRUE)) - { - silent_bkgd = FALSE; - } - - update_ui = TRUE; - } - } - else - { - Sleep(10); - } - break; - } - } -} - -void Visualizer::VisThread() +void Visualizer::VisThreadFunction() { while (running == true) { - if (!(netmode == NET_MODE_CLIENT && port->connected)) - { - Update(); - } + Update(); //Overflow background step if (bkgd_step >= 360.0f) bkgd_step = 0.0f; @@ -1664,92 +1167,468 @@ void Visualizer::VisThread() } } -//Thread update functions for devices supported only under Windows -#ifdef WIN32 -void Visualizer::CmKeyboardUpdateThread() +static void UpdateOpenRGBClientListCallback(void * this_ptr) { - while (cmkb.SetLEDs(pixels_out->pixels)) - { - Sleep(delay); - } + Visualizer * this_obj = (Visualizer *)this_ptr; + + this_obj->UpdateClientSettings(); } -void Visualizer::LogitechSDKUpdateThread() +void Visualizer::RegisterClientInfoChangeCallback(NetClientCallback new_callback, void * new_callback_arg) { - while (lkb.SetLEDs(pixels_out->pixels)) - { - Sleep(delay); - } + ClientInfoChangeCallbacks.push_back(new_callback); + ClientInfoChangeCallbackArgs.push_back(new_callback_arg); } -void Visualizer::AuraSDKUpdateThread() +void Visualizer::ClientInfoChanged() { - while (asa.SetLEDs(pixels_out->pixels)) + ClientInfoChangeMutex.lock(); + + /*-------------------------------------------------*\ + | Client info has changed, call the callbacks | + \*-------------------------------------------------*/ + for(unsigned int callback_idx = 0; callback_idx < ClientInfoChangeCallbacks.size(); callback_idx++) { - Sleep(delay); + ClientInfoChangeCallbacks[callback_idx](ClientInfoChangeCallbackArgs[callback_idx]); } + + ClientInfoChangeMutex.unlock(); } -//Thread update functions for devices supported only under Linux -#else +void Visualizer::UpdateClientSettings() +{ + /*-----------------------------------------------------*\ + | Loop through all clients and make sure each has an | + | associated settings | + \*-----------------------------------------------------*/ + for(unsigned int client_idx = 0; client_idx < rgb_clients.size(); client_idx++) + { + if(client_idx < rgb_client_settings.size()) + { + /*-----------------------------------------------------*\ + | If the client settings at this index matches the | + | controller at this index, continue | + \*-----------------------------------------------------*/ + if(rgb_client_settings[client_idx]->client_ptr == rgb_clients[client_idx]) + { + continue; + } + /*-----------------------------------------------------*\ + | Otherwise, search the rest of the client settings list| + | to see if the client settings for this controller has | + | been misplaced | + \*-----------------------------------------------------*/ + else + { + bool found_match = false; -#endif + for(unsigned int search_client_idx = client_idx; search_client_idx < rgb_client_settings.size(); search_client_idx++) + { + /*-----------------------------------------------------*\ + | If the client settings at this index matches the | + | controller at this index, swap the settings at the | + | original position for those at the search position | + \*-----------------------------------------------------*/ + if(rgb_client_settings[search_client_idx]->client_ptr == rgb_clients[client_idx]) + { + ClientSettingsType* tmp_settings = rgb_client_settings[search_client_idx]; -//Thread update functions for devices supported on both Windows and Linux -void Visualizer::RazerChromaUpdateThread() -{ - while (rkb.SetLEDs(pixels_out->pixels)) + rgb_client_settings[search_client_idx] = rgb_client_settings[client_idx]; + + rgb_client_settings[client_idx] = tmp_settings; + + found_match = true; + + break; + } + } + + /*-----------------------------------------------------*\ + | If a matching settings was not found, create a new one| + \*-----------------------------------------------------*/ + if(!found_match) + { + ClientSettingsType* new_settings = new ClientSettingsType(); + + new_settings->client_ptr = rgb_clients[client_idx]; + + rgb_client_settings.insert(rgb_client_settings.begin() + client_idx, new_settings); + } + } + } + else + { + /*-----------------------------------------------------*\ + | If the settings list is smaller than the client index | + | that means this client wasn't found in the existing | + | list. Create a new settings for this client | + \*-----------------------------------------------------*/ + + ClientSettingsType* new_settings = new ClientSettingsType(); + + new_settings->client_ptr = rgb_clients[client_idx]; + + rgb_client_settings.insert(rgb_client_settings.begin() + client_idx, new_settings); + } + } + + /*-----------------------------------------------------*\ + | At this point, the clients and settings lists should | + | line up. If the settings list is longer than the | + | clients list, delete the extras as they are unused | + \*-----------------------------------------------------*/ + for(unsigned int settings_idx = rgb_clients.size(); settings_idx < rgb_client_settings.size(); settings_idx++) { - Sleep(delay); + rgb_client_settings.pop_back(); + } + + /*-----------------------------------------------------*\ + | Now go through each client and make sure all the | + | controller settings entries line up | + \*-----------------------------------------------------*/ + for(unsigned int client_idx = 0; client_idx < rgb_clients.size(); client_idx++) + { + std::vector & controllers = rgb_clients[client_idx]->server_controllers; + std::vector & controller_settings = rgb_client_settings[client_idx]->controller_settings; + + for(unsigned int controller_idx = 0; controller_idx < controllers.size(); controller_idx++) + { + if(controller_idx < controller_settings.size()) + { + /*-----------------------------------------------------*\ + | If the controller settings at this index matches the | + | controller at this index, continue | + \*-----------------------------------------------------*/ + if(controller_settings[controller_idx]->controller_ptr == controllers[controller_idx]) + { + continue; + } + /*-----------------------------------------------------*\ + | Otherwise, search the rest of the client settings list| + | to see if the client settings for this controller has | + | been misplaced | + \*-----------------------------------------------------*/ + else + { + bool found_match = false; + + for(unsigned int search_controller_idx = controller_idx; search_controller_idx < controller_settings.size(); search_controller_idx++) + { + /*-----------------------------------------------------*\ + | If the client settings at this index matches the | + | controller at this index, swap the settings at the | + | original position for those at the search position | + \*-----------------------------------------------------*/ + if(controller_settings[search_controller_idx]->controller_ptr == controllers[controller_idx]) + { + ControllerSettingsType* tmp_settings = controller_settings[search_controller_idx]; + + controller_settings[search_controller_idx] = controller_settings[controller_idx]; + + controller_settings[controller_idx] = tmp_settings; + + found_match = true; + + break; + } + } + + /*-----------------------------------------------------*\ + | If a matching settings was not found, create a new one| + \*-----------------------------------------------------*/ + if(!found_match) + { + ControllerSettingsType* new_settings = new ControllerSettingsType(); + + new_settings->controller_ptr = controllers[controller_idx]; + new_settings->enabled = false; + + for(int mode_idx = 0; mode_idx < controllers[controller_idx]->modes.size(); mode_idx++) + { + if(controllers[controller_idx]->modes[mode_idx].name == "Direct") + { + new_settings->enabled = true; + } + } + + controller_settings.insert(controller_settings.begin() + controller_idx, new_settings); + } + } + } + else + { + /*-----------------------------------------------------*\ + | If the settings list is smaller than the client index | + | that means this client wasn't found in the existing | + | list. Create a new settings for this client | + \*-----------------------------------------------------*/ + + ControllerSettingsType* new_settings = new ControllerSettingsType(); + + new_settings->controller_ptr = controllers[controller_idx]; + new_settings->enabled = false; + + for(int mode_idx = 0; mode_idx < controllers[controller_idx]->modes.size(); mode_idx++) + { + if(controllers[controller_idx]->modes[mode_idx].name == "Direct") + { + new_settings->enabled = true; + } + } + + controller_settings.insert(controller_settings.begin() + controller_idx, new_settings); + } + } + + /*-----------------------------------------------------*\ + | At this point, the clients and settings lists should | + | line up. If the settings list is longer than the | + | clients list, delete the extras as they are unused | + \*-----------------------------------------------------*/ + for(unsigned int settings_idx = controllers.size(); settings_idx < controller_settings.size(); settings_idx++) + { + controller_settings.pop_back(); + } } + + ClientInfoChanged(); } -void Visualizer::CorsairKeyboardUpdateThread() +static bool started = false; +NetworkClient * Visualizer::OpenRGBConnect(const char * ip, unsigned short port) { - while (ckb.SetLEDs(pixels_out->pixels)) + NetworkClient * rgb_client = new NetworkClient(rgb_controllers); + + rgb_clients.push_back(rgb_client); + + std::string titleString = "Keyboard Visualizer "; + titleString.append(VERSION_STRING); + + rgb_client->SetIP(ip); + rgb_client->SetName(titleString.c_str()); + rgb_client->SetPort(port); + + rgb_client->RegisterClientInfoChangeCallback(UpdateOpenRGBClientListCallback, this); + + rgb_client->StartClient(); + + if(!started) { - Sleep(delay); + started = true; + LEDUpdateThread = new std::thread(&Visualizer::LEDUpdateThreadFunction, this); } -} + return(rgb_client); +} -void Visualizer::SteelSeriesKeyboardUpdateThread() +void Visualizer::OpenRGBDisconnect(NetworkClient * client) { - while (skb.SetLEDs(pixels_out->pixels)) + started = false; + LEDUpdateThread->join(); + + client->StopClient(); + + for(unsigned int client_idx = 0; client_idx < rgb_clients.size(); client_idx++) { - Sleep(delay); + if(client == rgb_clients[client_idx]) + { + rgb_clients.erase(rgb_clients.begin() + client_idx); + rgb_client_settings.erase(rgb_client_settings.begin() + client_idx); + break; + } + } + + if(!started) + { + started = true; + LEDUpdateThread = new std::thread(&Visualizer::LEDUpdateThreadFunction, this); } } -void Visualizer::MSIKeyboardUpdateThread() +static void SetupMatrixGrid(int x_count, int y_count, int * x_idx_list, int * y_idx_list) { - while (mkb.SetLEDs(pixels_out->pixels)) + for(int x = 0; x < x_count; x++) { - Sleep(delay); + if(x_count < 10) + { + x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count))) + (0.5f * (SPECTROGRAPH_COLS / (x_count)))); + } + else if(x < ((x_count) / 2)) + { + x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) + (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); + } + else + { + x_idx_list[x] = (int)((x * (SPECTROGRAPH_COLS / (x_count - 1))) - (0.5f * (SPECTROGRAPH_COLS / (x_count - 1)))); + } + + } + for(int y = 0; y < y_count; y++) + { + y_idx_list[y] = (int)(ROW_IDX_SPECTROGRAPH_TOP + (y * (SPECTROGRAPH_ROWS / y_count)) + (0.5f * (SPECTROGRAPH_ROWS / y_count))); } } -void Visualizer::PoseidonZRGBKeyboardUpdateThread() +static void SetupLinearGrid(int x_count, int * x_idx_list) { - while (pkb.SetLEDs(pixels_out->pixels)) + if((x_count % 2) == 0) { - Sleep(delay); + //Even number of LEDs + for(int x = 0; x < x_count; x++) + { + x_idx_list[x] = (int)((float)x * (256.0f / (float)x_count)) + (128.0f / (float)x_count); + } + } + else + { + //Odd number of LEDs + for(int x = 0; x < x_count; x++) + { + if (x == (x_count / 2)) + { + x_idx_list[x] = 128; + } + else if (x < ((x_count / 2) + 1)) + { + x_idx_list[x] = (x_count / 2) + ((x + 1) * (256 / (x_count + 1))); + } + else + { + x_idx_list[x] = ((x_count / 2) + 1) + (x * (256 / (x_count + 1))); + } + + } } } -void Visualizer::LEDStripUpdateThread() +void Visualizer::LEDUpdateThreadFunction() { - if (str.size() > 0) + while(started) { - while (TRUE) + for(unsigned int client_idx = 0; client_idx < rgb_clients.size(); client_idx++) { - for (unsigned int i = 0; i < str.size(); i++) + rgb_clients[client_idx]->ControllerListMutex.lock(); + + if(client_idx < rgb_client_settings.size()) { - str[i]->SetPixels(pixels_out->pixels); - str[i]->SetDelay(delay); + if(rgb_client_settings[client_idx]->client_ptr == rgb_clients[client_idx]) + { + std::vector & controllers = rgb_clients[client_idx]->server_controllers; + std::vector & controllers_settings = rgb_client_settings[client_idx]->controller_settings; + + for(unsigned int controller_idx = 0; controller_idx < controllers.size(); controller_idx++) + { + if(controller_idx < controllers_settings.size()) + { + if(controllers_settings[controller_idx]->controller_ptr == controllers[controller_idx]) + { + RGBController * controller = controllers[controller_idx]; + ControllerSettingsType * controller_settings = controllers_settings[controller_idx]; + + if(controller_settings->enabled) + { + for(unsigned int zone_idx = 0; zone_idx < controller->zones.size(); zone_idx++) + { + int x_count = controller->zones[zone_idx].leds_count; + int y_count = 0; + zone_type type = controller->zones[zone_idx].type; + ZoneIndexType * zone_index_map = NULL; + bool index_map_found = false; + + // If matrix type and matrix mapping is valid, get X and Y count + if(type == ZONE_TYPE_MATRIX) + { + if(controller->zones[zone_idx].matrix_map != NULL) + { + x_count = controller->zones[zone_idx].matrix_map->width; + y_count = controller->zones[zone_idx].matrix_map->height; + } + else + { + type = ZONE_TYPE_SINGLE; + } + } + + // Search all the zone index maps + for(int i = 0; i < controller_settings->zones.size(); i++) + { + zone_index_map = &controller_settings->zones[i]; + + if((zone_index_map->x_count == x_count) && (zone_index_map->y_count == y_count)) + { + index_map_found = true; + break; + } + } + + // If the index map doesn't exist for this zone, create it + if(index_map_found == false) + { + ZoneIndexType * new_index_map = new ZoneIndexType(); + new_index_map->x_count = x_count; + new_index_map->y_count = y_count; + + if(type == ZONE_TYPE_MATRIX) + { + new_index_map->x_index = new int[x_count]; + new_index_map->y_index = new int[y_count]; + + SetupMatrixGrid(x_count, y_count, new_index_map->x_index, new_index_map->y_index); + } + else if(type == ZONE_TYPE_LINEAR) + { + new_index_map->x_index = new int[x_count]; + + SetupLinearGrid(x_count, new_index_map->x_index); + } + + controller_settings->zones.push_back(*new_index_map); + + zone_index_map = &controller_settings->zones[controller_settings->zones.size() - 1]; + } + + switch (controller->zones[zone_idx].type) + { + case ZONE_TYPE_MATRIX: + for (int y = 0; y < y_count; y++) + { + for (int x = 0; x < x_count; x++) + { + unsigned int map_idx = (y * x_count) + x; + unsigned int color_idx = controller->zones[zone_idx].matrix_map->map[map_idx]; + if( color_idx != 0xFFFFFFFF ) + { + controller->zones[zone_idx].colors[color_idx] = pixels_out->pixels[zone_index_map->y_index[y]][zone_index_map->x_index[x]]; + } + } + } + break; + + case ZONE_TYPE_SINGLE: + for (int r = 0; r < x_count; r++) + { + controller->zones[zone_idx].colors[r] = pixels_out->pixels[ROW_IDX_SINGLE_COLOR][0]; + } + break; + + case ZONE_TYPE_LINEAR: + for (int x = 0; x < x_count; x++) + { + controller->zones[zone_idx].colors[x] = pixels_out->pixels[ROW_IDX_BAR_GRAPH][zone_index_map->x_index[x]]; + } + break; + } + } + controller->DeviceUpdateLEDs(); + } + } + } + } + } } - Sleep(delay); + rgb_clients[client_idx]->ControllerListMutex.unlock(); } + Sleep(delay); } } diff --git a/KeyboardVisualizerCommon/Visualizer.h b/KeyboardVisualizerCommon/Visualizer.h index 5f527f9..cc4dbe3 100644 --- a/KeyboardVisualizerCommon/Visualizer.h +++ b/KeyboardVisualizerCommon/Visualizer.h @@ -7,60 +7,73 @@ #ifndef VISUALIZER_H #define VISUALIZER_H +/*---------------------------------------------------------*\ +| C/C++ Standard Library Includes | +\*---------------------------------------------------------*/ #include #include #include +#include #include +#include -//Project includes +/*---------------------------------------------------------*\ +| Project Includes | +\*---------------------------------------------------------*/ #include "VisualizerDefines.h" #include "chuck_fft.h" #include "hsv.h" #include "net_port.h" -//If building on Windows, use WASAPI -#ifdef WIN32 +/*---------------------------------------------------------*\ +| OpenRGB SDK Includes | +\*---------------------------------------------------------*/ +#include "OpenRGB.h" +#include "NetworkClient.h" +#include "RGBController.h" + +/*---------------------------------------------------------*\ +| Audio Library Includes | +\*---------------------------------------------------------*/ +#ifdef _WIN32 #include #include #include #include #include #include +#endif -//If not building on Windows, use OpenAL -#else +#ifdef __linux__ #include #include #endif +#ifdef __APPLE__ +#include +#include +#endif + typedef struct { - int amplitude; - int avg_mode; - int avg_size; - int window_mode; - int decay; - int delay; - float anim_speed; - int bkgd_bright; - int bkgd_mode; - int single_color_mode; - float nrml_ofst; - float nrml_scl; - float filter_constant; - int frgd_mode; - bool reactive_bkgd; - bool silent_bkgd; - unsigned int background_timeout; -} settings_pkt_type; + int x_count; + int y_count; + int * x_index; + int * y_index; +} ZoneIndexType; -typedef int net_mode; -enum +typedef struct { - NET_MODE_DISABLED, - NET_MODE_CLIENT, - NET_MODE_SERVER -}; + RGBController * controller_ptr; + bool enabled; + std::vector zones; +} ControllerSettingsType; + +typedef struct +{ + NetworkClient * client_ptr; + std::vector controller_settings; +} ClientSettingsType; class Visualizer { @@ -76,28 +89,15 @@ class Visualizer //Function to start thread void StartThread(); - //Visualizer Thread - void VisThread(); + //Thread Functions + void LEDUpdateThreadFunction(); + void VisThreadFunction(); - //Network Threads - void NetConnectThread(); - void NetUpdateThread(); - -#ifdef WIN32 - //Update threads for devices supported only under Windows - void CmKeyboardUpdateThread(); - void LogitechSDKUpdateThread(); - void AuraSDKUpdateThread(); -#else + //Connect to OpenRGB + NetworkClient *OpenRGBConnect(const char *ip, unsigned short port); -#endif - //Update threads for devices supported on both Windows and Linux - void RazerChromaUpdateThread(); - void CorsairKeyboardUpdateThread(); - void SteelSeriesKeyboardUpdateThread(); - void MSIKeyboardUpdateThread(); - void PoseidonZRGBKeyboardUpdateThread(); - void LEDStripUpdateThread(); + //Disconnect from OpenRGB + void OpenRGBDisconnect(NetworkClient * client); //Called when settings changed void OnSettingsChanged(); @@ -105,12 +105,6 @@ class Visualizer //Send Settings to network clients void SendSettings(); - //Initialize Server - void InitServer(char * serverstring); - - //Initialize CLient - void InitClient(char * clientstring); - //Change Audio Device void ChangeAudioDevice(); @@ -123,13 +117,6 @@ class Visualizer //Shut Down void Shutdown(); - //Add LED strip - void BeginLEDMatrix(int size); - void AddLEDStrip(int led_type, char* ledstring); - - //Function to set custom properties for devices - void SetDeviceProperty(char * devprop, char * argument); - //Save Settings File void SaveSettings(); @@ -178,12 +165,6 @@ class Visualizer unsigned int background_timeout; unsigned int background_timer; - void LEDStripSections(int sections); - void LEDMirrorX(); - void LEDMirrorY(); - void LEDSingleColor(); - void LEDRotateX(int rotate); - //Single Color Mode int single_color_mode; @@ -200,6 +181,16 @@ class Visualizer //Audio Device List std::vector audio_devices; + //OpenRGB SDK + std::vector rgb_clients; + std::vector rgb_controllers; + + std::vector rgb_client_settings; + + void UpdateClientSettings(); + void RegisterClientInfoChangeCallback(NetClientCallback new_callback, void * new_callback_arg); + void ClientInfoChanged(); + private: #ifdef WIN32 //WASAPI objects if building for Windows @@ -215,15 +206,13 @@ class Visualizer ALCdevice *device; #endif + //Threads + std::thread * LEDUpdateThread; + std::thread * VisThread; + //Background Step float bkgd_step; - //Network Port Pointer - net_port * port; - - //Network Mode - net_mode netmode; - //FFT Variables float win_hanning[256]; float win_hamming[256]; @@ -243,6 +232,10 @@ class Visualizer unsigned char buffer[256]; void DrawSingleColorForeground(float amplitude, vis_pixels *fg_pixels, vis_pixels *out_pixels); + + std::mutex ClientInfoChangeMutex; + std::vector ClientInfoChangeCallbacks; + std::vector ClientInfoChangeCallbackArgs; }; #endif diff --git a/KeyboardVisualizerCommon/VisualizerDefines.h b/KeyboardVisualizerCommon/VisualizerDefines.h index 877f5d9..c90dbbf 100644 --- a/KeyboardVisualizerCommon/VisualizerDefines.h +++ b/KeyboardVisualizerCommon/VisualizerDefines.h @@ -7,15 +7,17 @@ #ifndef VISUALIZER_DEFINES_H #define VISUALIZER_DEFINES_H -#ifdef WIN32 -#ifndef _WINDOWS_ -#include "..\KeyboardVisualizerVC\stdafx.h" -#endif -#else -//Includes for non-Windows builds +/*---------------------------------------------------------*\ +| Project Includes | +\*---------------------------------------------------------*/ +#include "RGBController.h" + +/*---------------------------------------------------------*\ +| Define Windows types for non-Windows builds | +\*---------------------------------------------------------*/ +#ifndef _WIN32 #include -//Define Windows types for non-Windows Builds typedef unsigned int COLORREF; typedef unsigned char BYTE; typedef bool boolean; @@ -136,7 +138,7 @@ const char * const visualizer_single_color_labels[VISUALIZER_NUM_SINGLE_COLOR] = typedef struct { - COLORREF pixels[64][256]; + RGBColor pixels[64][256]; } vis_pixels; #endif diff --git a/KeyboardVisualizerCommon/hsv.cpp b/KeyboardVisualizerCommon/hsv.cpp index 90de0f7..aeaa9ab 100644 --- a/KeyboardVisualizerCommon/hsv.cpp +++ b/KeyboardVisualizerCommon/hsv.cpp @@ -30,12 +30,17 @@ #define MIN3(a,b,c) MIN((a), MIN((b), (c))) #define MAX3(a,b,c) MAX((a), MAX((b), (c))) +#define RGBGetRValue(rgb) (rgb & 0x000000FF) +#define RGBGetGValue(rgb) ((rgb >> 8) & 0x000000FF) +#define RGBGetBValue(rgb) ((rgb >> 16) & 0x000000FF) -void rgb2hsv(COLORREF rgb, hsv_t* hsv) +#define ToRGBColor(r, g, b) ((b << 16) | (g << 8) | (r)) + +void rgb2hsv(unsigned int rgb, hsv_t* hsv) { - int r = GetRValue(rgb); - int g = GetGValue(rgb); - int b = GetBValue(rgb); + int r = RGBGetRValue(rgb); + int g = RGBGetGValue(rgb); + int b = RGBGetBValue(rgb); int m = MIN3(r, g, b); int M = MAX3(r, g, b); int delta = M - m; @@ -69,9 +74,11 @@ void rgb2hsv(COLORREF rgb, hsv_t* hsv) hsv->value = M; } -COLORREF hsv2rgb(hsv_t* hsv) +unsigned int hsv2rgb(hsv_t* hsv) { - BYTE r, g, b; + unsigned char r = 0; + unsigned char g = 0; + unsigned char b = 0; if (hsv->saturation == 0) { r = g = b = hsv->value; @@ -101,7 +108,7 @@ COLORREF hsv2rgb(hsv_t* hsv) } } - return RGB(r, g, b); + return ToRGBColor(r, g, b); } diff --git a/KeyboardVisualizerCommon/hsv.h b/KeyboardVisualizerCommon/hsv.h index c4a2708..3b8a85b 100644 --- a/KeyboardVisualizerCommon/hsv.h +++ b/KeyboardVisualizerCommon/hsv.h @@ -24,21 +24,19 @@ #ifndef HSV_H #define HSV_H -#include "VisualizerDefines.h" - #define HUE_DEGREE 1 typedef struct hsv_tag hsv_t; struct hsv_tag { - int hue; /* 0 ... (360*HUE_DEGREE - 1) */ - BYTE saturation; /* 0 ... 255 */ - BYTE value; /* 0 ... 255 */ + unsigned int hue; /* 0 ... (360*HUE_DEGREE - 1) */ + unsigned char saturation; /* 0 ... 255 */ + unsigned char value; /* 0 ... 255 */ }; -void rgb2hsv(COLORREF rgb, hsv_t* hsv); +void rgb2hsv(unsigned int rgb, hsv_t* hsv); -COLORREF hsv2rgb(hsv_t* hsv); +unsigned int hsv2rgb(hsv_t* hsv); #endif /* HSV_H */ diff --git a/KeyboardVisualizerCommon/net_port.cpp b/KeyboardVisualizerCommon/net_port.cpp deleted file mode 100644 index e56b316..0000000 --- a/KeyboardVisualizerCommon/net_port.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/*---------------------------------------------------------*\ -| Cross Platform Network Library for Windows and Linux | -| This library provides access to TCP and UDP ports with | -| a common API for both Windows and Linux systems. It | -| features read and write | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/15/2016 | -\*---------------------------------------------------------*/ - -#include "net_port.h" - -#ifndef WIN32 -#include -#include -#include -#endif -#include -#include -#include -#include - -const char yes = 1; - -net_port::net_port() -{ - -} - -//net_port (constructor) -// When created with port information, the constructor -// will automatically open client address on port -net_port::net_port(const char * client_name, const char * port) -{ - udp_client(client_name, port); -} - -net_port::~net_port() -{ - -} - -bool net_port::udp_client(const char * client_name, const char * port) -{ - sockaddr_in myAddress; - -#ifdef WIN32 - if (WSAStartup(MAKEWORD(2, 2), &wsa) != NO_ERROR) - { - WSACleanup(); - return(false); - } -#endif - - sock = socket(AF_INET, SOCK_DGRAM, 0); - if (sock == INVALID_SOCKET) - { - WSACleanup(); - return(false); - } - - myAddress.sin_family = AF_INET; - myAddress.sin_addr.s_addr = inet_addr("0.0.0.0"); - myAddress.sin_port = htons(0); - - if (bind(sock, (sockaddr*)&myAddress, sizeof(myAddress)) == SOCKET_ERROR) - { - WSACleanup(); - return false; - } - - result_list = NULL; - addrinfo hints = {}; - hints.ai_family = AF_INET; - hints.ai_socktype = SOCK_DGRAM; - if(getaddrinfo(client_name, port, &hints, &result_list) == 0) - { - memcpy(&addrDest, result_list->ai_addr, result_list->ai_addrlen); - freeaddrinfo(result_list); - return(true); - } - else - { - WSACleanup(); - return(false); - } -} - -int net_port::udp_listen(char * recv_data, int length) -{ - return(recvfrom(sock, recv_data, length, 0, NULL, NULL)); -} - -int net_port::udp_write(char * buffer, int length) -{ - return(sendto(sock, buffer, length, 0, (sockaddr *)&addrDest, sizeof(addrDest))); -} - -bool net_port::tcp_client(const char * client_name, const char * port) -{ - addrinfo hints = {}; - - connected = false; - result_list = NULL; - -#ifdef WIN32 - if (WSAStartup(MAKEWORD(2, 2), &wsa) != NO_ERROR) - { - WSACleanup(); - return(false); - } -#endif - - port = strtok((char *)port, "\r"); - - hints.ai_family = AF_INET; - hints.ai_socktype = SOCK_STREAM; - getaddrinfo(client_name, port, &hints, &result_list); - - if(result_list == NULL) - { - WSACleanup(); - return(false); - } - - return(true); -} - -bool net_port::tcp_client_connect() -{ - if (!connected) - { - sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock == INVALID_SOCKET) - { - WSACleanup(); - return(false); - } - - u_long arg = 1; - fd_set fdset; - timeval tv; - - ioctlsocket(sock, FIONBIO, &arg); - - if(result_list == NULL) - { - connected = false; - return(false); - } - connect(sock, result_list->ai_addr, result_list->ai_addrlen); - - FD_ZERO(&fdset); - FD_SET(sock, &fdset); - - tv.tv_sec = 4; - tv.tv_usec = 0; - - if (select(sock + 1, NULL, &fdset, NULL, &tv) == 1) - { - char so_error; - socklen_t len = sizeof(so_error); - - getsockopt(sock, SOL_SOCKET, SO_ERROR, &so_error, &len); - - if (so_error == 0) - { - connected = true; - arg = 0; - ioctlsocket(sock, FIONBIO, &arg); - } - else - { - connected = false; - closesocket(sock); - } - } - else - { - connected = false; - closesocket(sock); - } - } - return(true); -} - -bool net_port::tcp_server(const char * port) -{ - sockaddr_in myAddress; - -#ifdef WIN32 - if (WSAStartup(MAKEWORD(2, 2), &wsa) != NO_ERROR) - { - WSACleanup(); - return false; - } -#endif - - sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock == INVALID_SOCKET) - { - WSACleanup(); - return false; - } - - port = strtok((char *)port, "\r"); - - myAddress.sin_family = AF_INET; - myAddress.sin_addr.s_addr = inet_addr("0.0.0.0"); - myAddress.sin_port = htons(atoi(port)); - - if (bind(sock, (sockaddr*)&myAddress, sizeof(myAddress)) == SOCKET_ERROR) - { - WSACleanup(); - return false; - } - - setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes)); - - return(true); -} - -void net_port::tcp_server_listen() -{ - SOCKET * client = new SOCKET(); - listen(sock, 10); - *client = accept(sock, NULL, NULL); - u_long arg = 0; - ioctlsocket(*client, FIONBIO, &arg); - setsockopt(*client, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes)); - clients.push_back(client); -} - -void net_port::tcp_close() -{ - closesocket(sock); - connected = false; -} - -int net_port::tcp_listen(char * recv_data, int length) -{ - int ret = 0; - int len = 0; - int tot = 0; - timeval waitd; - - fd_set readfd; - - FD_ZERO(&readfd); - FD_SET(sock, &readfd); - - if (connected) - { - while(ret != sizeof(len)) - { - waitd.tv_sec = 10; - waitd.tv_usec = 0; - - if (select(sock + 1, &readfd, NULL, NULL, &waitd)) - { - ret = recv(sock, (char *)&len, sizeof(len), 0); - - if (ret == -1 || ret == 0) - { - closesocket(sock); - connected = false; - return(0); - } - } - else - { - closesocket(sock); - connected = false; - return(0); - } - } - - ret = 0; - while(tot != len) - { - waitd.tv_sec = 10; - waitd.tv_usec = 0; - - if (select(sock + 1, &readfd, NULL, NULL, &waitd)) - { - ret = recv(sock, recv_data + ret, len - ret, 0); - - if (ret == -1 || ret == 0) - { - closesocket(sock); - connected = false; - return(0); - } - - tot += ret; - } - else - { - closesocket(sock); - connected = false; - return(0); - } - } - } - return(ret); -} - -int net_port::tcp_client_write(char * buffer, int length) -{ - return(send(sock, buffer, length, 0)); -} - -int net_port::tcp_write(char * buffer, int length) -{ - int ret = length; - int val = length; - - timeval waitd; - fd_set writefd; - - for (unsigned int i = 0; i < clients.size(); i++) - { - val = length; - - FD_ZERO(&writefd); - FD_SET(*(clients[i]), &writefd); - - waitd.tv_sec = 5; - waitd.tv_usec = 0; - - if (select(*(clients[i]) + 1, NULL, &writefd, NULL, &waitd)) - { - val = send(*(clients[i]), (const char *)&length, sizeof(length), 0); - - if (val == -1) - { - clients.erase(clients.begin() + i); - return 0; - } - } - else - { - clients.erase(clients.begin() + i); - return 0; - } - - waitd.tv_sec = 5; - waitd.tv_usec = 0; - - if (select(*(clients[i]) + 1, NULL, &writefd, NULL, &waitd)) - { - val = send(*(clients[i]), buffer, length, 0); - - if (val == -1) - { - clients.erase(clients.begin() + i); - return 0; - } - - if (val != length) - { - ret = val; - } - } - else - { - clients.erase(clients.begin() + i); - return 0; - } - } - return(ret); -} diff --git a/KeyboardVisualizerCommon/net_port.h b/KeyboardVisualizerCommon/net_port.h deleted file mode 100644 index 8a57dd4..0000000 --- a/KeyboardVisualizerCommon/net_port.h +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------*\ -| Cross Platform Network Library for Windows and Linux | -| This library provides access to TCP and UDP ports with | -| a common API for both Windows and Linux systems. It | -| features read and write | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/15/2016 | -\*---------------------------------------------------------*/ - -#ifndef NET_PORT_H -#define NET_PORT_H - -#include - -#ifdef WIN32 -#include -#include -#include -#else -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifndef WIN32 -#define SOCKET int -#define ioctlsocket ioctl -#define closesocket close -#define WSACleanup() -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 -#endif - -//Network Port Class -//The reason for this class is that network ports are treated differently -//on Windows and Linux. By creating a class, those differences can be -//made invisible to the program and make cross-platform usage easy - -class net_port -{ -public: - net_port(); - net_port(const char * client_name, const char * port); - - ~net_port(); - - //Function to open the port - bool udp_client(const char* client_name, const char * port); - bool tcp_client(const char* client_name, const char * port); - bool tcp_client_connect(); - - //Function to open a server - bool tcp_server(const char * port); - void tcp_server_listen(); - - int udp_listen(char * recv_data, int length); - int tcp_listen(char * recv_data, int length); - - //Function to write data to the serial port - int udp_write(char * buffer, int length); - int tcp_write(char * buffer, int length); - int tcp_client_write(char * buffer, int length); - - void tcp_close(); - - bool connected; - -private: -#ifdef WIN32 - WSADATA wsa; -#endif - SOCKET sock; - std::vector clients; - - sockaddr addrDest; - addrinfo* result_list; -}; - -#endif diff --git a/KeyboardVisualizerCommon/serial_port.cpp b/KeyboardVisualizerCommon/serial_port.cpp deleted file mode 100644 index d4eb7da..0000000 --- a/KeyboardVisualizerCommon/serial_port.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/*---------------------------------------------------------*\ -| Cross Platform Serial COM Library for Windows and Linux | -| This library provides access to serial ports with a | -| common API for both Windows and Linux systems. It | -| features read and write as well as tx/rx buffer flush. | -| | -| Adam Honse (calcprogrammer1@gmail.com), 1/21/2013 | -\*---------------------------------------------------------*/ - -#include "serial_port.h" - -//serial_port (constructor) -// The default constructor does not initialize the serial port -serial_port::serial_port() -{ - //Set a default baud rate - baud_rate = 9600; -} - -//serial_port (constructor) -// When created with port information, the constructor -// will automatically open port at baud rate -serial_port::serial_port(const char * name, unsigned int baud) -{ - serial_open(name, baud); -} - -//~serial_port (destructor) -// Closes the port before destroying the object -serial_port::~serial_port() -{ - serial_close(); -} - -//open -// Opens the serial port using stored information -// Sets the baud rate to the stored baud rate -// 8 data bits, no parity, one stop bit -bool serial_port::serial_open() -{ -// printf("SerialPort: Opening serial port %s at baud rate %d.\n", port_name, baud_rate); - - #ifdef WIN32 - file_descriptor = CreateFile(port_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - - if((int)file_descriptor < 0) - { -// printf("SerialPort: Port %s could not be opened: %d.\n", port_name, file_descriptor); - return false; - } - - SetupComm(file_descriptor, 1, 128); - GetCommState(file_descriptor, &dcb); - - dcb.BaudRate = baud_rate; //Set baud rate - dcb.ByteSize = 8; //8 data bits - dcb.Parity = NOPARITY; //Parity = none - dcb.StopBits = ONESTOPBIT; //One stop bit - dcb.fAbortOnError = TRUE; //Abort on error - dcb.fOutX = FALSE; //XON/XOFF off for transmit - dcb.fInX = FALSE; //XON/XOFF off for receive - dcb.fOutxCtsFlow = FALSE; //Turn off CTS flow control - dcb.fRtsControl = RTS_CONTROL_DISABLE; //Options DISABLE, ENABLE, HANDSHAKE - dcb.fOutxDsrFlow = FALSE; //Turn off DSR flow control - dcb.fDtrControl = DTR_CONTROL_DISABLE; //Disable DTR control - - SetCommState(file_descriptor, &dcb); - - COMMTIMEOUTS timeouts = {0}; - timeouts.ReadIntervalTimeout = 50; - timeouts.ReadTotalTimeoutConstant=50; - timeouts.ReadTotalTimeoutMultiplier=10; - timeouts.WriteTotalTimeoutConstant=50; - timeouts.WriteTotalTimeoutMultiplier=10; - SetCommTimeouts(file_descriptor, &timeouts); - - #else - - file_descriptor = open(port_name, O_RDWR | O_NOCTTY | O_NDELAY); - - if(file_descriptor < 0) - { -// printf("SerialPort: Port %s could not be opened: %d.\n", port_name, file_descriptor); - return false; - } - - struct termios2 options; - ioctl(file_descriptor, TCGETS2, &options); - options.c_cflag &= ~CBAUD; - options.c_cflag |= BOTHER; - options.c_ispeed = baud_rate; - options.c_ospeed = baud_rate; - ioctl(file_descriptor, TCSETS2, &options); - - //serial_struct ss; - //int closestSpeed; - //ioctl(file_descriptor, TIOCGSERIAL, &ss); - //ss.flags = (ss.flags & ~ASYNC_SPD_MASK) | ASYNC_SPD_CUST | ASYNCB_LOW_LATENCY; - //ss.custom_divisor = (ss.baud_base + (baud_rate / 2)) / baud_rate; - //if(ss.custom_divisor == 0) - //{ - // closestSpeed = baud_rate; - //} - //else - //{ - // closestSpeed = ss.baud_base / ss.custom_divisor; - //} - - //if((float)closestSpeed < ((float)baud_rate * (98.0f/100.0f)) || (float)closestSpeed > ((float)baud_rate * (102.0f/100.0f))) - //{ -// printf("SerialPort: Cannot set %s to %d. Closest possible speed is %d.\n", port_name, baud_rate, closestSpeed); - //} - //else - //{ -// printf("SerialPort: %s speed set to %d.\n", port_name, baud_rate); - //} - - //fcntl(file_descriptor, F_SETFL, 0); - #endif - -// printf("SerialPort: Serial port %s opened successfully.\n", port_name); - return true; -} - -//open -// Opens the serial port without changing stored baud rate -bool serial_port::serial_open(const char * name) -{ - return serial_open(name, baud_rate); -} - -//open -// Opens the serial port at baud rate -bool serial_port::serial_open(const char* name, unsigned int baud) -{ - strcpy(port_name, name); - baud_rate = baud; - return serial_open(); -} - -//close -// Closes the serial port -void serial_port::serial_close() -{ -// printf("SerialPort: Closing port %s.\n", port_name); - #ifdef WIN32 - - #else - - close(file_descriptor); - #endif -} - -// read -// Reads bytes from the serial port into -// Returns the number of bytes actually read -// If less than bytes are available, it will read all -// available bytes -int serial_port::serial_read(char * buffer, int length) -{ - #ifdef WIN32 - DWORD bytesread; - ReadFile(file_descriptor, buffer, length, &bytesread, NULL); - - #else - - int bytesread; - bytesread = read(file_descriptor, buffer, length); - #endif - - //printf("SerialPort: Read %d bytes on port %s.\n", bytesread, port_name); - return bytesread; -} - -//write -// Writes bytes to the serial port from -// Returns the number of bytes actually written -// Does not check for null-termination, so if is -// greater than the number of bytes in , it will read -// past and may cause a segfault -int serial_port::serial_write(char * buffer, int length) -{ - #ifdef WIN32 - DWORD byteswritten; - WriteFile(file_descriptor, buffer, length, &byteswritten, NULL); - - #else - - int byteswritten; - byteswritten = write(file_descriptor, buffer, length); - #endif - - //printf("SerialPort: Wrote %d bytes on port %s.\n", byteswritten, port_name); - return byteswritten; -} - -//flush -void serial_port::serial_flush_rx() -{ - #ifdef WIN32 - PurgeComm(file_descriptor, PURGE_RXABORT | PURGE_RXCLEAR); - - #else - - tcflush(file_descriptor, TCIFLUSH); - #endif -} - -void serial_port::serial_flush_tx() -{ - - #ifdef WIN32 - PurgeComm(file_descriptor, PURGE_TXABORT | PURGE_TXCLEAR); - - #else - - tcflush(file_descriptor, TCOFLUSH); - #endif -} diff --git a/KeyboardVisualizerCommon/serial_port.h b/KeyboardVisualizerCommon/serial_port.h deleted file mode 100644 index 4986ea5..0000000 --- a/KeyboardVisualizerCommon/serial_port.h +++ /dev/null @@ -1,93 +0,0 @@ -/*---------------------------------------------------------*\ -| Cross Platform Serial COM Library for Windows and Linux | -| This library provides access to serial ports with a | -| common API for both Windows and Linux systems. It | -| features read and write as well as tx/rx buffer flush. | -| | -| Adam Honse (calcprogrammer1@gmail.com), 1/21/2013 | -\*---------------------------------------------------------*/ - -#ifndef SERIAL_PORT_H -#define SERIAL_PORT_H - -#include -#include - -#ifdef WIN32 -#include - -#else - -#include -#include -#include -#include - -//winsize, termio, and termios structs are redefined in -//asm/termios.h, to prevent compiler errors from multply -//defining them, use a #define to rename them - -//essentially to undef them before they are redefined -#define winsize undefine_winsize -#define termio undefine_termio -#define termios undefine_termios - -#include -#include - - -#endif - - -//Serial Port Class -//The reason for this class is that serial ports are treated differently -//on Windows and Linux. By creating a class, those differences can be -//made invisible to the program and make cross-platform usage easy - -class serial_port -{ - public: - serial_port(); - serial_port(const char * name, unsigned int baud); - - ~serial_port(); - - //Function to open the port - bool serial_open(); - bool serial_open(const char* name); - bool serial_open(const char* name, unsigned int baud); - - //Function to close the port - void serial_close(); - - //Functions for controlling baud rate - void serial_set_baud(unsigned int baud); - int serial_get_baud(); - - //Function to read data from the port buffer - int serial_read(char * buffer, int length); - - //Function to write data to the serial port - int serial_write(char * buffer, int length); - - //Functions to flush the serial port rx and tx buffers - void serial_flush_rx(); - void serial_flush_tx(); - - //Function to list the number of available bytes - int serial_available(); - - private: - char port_name[1024]; - unsigned int baud_rate; - - #ifdef WIN32 - HANDLE file_descriptor; - DCB dcb; - - #else - - int file_descriptor; - #endif -}; - -#endif diff --git a/KeyboardVisualizerQT/KeyboardVisDlg.cpp b/KeyboardVisualizerQT/KeyboardVisDlg.cpp index 31635a4..1f83eac 100644 --- a/KeyboardVisualizerQT/KeyboardVisDlg.cpp +++ b/KeyboardVisualizerQT/KeyboardVisDlg.cpp @@ -3,19 +3,34 @@ #include "KeyboardVisualizerCommon/VisualizerDefines.h" #include "ui_keyboardvisualizer.h" +#include +#include + Visualizer* vis_ptr; boolean startminimized; boolean firstrun; using namespace Ui; +static void UpdateOpenRGBClientListCallback(void * this_ptr) +{ + KeyboardVisDlg * this_obj = (KeyboardVisDlg *)this_ptr; + + QMetaObject::invokeMethod(this_obj, "UpdateOpenRGBClientList", Qt::QueuedConnection); +} + KeyboardVisDlg::KeyboardVisDlg(QWidget *parent) : QMainWindow(parent), ui(new KeyboardVisualizerDlg) { startminimized = false; firstrun = true; ui->setupUi(this); - QIcon icon(":Icon.png"); + + std::string titleString = "Keyboard Visualizer "; + titleString.append(VERSION_STRING); + setWindowTitle(titleString.c_str()); + + QIcon icon(":KeyboardVisualizer.png"); setWindowIcon(icon); QAction* actionExit = new QAction( "Show/Hide", this ); @@ -29,6 +44,9 @@ KeyboardVisDlg::KeyboardVisDlg(QWidget *parent) : QMainWindow(parent), ui(new Ke trayIcon->setToolTip("Keyboard Visualizer"); trayIcon->setContextMenu(myTrayIconMenu); trayIcon->show(); + + ui->lineEdit_IP->setText("127.0.0.1"); + ui->lineEdit_Port->setText(QString::number(OPENRGB_SDK_PORT)); } void KeyboardVisDlg::show() @@ -125,6 +143,8 @@ void KeyboardVisDlg::SetVisualizer(Visualizer* v) { vis_ptr = v; + vis_ptr->RegisterClientInfoChangeCallback(UpdateOpenRGBClientListCallback, this); + ui->lineEdit_Normalization_Offset->setText(QString::number(vis_ptr->nrml_ofst)); ui->lineEdit_Normalization_Scale->setText(QString::number(vis_ptr->nrml_scl)); ui->lineEdit_Animation_Speed->setText(QString::number(vis_ptr->anim_speed)); @@ -344,3 +364,147 @@ void Ui::KeyboardVisDlg::on_lineEdit_Background_Timeout_textChanged(const QStrin vis_ptr->OnSettingsChanged(); } + +class NetworkClientPointer : public QObject +{ +public: + NetworkClient * net_client; +}; + +class EnableCheckboxArg : public QObject +{ +public: + ControllerSettingsType * settings_ptr; +}; + +void Ui::KeyboardVisDlg::UpdateOpenRGBClientList() +{ + ui->tree_Devices->clear(); + + //OpenRGB device list + ui->tree_Devices->setColumnCount(2); + ui->tree_Devices->header()->setStretchLastSection(false); + ui->tree_Devices->header()->setSectionResizeMode(0, QHeaderView::Stretch); + ui->tree_Devices->setColumnWidth(1, 100); + ui->tree_Devices->setHeaderLabels(QStringList() << "Connected Clients" << ""); + + /*-----------------------------------------------------*\ + | Create a signal mapper for Disconnect buttons | + \*-----------------------------------------------------*/ + QSignalMapper* signalMapper = new QSignalMapper(this); + connect(signalMapper, SIGNAL(mapped(QObject *)), this, SLOT(on_button_Disconnect_clicked(QObject *))); + + /*-----------------------------------------------------*\ + | Create a signal mapper for Enabled checkboxes | + \*-----------------------------------------------------*/ + QSignalMapper* checkMapper = new QSignalMapper(this); + connect(checkMapper, SIGNAL(mapped(QObject *)), this, SLOT(on_button_Enabled_clicked(QObject *))); + + /*-----------------------------------------------------*\ + | Loop through all active clients and populate list | + \*-----------------------------------------------------*/ + for(int client_idx = 0; client_idx < vis_ptr->rgb_clients.size(); client_idx++) + { + QTreeWidgetItem* new_top_item = new QTreeWidgetItem(ui->tree_Devices); + new_top_item->setText(0, QString::fromStdString(vis_ptr->rgb_clients[client_idx]->GetIP())); + + /*-----------------------------------------------------*\ + | Create a Disconnect button for this client and map it | + \*-----------------------------------------------------*/ + QPushButton* new_button = new QPushButton( "Disconnect" ); + ui->tree_Devices->setItemWidget(new_top_item, 1, new_button); + + connect(new_button, SIGNAL(clicked()), signalMapper, SLOT(map())); + + NetworkClientPointer * new_arg = new NetworkClientPointer(); + new_arg->net_client = vis_ptr->rgb_clients[client_idx]; + + signalMapper->setMapping(new_button, new_arg); + + /*-----------------------------------------------------*\ + | Loop through all devices on this client | + \*-----------------------------------------------------*/ + for(int controller_idx = 0; controller_idx < vis_ptr->rgb_clients[client_idx]->server_controllers.size(); controller_idx++) + { + QTreeWidgetItem* new_item = new QTreeWidgetItem(new_top_item); + new_item->setText(0, QString::fromStdString(vis_ptr->rgb_clients[client_idx]->server_controllers[controller_idx]->name)); + + /*-----------------------------------------------------*\ + | Create an Enabled checkbox for this device and map it | + \*-----------------------------------------------------*/ + QCheckBox* new_check = new QCheckBox( "Enabled" ); + ui->tree_Devices->setItemWidget(new_item, 1, new_check); + + if(controller_idx < vis_ptr->rgb_client_settings[client_idx]->controller_settings.size()) + { + new_check->setChecked(vis_ptr->rgb_client_settings[client_idx]->controller_settings[controller_idx]->enabled); + + connect(new_check, SIGNAL(clicked()), checkMapper, SLOT(map())); + EnableCheckboxArg * check_arg = new EnableCheckboxArg(); + check_arg->settings_ptr = vis_ptr->rgb_client_settings[client_idx]->controller_settings[controller_idx]; + checkMapper->setMapping(new_check, check_arg); + } + + /*-----------------------------------------------------*\ + | Loop through all zones on this device | + \*-----------------------------------------------------*/ + for(int zone_idx = 0; zone_idx < vis_ptr->rgb_clients[client_idx]->server_controllers[controller_idx]->zones.size(); zone_idx++) + { + QTreeWidgetItem* new_child = new QTreeWidgetItem(); + + std::string zone_str = vis_ptr->rgb_clients[client_idx]->server_controllers[controller_idx]->zones[zone_idx].name + ", "; + zone_str.append(std::to_string(vis_ptr->rgb_clients[client_idx]->server_controllers[controller_idx]->zones[zone_idx].leds_count)); + zone_str.append(" LEDs, "); + + switch(vis_ptr->rgb_clients[client_idx]->server_controllers[controller_idx]->zones[zone_idx].type) + { + case ZONE_TYPE_SINGLE: + zone_str.append("Single"); + break; + + case ZONE_TYPE_LINEAR: + zone_str.append("Linear"); + break; + + case ZONE_TYPE_MATRIX: + zone_str.append("Matrix"); + break; + } + + new_child->setText(0, QString::fromStdString(zone_str)); + + + new_item->addChild(new_child); + } + } + } +} + +void Ui::KeyboardVisDlg::on_button_Disconnect_clicked(QObject * arg) +{ + NetworkClient * disconnect_client = ((NetworkClientPointer *)arg)->net_client; + + vis_ptr->OpenRGBDisconnect(disconnect_client); +} + +void Ui::KeyboardVisDlg::on_button_Enabled_clicked(QObject * arg) +{ + EnableCheckboxArg * checkbox_arg = ((EnableCheckboxArg *)arg); + + if(checkbox_arg->settings_ptr->enabled) + { + checkbox_arg->settings_ptr->enabled = false; + } + else + { + checkbox_arg->settings_ptr->enabled = true; + } +} + +void Ui::KeyboardVisDlg::on_button_Connect_clicked() +{ + unsigned short port = std::stoi(ui->lineEdit_Port->text().toStdString()); + std::string ip = ui->lineEdit_IP->text().toStdString(); + + NetworkClient * new_client = vis_ptr->OpenRGBConnect(ip.c_str(), port); +} diff --git a/KeyboardVisualizerQT/KeyboardVisDlg.h b/KeyboardVisualizerQT/KeyboardVisDlg.h index d312721..d1c02b8 100644 --- a/KeyboardVisualizerQT/KeyboardVisDlg.h +++ b/KeyboardVisualizerQT/KeyboardVisDlg.h @@ -26,6 +26,9 @@ class Ui::KeyboardVisDlg : public QMainWindow void SetVisualizer(Visualizer* v); void StartMinimized(boolean startmin); +public slots: + void UpdateOpenRGBClientList(); + private slots: void update(); @@ -69,6 +72,12 @@ private slots: void on_lineEdit_Background_Timeout_textChanged(const QString &arg1); + void on_button_Connect_clicked(); + + void on_button_Disconnect_clicked(QObject *); + + void on_button_Enabled_clicked(QObject *); + private: Ui::KeyboardVisualizerDlg *ui; QSystemTrayIcon* trayIcon; diff --git a/KeyboardVisualizerQT/KeyboardVisualizer.desktop b/KeyboardVisualizerQT/KeyboardVisualizer.desktop new file mode 100644 index 0000000..df99c12 --- /dev/null +++ b/KeyboardVisualizerQT/KeyboardVisualizer.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=Keyboard Visualizer +Comment=Control RGB lighting +Exec=KeyboardVisualizer +Icon=KeyboardVisualizer +Terminal=false +Categories=Utility; diff --git a/KeyboardVisualizerQT/KeyboardVisualizer.icns b/KeyboardVisualizerQT/KeyboardVisualizer.icns new file mode 100644 index 0000000..c6f4d67 Binary files /dev/null and b/KeyboardVisualizerQT/KeyboardVisualizer.icns differ diff --git a/KeyboardVisualizerVC/icon.ico b/KeyboardVisualizerQT/KeyboardVisualizer.ico similarity index 100% rename from KeyboardVisualizerVC/icon.ico rename to KeyboardVisualizerQT/KeyboardVisualizer.ico diff --git a/KeyboardVisualizerQT/Icon.png b/KeyboardVisualizerQT/KeyboardVisualizer.png similarity index 100% rename from KeyboardVisualizerQT/Icon.png rename to KeyboardVisualizerQT/KeyboardVisualizer.png diff --git a/KeyboardVisualizerQT/keyboardvisualizer.ui b/KeyboardVisualizerQT/keyboardvisualizer.ui index 3ce9174..a79295b 100644 --- a/KeyboardVisualizerQT/keyboardvisualizer.ui +++ b/KeyboardVisualizerQT/keyboardvisualizer.ui @@ -7,509 +7,315 @@ 0 0 600 - 360 + 600 - Keyboard Visualizer 3.06 + Keyboard Visualizer - - - - 10 - 10 - 140 - 16 - - - - Amplitude (%) - - - - - - 150 - 5 - 130 - 25 - - - - - - - 10 - 40 - 140 - 16 - - - - Background Brightness - - - - - - 150 - 35 - 130 - 25 - - - - - - - 10 - 70 - 140 - 16 - - - - Average Size - - - - - - 150 - 65 - 130 - 25 - - - - - - - 10 - 100 - 140 - 16 - - - - Decay (% per step) - - - - - - 150 - 95 - 130 - 25 - - - - - - - 10 - 130 - 140 - 16 - - - - Delay (ms) - - - - - - 150 - 125 - 130 - 25 - - - - - - - 10 - 160 - 140 - 16 - - - - Normalization Offset - - - - - - 150 - 155 - 130 - 25 - - - - - - - 10 - 190 - 140 - 16 - - - - Normalization Scale - - - - - - 150 - 185 - 130 - 25 - - - - - - - 290 - 10 - 140 - 16 - - - - FFT Window Mode - - - - - - 440 - 5 - 150 - 25 - - - - - - - 290 - 40 - 140 - 16 - - - - Background Mode - - - - - - 440 - 35 - 150 - 25 - - - - - - - 290 - 70 - 140 - 16 - - - - Foreground Mode - - - - - - 440 - 65 - 150 - 25 - - - - - - - 290 - 100 - 140 - 16 - - - - Single Color Mode - - - - - - 440 - 95 - 150 - 25 - - - - - - - 290 - 130 - 140 - 16 - - - - Average Mode - - - - - - 440 - 125 - 150 - 25 - - - - - - - 290 - 190 - 140 - 16 - - - - Animation Speed - - - - - - 440 - 185 - 150 - 25 - - - - - - - 150 - 275 - 256 - 64 - - - - - 0 - 0 - - - - - 256 - 64 - - - - - 256 - 64 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - false - - - - - - 10 - 280 - 140 - 16 - - - - Visualization Preview - - - - - - 440 - 275 - 150 - 25 - - - - Save Settings - - - - - - 10 - 340 - 581 - 16 - - - - https://github.com/CalcProgrammer1/KeyboardVisualizer - - - - - - 440 - 215 - 150 - 26 - - - - - - - - - - 290 - 220 - 140 - 20 - - - - Reactive Background - - - - - - 290 - 160 - 140 - 16 - - - - Audio Device - - - - - - 440 - 155 - 150 - 27 - - - - - - - 150 - 215 - 130 - 25 - - - - - - - 10 - 220 - 140 - 16 - - - - Filter Constant - - - - - - 440 - 245 - 150 - 26 - - - - - - - - - - 290 - 250 - 140 - 20 - - - - Silent Background - - - - - - 150 - 245 - 130 - 25 - - - - - - - 10 - 250 - 140 - 16 - - - - Background Timeout - - + + + + + FFT Window Mode + + + + + + + + 0 + 0 + + + + + 256 + 64 + + + + + 256 + 64 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + + + + + + + + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + Visualization Preview + + + + + + + + + + + + + + Normalization Offset + + + + + + + + + + Average Size + + + + + + + + 1 + + + + + + + + Save Settings + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + Normalization Scale + + + + + + + Delay (ms) + + + + + + + + + + + + + + Background Brightness + + + + + + + Background Mode + + + + + + + Decay (% per step) + + + + + + + + + + Silent Background + + + + + + + + + + Reactive Background + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + Audio Device + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + Background Timeout + + + + + + + Filter Constant + + + + + + + + + + Average Mode + + + + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + IP: + + + + + + + Amplitude (%) + + + + + + + Single Color Mode + + + + + + + Animation Speed + + + + + + + + + + + + + + + + Foreground Mode + + + + + + + + + + Port + + + + + + + Connect + + + + + + + https://gitlab.com/CalcProgrammer1/KeyboardVisualizer + + + + diff --git a/KeyboardVisualizerQT/main.cpp b/KeyboardVisualizerQT/main.cpp index 830f208..b1b0ee6 100644 --- a/KeyboardVisualizerQT/main.cpp +++ b/KeyboardVisualizerQT/main.cpp @@ -1,10 +1,17 @@ #include "KeyboardVisDlg.h" #include -#include "KeyboardVisualizerCommon/LEDStrip.h" #include "KeyboardVisualizerCommon/Visualizer.h" #include "KeyboardVisualizerCommon/VisualizerDefines.h" +#if defined(_WIN32) || defined(_WIN64) +/* We are on Windows */ +# define strtok_r strtok_s +#endif + +#ifndef WIN32 #include +#endif + #include #include #include @@ -110,26 +117,6 @@ void parse_argument_string(char * argument, char * value) { vis.avg_mode = atoi(value); } - } - else if (strcmp(argument, "ledstrip") == 0) - { - vis.AddLEDStrip(LED_STRIP_NORMAL, value); - } - else if (strcmp(argument, "xmas") == 0) - { - vis.AddLEDStrip(LED_STRIP_XMAS, value); - } - else if (strcmp(argument, "hueplus") == 0) - { - vis.AddLEDStrip(LED_STRIP_NORMAL, value); - } - else if (strcmp(argument, "server") == 0) - { - vis.InitServer(value); - } - else if (strcmp(argument, "client") == 0) - { - vis.InitClient(value); } else if (strcmp(argument, "reactive_bkgd") == 0) { @@ -235,25 +222,6 @@ bool parse_command_line(int argc, char *argv[]) printf(" - 0: Binning\r\n"); printf(" - 1: Low-pass filtering\r\n"); printf(" anim_speed - Animation Speed (percent)\r\n"); - printf(" server - Configure this instance as a server for synchronization\r\n"); - printf(" - Takes what port to serve on as argument, i.e. server=1234\r\n"); - printf(" client - Configure this instance as a client for synchronization\r\n"); - printf(" - Takes the IP/hostname of the server and port as arguments,\r\n"); - printf(" - i.e. client=192.168.1.100,1234\r\n"); - printf(" ledstrip - LED config strings :\r\n"); - printf(" - Serial : ledstrip=port,baud,num_leds\r\n"); - printf(" - (ex.ledstrip=COM1,115200,30)\r\n"); - printf(" - UDP : ledstrip=udp:client,port,num_leds\r\n"); - printf(" - (ex.ledstrip=udp:192.168.1.5,1234,30)\r\n"); - printf(" xmas - COM port, ex. xmas=COM2\r\n"); - printf(" hueplus - HUE+ config:\r\n"); - printf(" - hueplus=port,channel,num_leds\r\n"); - printf(" - channel: 0 -> both channels, 1 -> channel 1, 2 -> channel 2\r\n"); - printf(" - num_leds: Fans * 8 ex. 3 Fans -> 24\r\n"); - printf(" - Important for Fans: If you have connected fans on both channels only count the fans on the channel with the most fans\r\n"); - printf(" ex. 3 Fans on Ch. 1 4 Fans on CH. 2: num_leds 32 for the 4 Fans\r\n"); - printf(" For best Visualizer results don`t connect on one channel 3 fans more than on the other channel\r\n"); - printf(" - (ex. hueplus=COM4,1,24\r\n"); return false; } @@ -262,7 +230,7 @@ bool parse_command_line(int argc, char *argv[]) return true; } -void parse_settings_file(char * filename) +void parse_settings_file(const char * filename) { std::ifstream infile; @@ -301,16 +269,8 @@ int main(int argc, char *argv[]) //Initialize Visualizer vis.Initialize(); - //Get file path in executable directory - char filename[2048]; - //GetModuleFileName(NULL, filename, 2048); - char arg1[64]; - snprintf(arg1, 64, "/proc/%d/exe", getpid()); - readlink(arg1, filename, 1024); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - //strcat(filename, "\\settings.txt"); - strcat(filename, "/settings.txt"); - parse_settings_file(filename); + //Parse Settings File + parse_settings_file("settings.txt"); //Parse Command Line if (!parse_command_line(argc, argv)) diff --git a/KeyboardVisualizerQT/resources.qrc b/KeyboardVisualizerQT/resources.qrc index 2c73ecd..2cdbf81 100644 --- a/KeyboardVisualizerQT/resources.qrc +++ b/KeyboardVisualizerQT/resources.qrc @@ -1,5 +1,5 @@ - - - Icon.png - + + + KeyboardVisualizer.png + diff --git a/KeyboardVisualizerVC.sln b/KeyboardVisualizerVC.sln deleted file mode 100644 index 084ba24..0000000 --- a/KeyboardVisualizerVC.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardVisualizerVC", "KeyboardVisualizerVC\KeyboardVisualizerVC.vcxproj", "{11970D07-B63F-487B-AA02-2EDCAD2F71A0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {11970D07-B63F-487B-AA02-2EDCAD2F71A0}.Debug|x86.ActiveCfg = Debug|Win32 - {11970D07-B63F-487B-AA02-2EDCAD2F71A0}.Debug|x86.Build.0 = Debug|Win32 - {11970D07-B63F-487B-AA02-2EDCAD2F71A0}.Release|x86.ActiveCfg = Release|Win32 - {11970D07-B63F-487B-AA02-2EDCAD2F71A0}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/KeyboardVisualizerVC/Icon.png b/KeyboardVisualizerVC/Icon.png deleted file mode 100644 index 8c9c638..0000000 Binary files a/KeyboardVisualizerVC/Icon.png and /dev/null differ diff --git a/KeyboardVisualizerVC/KeyboardVisDlg.cpp b/KeyboardVisualizerVC/KeyboardVisDlg.cpp deleted file mode 100644 index a4e966b..0000000 --- a/KeyboardVisualizerVC/KeyboardVisDlg.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/*---------------------------------------------------------*\ -| Processing Code for Keyboard Visualizer Dialog | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "stdafx.h" -#include "KeyboardVisDlg.h" -#include "afxdialogex.h" -#include "resource.h" -#include - -// KeyboardVisDlg dialog - -// tray icon ID -#define ID_SYSTEMTRAY 0x1000 - -// custom message ID -#define WM_TRAYICON_EVENT (WM_APP + 1) - -IMPLEMENT_DYNAMIC(KeyboardVisDlg, CDialogEx) - -Visualizer* vis; -boolean startminimized; -boolean firstrun; -NOTIFYICONDATA Tray; - -KeyboardVisDlg::KeyboardVisDlg(CWnd* pParent) - : CDialogEx(IDD_KEYBOARD_VISUALIZER_DLG, pParent) -{ - startminimized = false; -} - -void KeyboardVisDlg::SetVisualizer(Visualizer* v) -{ - vis = v; -} - -KeyboardVisDlg::~KeyboardVisDlg() -{ -} - -void KeyboardVisDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); -} - -BOOL KeyboardVisDlg::OnInitDialog() -{ - Tray.cbSize = sizeof(Tray); - Tray.hIcon = (HICON)::LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, LR_SHARED); - Tray.hWnd = GetSafeHwnd(); - strcpy(Tray.szTip, "Keyboard Visualizer"); - Tray.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; - Tray.uID = ID_SYSTEMTRAY; - Tray.uCallbackMessage = WM_TRAYICON_EVENT; - - Shell_NotifyIcon(NIM_ADD, &Tray); - - char nrml_ofst_str[64]; - char nrml_scl_str[64]; - char anim_speed_str[64]; - char fltr_const_str[64]; - - snprintf(nrml_ofst_str, 64, "%f", vis->nrml_ofst); - snprintf(nrml_scl_str, 64, "%f", vis->nrml_scl); - snprintf(anim_speed_str, 64, "%f", vis->anim_speed); - snprintf(fltr_const_str, 64, "%f", vis->filter_constant); - - SetDlgItemInt(IDC_EDIT_AMPLITUDE, vis->amplitude); - SetDlgItemInt(IDC_EDIT_BACKGROUND_BRIGHTNESS, vis->bkgd_bright); - SetDlgItemInt(IDC_EDIT_AVERAGE_SIZE, vis->avg_size); - SetDlgItemInt(IDC_EDIT_DECAY, vis->decay); - SetDlgItemInt(IDC_EDIT_DELAY, vis->delay); - SetDlgItemInt(IDC_EDIT_BACKGROUND_TIMEOUT, vis->background_timeout); - SetDlgItemText(IDC_EDIT_ANIM_SPEED, anim_speed_str); - SetDlgItemText(IDC_EDIT_NRML_OFST, nrml_ofst_str); - SetDlgItemText(IDC_EDIT_NRML_SCL, nrml_scl_str); - SetDlgItemText(IDC_EDIT_FILTER_CONSTANT, fltr_const_str); - - CComboBox* windowBox = (CComboBox*)GetDlgItem(IDC_COMBO_WINDOW); - windowBox->AddString("None"); - windowBox->AddString("Hanning"); - windowBox->AddString("Hamming"); - windowBox->AddString("Blackman"); - windowBox->SetCurSel(vis->window_mode); - - CComboBox* bkgdModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_BKGD_MODE); - for (int i = 0; i < VISUALIZER_NUM_PATTERNS; i++) - { - bkgdModeBox->AddString(visualizer_pattern_labels[i]); - } - bkgdModeBox->SetCurSel(vis->bkgd_mode); - - CComboBox* frgdModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_FRGD_MODE); - for (int i = 0; i < VISUALIZER_NUM_PATTERNS; i++) - { - frgdModeBox->AddString(visualizer_pattern_labels[i]); - } - frgdModeBox->SetCurSel(vis->frgd_mode); - - CComboBox* snglClrModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_SNGL_CLR_MODE); - for (int i = 0; i < VISUALIZER_NUM_SINGLE_COLOR; i++) - { - snglClrModeBox->AddString(visualizer_single_color_labels[i]); - } - snglClrModeBox->SetCurSel(vis->single_color_mode); - - CComboBox* avgModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_AVG_MODE); - avgModeBox->AddString("Binning"); - avgModeBox->AddString("Low Pass"); - avgModeBox->SetCurSel(vis->avg_mode); - - CComboBox* audioDeviceBox = (CComboBox*)GetDlgItem(IDC_COMBO_AUDIO_DEVICE); - for (int i = 0; i < vis->audio_devices.size(); i++) - { - audioDeviceBox->AddString(vis->audio_devices[i]); - } - audioDeviceBox->SetCurSel(vis->audio_device_idx); - - ((CButton*)GetDlgItem(IDC_CHECK_REACTIVE_BACKGROUND))->SetCheck(vis->reactive_bkgd); - ((CButton*)GetDlgItem(IDC_CHECK_SILENT_BACKGROUND))->SetCheck(vis->silent_bkgd); - - timer = SetTimer(1, 25, NULL); - - firstrun = true; - - return true; -} - -void KeyboardVisDlg::StartMinimized(boolean startmin) -{ - startminimized = startmin; -} - -void KeyboardVisDlg::OnDestroy() -{ - vis->Shutdown(); - Shell_NotifyIcon(NIM_DELETE, &Tray); -} - -void KeyboardVisDlg::OnTimer(UINT nIDEvent) -{ - if (startminimized && firstrun) - { - firstrun = false; - ShowWindow(SW_HIDE); - } - - COLORREF pixels_bgr[64][256]; - - //CreateBitmap uses BGR color layout, convert from RGB - for (int x = 0; x < 256; x++) - { - for (int y = 0; y < 64; y++) - { - if (vis->pixels_out != NULL) - { - pixels_bgr[y][x] = RGB2BGR(vis->pixels_out->pixels[y][x]); - } - } - } - - HBITMAP hBitmap = CreateBitmap(256, 64, 1, 32, pixels_bgr); - ((CStatic *)GetDlgItem(IDC_IMAGE_VISUALIZATION))->SetBitmap(hBitmap); - DeleteObject(hBitmap); - - if (vis->update_ui) - { - char nrml_ofst_str[64]; - char nrml_scl_str[64]; - char anim_speed_str[64]; - char fltr_const_str[64]; - - snprintf(nrml_ofst_str, 64, "%f", vis->nrml_ofst); - snprintf(nrml_scl_str, 64, "%f", vis->nrml_scl); - snprintf(anim_speed_str, 64, "%f", vis->anim_speed); - snprintf(fltr_const_str, 64, "%f", vis->filter_constant); - - SetDlgItemInt(IDC_EDIT_AMPLITUDE, vis->amplitude); - SetDlgItemInt(IDC_EDIT_BACKGROUND_BRIGHTNESS, vis->bkgd_bright); - SetDlgItemInt(IDC_EDIT_AVERAGE_SIZE, vis->avg_size); - SetDlgItemInt(IDC_EDIT_DECAY, vis->decay); - SetDlgItemInt(IDC_EDIT_DELAY, vis->delay); - SetDlgItemInt(IDC_EDIT_BACKGROUND_TIMEOUT, vis->background_timeout); - SetDlgItemText(IDC_EDIT_ANIM_SPEED, anim_speed_str); - SetDlgItemText(IDC_EDIT_NRML_OFST, nrml_ofst_str); - SetDlgItemText(IDC_EDIT_NRML_SCL, nrml_scl_str); - SetDlgItemText(IDC_EDIT_FILTER_CONSTANT, fltr_const_str); - - CComboBox* windowBox = (CComboBox*)GetDlgItem(IDC_COMBO_WINDOW); - windowBox->SetCurSel(vis->window_mode); - - CComboBox* bkgdModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_BKGD_MODE); - bkgdModeBox->SetCurSel(vis->bkgd_mode); - - CComboBox* frgdModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_FRGD_MODE); - frgdModeBox->SetCurSel(vis->frgd_mode); - - CComboBox* snglClrModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_SNGL_CLR_MODE); - snglClrModeBox->SetCurSel(vis->single_color_mode); - - CComboBox* avgModeBox = (CComboBox*)GetDlgItem(IDC_COMBO_AVG_MODE); - avgModeBox->SetCurSel(vis->avg_mode); - - ((CButton*)GetDlgItem(IDC_CHECK_REACTIVE_BACKGROUND))->SetCheck(vis->reactive_bkgd); - ((CButton*)GetDlgItem(IDC_CHECK_SILENT_BACKGROUND))->SetCheck(vis->silent_bkgd); - - vis->update_ui = false; - } -} - -LRESULT KeyboardVisDlg::OnTrayIconEvent(WPARAM wParam, LPARAM lParam) -{ - if ((UINT)wParam != ID_SYSTEMTRAY) - return ERROR_SUCCESS; - - switch ((UINT)lParam) - { - case WM_LBUTTONUP: - { - if (IsWindowVisible()) - { - KillTimer(timer); - ShowWindow(SW_HIDE); - } - else - { - ShowWindow(SW_SHOW); - timer = SetTimer(1, 25, NULL); - } - break; - } - } - - return ERROR_SUCCESS; -} - -BEGIN_MESSAGE_MAP(KeyboardVisDlg, CDialogEx) - ON_WM_TIMER() - ON_EN_CHANGE(IDC_EDIT_AMPLITUDE, &KeyboardVisDlg::OnEnChangeEditAmplitude) - ON_EN_CHANGE(IDC_EDIT_BACKGROUND_BRIGHTNESS, &KeyboardVisDlg::OnEnChangeEditBackgroundBrightness) - ON_CBN_SELCHANGE(IDC_COMBO_WINDOW, &KeyboardVisDlg::OnCbnSelchangeComboWindow) - ON_EN_CHANGE(IDC_EDIT_AVERAGE_SIZE, &KeyboardVisDlg::OnEnChangeEditAverageSize) - ON_CBN_SELCHANGE(IDC_COMBO_BKGD_MODE, &KeyboardVisDlg::OnCbnSelchangeComboBkgdMode) - ON_EN_CHANGE(IDC_EDIT_DECAY, &KeyboardVisDlg::OnEnChangeEditDecay) - ON_EN_CHANGE(IDC_EDIT_DELAY, &KeyboardVisDlg::OnEnChangeEditDelay) - ON_CBN_SELCHANGE(IDC_COMBO_FRGD_MODE, &KeyboardVisDlg::OnCbnSelchangeComboFrgdMode) - ON_WM_DESTROY() - ON_MESSAGE(WM_TRAYICON_EVENT, OnTrayIconEvent) - ON_CBN_SELCHANGE(IDC_COMBO_AVG_MODE, &KeyboardVisDlg::OnCbnSelchangeComboAvgMode) - ON_CBN_SELCHANGE(IDC_COMBO_SNGL_CLR_MODE, &KeyboardVisDlg::OnCbnSelchangeComboSnglClrMode) - ON_EN_CHANGE(IDC_EDIT_NRML_OFST, &KeyboardVisDlg::OnEnChangedEditNrmlOfst) - ON_EN_CHANGE(IDC_EDIT_NRML_SCL, &KeyboardVisDlg::OnEnChangedEditNrmlScl) - ON_BN_CLICKED(IDC_BUTTON_SAVE, &KeyboardVisDlg::OnClickedSave) - ON_EN_CHANGE(IDC_EDIT_ANIM_SPEED, &KeyboardVisDlg::OnEnChangeEditAnimSpeed) - ON_BN_CLICKED(IDC_CHECK_REACTIVE_BACKGROUND, &KeyboardVisDlg::OnBnClickedCheckReactiveBackground) - ON_CBN_SELCHANGE(IDC_COMBO_AUDIO_DEVICE, &KeyboardVisDlg::OnCbnSelchangeComboAudioDevice) - ON_EN_CHANGE(IDC_EDIT_FILTER_CONSTANT, &KeyboardVisDlg::OnEnChangeEditFilterConstant) - ON_CBN_DROPDOWN(IDC_COMBO_AUDIO_DEVICE, &KeyboardVisDlg::OnCbnDropdownComboAudioDevice) - ON_EN_CHANGE(IDC_EDIT_BACKGROUND_TIMEOUT, &KeyboardVisDlg::OnEnChangeEditBackgroundTimeout) - ON_BN_CLICKED(IDC_CHECK_SILENT_BACKGROUND, &KeyboardVisDlg::OnBnClickedCheckSilentBackground) -END_MESSAGE_MAP() - -void KeyboardVisDlg::OnEnChangeEditAmplitude() -{ - vis->amplitude = GetDlgItemInt(IDC_EDIT_AMPLITUDE, 0, 0); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnEnChangeEditBackgroundBrightness() -{ - vis->bkgd_bright = (int)(GetDlgItemInt(IDC_EDIT_BACKGROUND_BRIGHTNESS, 0, 0)); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboWindow() -{ - vis->window_mode = ((CComboBox*)GetDlgItem(IDC_COMBO_WINDOW))->GetCurSel(); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnEnChangeEditAverageSize() -{ - vis->avg_size = (int)GetDlgItemInt(IDC_EDIT_AVERAGE_SIZE, 0, 0); - if (vis->avg_size < 1) - { - vis->avg_size = 1; - } - else if (vis->avg_size > 128) - { - vis->avg_size = 128; - } - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboBkgdMode() -{ - vis->bkgd_mode = ((CComboBox*)GetDlgItem(IDC_COMBO_BKGD_MODE))->GetCurSel(); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnEnChangeEditDecay() -{ - vis->decay = (int)GetDlgItemInt(IDC_EDIT_DECAY, 0, 0); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnEnChangeEditDelay() -{ - vis->delay = (int)GetDlgItemInt(IDC_EDIT_DELAY, 0, 0); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboFrgdMode() -{ - vis->frgd_mode = ((CComboBox*)GetDlgItem(IDC_COMBO_FRGD_MODE))->GetCurSel(); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboAvgMode() -{ - vis->avg_mode = ((CComboBox*)GetDlgItem(IDC_COMBO_AVG_MODE))->GetCurSel(); - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboSnglClrMode() -{ - vis->single_color_mode = ((CComboBox*)GetDlgItem(IDC_COMBO_SNGL_CLR_MODE))->GetCurSel(); - vis->OnSettingsChanged(); -} - -void KeyboardVisDlg::OnEnChangedEditNrmlOfst() -{ - char val[64]; - GetDlgItemText(IDC_EDIT_NRML_OFST, (LPTSTR)&val, 64); - vis->nrml_ofst = strtod(val, NULL); - vis->SetNormalization(vis->nrml_ofst, vis->nrml_scl); - vis->OnSettingsChanged(); -} - -void KeyboardVisDlg::OnEnChangedEditNrmlScl() -{ - char val[64]; - GetDlgItemText(IDC_EDIT_NRML_SCL, (LPTSTR)&val, 64); - vis->nrml_scl = strtod(val, NULL); - vis->SetNormalization(vis->nrml_ofst, vis->nrml_scl); - vis->OnSettingsChanged(); -} - -void KeyboardVisDlg::OnClickedSave() -{ - vis->SaveSettings(); -} - -void KeyboardVisDlg::OnEnChangeEditAnimSpeed() -{ - char val[64]; - GetDlgItemText(IDC_EDIT_ANIM_SPEED, (LPTSTR)&val, 64); - vis->anim_speed = strtod(val, NULL); - vis->OnSettingsChanged(); -} - -void KeyboardVisDlg::OnBnClickedCheckReactiveBackground() -{ - vis->reactive_bkgd = ((CButton*)GetDlgItem(IDC_CHECK_REACTIVE_BACKGROUND))->GetCheck(); - - if (vis->reactive_bkgd == true) - { - vis->silent_bkgd = false; - ((CButton*)GetDlgItem(IDC_CHECK_SILENT_BACKGROUND))->SetCheck(false); - } - - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnSelchangeComboAudioDevice() -{ - int new_idx = ((CComboBox*)GetDlgItem(IDC_COMBO_AUDIO_DEVICE))->GetCurSel(); - if (vis->audio_device_idx != new_idx) - { - vis->audio_device_idx = new_idx; - vis->ChangeAudioDevice(); - } -} - - -void KeyboardVisDlg::OnEnChangeEditFilterConstant() -{ - char val[64]; - GetDlgItemText(IDC_EDIT_FILTER_CONSTANT, (LPTSTR)&val, 64); - vis->filter_constant = strtod(val, NULL); - if (vis->filter_constant > 1.0f) - { - vis->filter_constant = 1.0f; - } - else if (vis->filter_constant < 0.0f) - { - vis->filter_constant = 0.0f; - } - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnCbnDropdownComboAudioDevice() -{ - vis->InitAudioDeviceList(); - CComboBox* audioDeviceBox = (CComboBox*)GetDlgItem(IDC_COMBO_AUDIO_DEVICE); - audioDeviceBox->ResetContent(); - for (int i = 0; i < vis->audio_devices.size(); i++) - { - audioDeviceBox->AddString(vis->audio_devices[i]); - } - audioDeviceBox->SetCurSel(vis->audio_device_idx); -} - - -void KeyboardVisDlg::OnEnChangeEditBackgroundTimeout() -{ - vis->background_timeout = (int)GetDlgItemInt(IDC_EDIT_BACKGROUND_TIMEOUT, 0, 0); - - if (vis->update_ui == false) - { - vis->background_timer = 0; - } - - vis->OnSettingsChanged(); -} - - -void KeyboardVisDlg::OnBnClickedCheckSilentBackground() -{ - vis->silent_bkgd = ((CButton*)GetDlgItem(IDC_CHECK_SILENT_BACKGROUND))->GetCheck(); - - if (vis->silent_bkgd == true) - { - vis->reactive_bkgd = false; - ((CButton*)GetDlgItem(IDC_CHECK_REACTIVE_BACKGROUND))->SetCheck(false); - } - - vis->OnSettingsChanged(); -} diff --git a/KeyboardVisualizerVC/KeyboardVisDlg.h b/KeyboardVisualizerVC/KeyboardVisDlg.h deleted file mode 100644 index 9637bff..0000000 --- a/KeyboardVisualizerVC/KeyboardVisDlg.h +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------*\ -| Definitions for Keyboard Visualizer Dialog | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#ifndef KEYBOARD_VIS_DLG_H -#define KEYBOARD_VIS_DLG_H - -#include "stdafx.h" -#include "..\KeyboardVisualizerCommon\Visualizer.h" -// KeyboardVisDlg dialog - -class KeyboardVisDlg : public CDialogEx -{ - DECLARE_DYNAMIC(KeyboardVisDlg) - -public: - KeyboardVisDlg(CWnd* pParent = NULL); // standard constructor - virtual ~KeyboardVisDlg(); - virtual BOOL OnInitDialog(); - - void SetVisualizer(Visualizer* v); - void StartMinimized(boolean startmin); - -// Dialog Data -#ifdef AFX_DESIGN_TIME - enum { IDD = IDD_DIALOG1 }; -#endif - -private: - afx_msg void OnTimer(UINT_PTR nIDEvent); - afx_msg void OnDestroy(); - UINT_PTR timer; - -protected: - // WM_TRAYICON_EVENT handler - afx_msg LRESULT OnTrayIconEvent(WPARAM wParam, LPARAM lParam); - - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnEnChangeEditAmplitude(); - afx_msg void OnEnChangeEditBackgroundBrightness(); - afx_msg void OnCbnSelchangeComboWindow(); - afx_msg void OnEnChangeEditAverageSize(); - afx_msg void OnCbnSelchangeComboBkgdMode(); - afx_msg void OnEnChangeEditDecay(); - afx_msg void OnEnChangeEditDelay(); - afx_msg void OnCbnSelchangeComboFrgdMode(); - afx_msg void OnCbnSelchangeComboAvgMode(); - afx_msg void OnCbnSelchangeComboSnglClrMode(); - afx_msg void OnEnChangedEditNrmlOfst(); - afx_msg void OnEnChangedEditNrmlScl(); - afx_msg void OnClickedSave(); - afx_msg void OnEnChangeEditAnimSpeed(); - afx_msg void OnBnClickedCheckReactiveBackground(); - afx_msg void OnCbnSelchangeComboAudioDevice(); - afx_msg void OnEnChangeEditFilterConstant(); - afx_msg void OnCbnDropdownComboAudioDevice(); - afx_msg void OnEnChangeEditBackgroundTimeout(); - afx_msg void OnBnClickedCheckSilentBackground(); -}; - -#endif \ No newline at end of file diff --git a/KeyboardVisualizerVC/KeyboardVisualizerVC.vcxproj b/KeyboardVisualizerVC/KeyboardVisualizerVC.vcxproj deleted file mode 100644 index 8dcb1be..0000000 --- a/KeyboardVisualizerVC/KeyboardVisualizerVC.vcxproj +++ /dev/null @@ -1,233 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {11970D07-B63F-487B-AA02-2EDCAD2F71A0} - Win32Proj - KeyboardVisualizerVC - 10.0.17134.0 - KeyboardVisualizerVC - - - - Application - true - v141 - MultiByte - Dynamic - - - Application - false - v141 - true - MultiByte - Dynamic - - - Application - true - v141 - MultiByte - Dynamic - - - Application - false - v141 - true - MultiByte - Dynamic - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Level2 - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - false - ..\dependencies\razer-chroma-2.9.0\inc;..\dependencies\corsair-cue-1.15.28\include;..\dependencies\coolermaster-sdk-160630;..\dependencies\logitech-gaming-led-sdk\Include;..\dependencies\AURA SDK_02_04\sdk - false - Speed - false - MultiThreadedDebugDLL - EditAndContinue - Default - NotSet - true - - - Windows - true - ..\dependencies\corsair-cue-1.15.28\lib\i386;..\dependencies\corsair-cue-1.15.28\lib\x64;..\dependencies\coolermaster-sdk-160630;..\dependencies\logitech-gaming-led-sdk\Lib\x86;..\dependencies\logitech-gaming-led-sdk\Lib\x64;%(AdditionalLibraryDirectories) - %(AdditionalDependencies) - %(IgnoreSpecificDefaultLibraries) - - - - - - - Level3 - Disabled - _DEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_NON_CONFORMING_WCSTOK. - true - D:\libraries\openal-soft-1.16.0-bin\include;D:\libraries\razer-chroma-2.3.2\inc;%(AdditionalIncludeDirectories) - - - Windows - true - D:\libraries\openal-soft-1.16.0-bin\libs\Win32;%(AdditionalLibraryDirectories) - libOpenAL32.dll.a;%(AdditionalDependencies) - - - - - Level2 - - - Full - true - true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - false - ..\dependencies\razer-chroma-2.9.0\inc;..\dependencies\corsair-cue-1.15.28\include;..\dependencies\coolermaster-sdk-160630;..\dependencies\logitech-gaming-led-sdk\Include;..\dependencies\AURA SDK_02_04\sdk - false - Speed - NotSet - true - - - Windows - true - true - true - ..\dependencies\corsair-cue-1.15.28\lib\i386;..\dependencies\corsair-cue-1.15.28\lib\x64;..\dependencies\coolermaster-sdk-160630;..\dependencies\logitech-gaming-led-sdk\Lib\x86;..\dependencies\logitech-gaming-led-sdk\Lib\x64;%(AdditionalLibraryDirectories) - %(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - D:\libraries\openal-soft-1.16.0-bin\include;D:\libraries\razer-chroma-2.3.2\inc;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - D:\libraries\openal-soft-1.16.0-bin\libs\Win32;%(AdditionalLibraryDirectories) - libOpenAL32.dll.a;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/KeyboardVisualizerVC/Resource.rc b/KeyboardVisualizerVC/Resource.rc deleted file mode 100644 index 05acccf..0000000 --- a/KeyboardVisualizerVC/Resource.rc +++ /dev/null @@ -1,154 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_KEYBOARD_VISUALIZER_DLG DIALOGEX 0, 0, 310, 250 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Keyboard Visualizer 3.06" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CTEXT "Amplitude (%)",IDC_STATIC,30,13,47,8 - EDITTEXT IDC_EDIT_AMPLITUDE,85,10,50,14,ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_WINDOW,215,10,80,160,CBS_DROPDOWN | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "FFT Window Mode",IDC_STATIC,145,13,60,8 - LTEXT "Background Brightness",IDC_STATIC,10,33,74,8 - EDITTEXT IDC_EDIT_BACKGROUND_BRIGHTNESS,85,30,50,14,ES_AUTOHSCROLL - CONTROL "",IDC_IMAGE_VISUALIZATION,"Static",SS_BITMAP | WS_BORDER,123,188,16,14 - LTEXT "Visualization Preview",IDC_STATIC,44,188,67,8 - LTEXT "Average Size",IDC_STATIC,32,53,43,8 - EDITTEXT IDC_EDIT_AVERAGE_SIZE,85,50,50,14,ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_BKGD_MODE,215,30,80,140,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Background Mode",IDC_STATIC,146,33,58,8 - EDITTEXT IDC_EDIT_DECAY,85,70,50,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_DELAY,85,90,50,14,ES_AUTOHSCROLL - LTEXT "Decay (% per step)",IDC_STATIC,14,73,64,8 - LTEXT "Delay (ms)",IDC_STATIC,43,92,35,8 - LTEXT "github.com/CalcProgrammer1/KeyboardVisualizer",IDC_STATIC,7,236,174,8 - COMBOBOX IDC_COMBO_FRGD_MODE,215,50,80,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Foreground Mode",IDC_STATIC,146,53,58,8 - COMBOBOX IDC_COMBO_AVG_MODE,215,90,80,80,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Average Mode",IDC_STATIC,155,93,48,8 - COMBOBOX IDC_COMBO_SNGL_CLR_MODE,215,70,80,100,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Single Color Mode",IDC_STATIC,145,73,58,8 - EDITTEXT IDC_EDIT_NRML_OFST,85,110,50,14,ES_AUTOHSCROLL - LTEXT "Normalization Offset",IDC_STATIC,12,112,66,8 - EDITTEXT IDC_EDIT_NRML_SCL,85,130,50,14,ES_AUTOHSCROLL - LTEXT "Normalization Scale",IDC_STATIC,14,132,62,8 - PUSHBUTTON "Save Settings",IDC_BUTTON_SAVE,212,230,90,14 - EDITTEXT IDC_EDIT_ANIM_SPEED,215,130,50,14,ES_AUTOHSCROLL - LTEXT "Animation Speed",IDC_STATIC,147,133,55,8 - CONTROL "",IDC_CHECK_REACTIVE_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,215,150,16,10 - LTEXT "Reactive Background",IDC_STATIC,142,152,69,8 - COMBOBOX IDC_COMBO_AUDIO_DEVICE,215,110,80,113,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Audio Device",IDC_STATIC,159,113,47,8 - EDITTEXT IDC_EDIT_FILTER_CONSTANT,85,150,50,14,ES_AUTOHSCROLL - LTEXT "Filter Constant",IDC_STATIC,30,152,46,8 - EDITTEXT IDC_EDIT_BACKGROUND_TIMEOUT,85,170,50,14,ES_AUTOHSCROLL - LTEXT "Background Timeout",IDC_STATIC,10,172,66,8 - CONTROL "",IDC_CHECK_SILENT_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,215,170,16,10 - LTEXT "Silent Background",IDC_STATIC,150,172,57,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_KEYBOARD_VISUALIZER_DLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 302 - TOPMARGIN, 6 - BOTTOMMARGIN, 244 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// AFX_DIALOG_LAYOUT -// - -IDD_KEYBOARD_VISUALIZER_DLG AFX_DIALOG_LAYOUT -BEGIN - 0 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON ICON "icon.ico" - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/KeyboardVisualizerVC/icon.xcf b/KeyboardVisualizerVC/icon.xcf deleted file mode 100644 index 97a0efa..0000000 Binary files a/KeyboardVisualizerVC/icon.xcf and /dev/null differ diff --git a/KeyboardVisualizerVC/main.cpp b/KeyboardVisualizerVC/main.cpp deleted file mode 100644 index 77c118e..0000000 --- a/KeyboardVisualizerVC/main.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/*---------------------------------------------------------*\ -| Entry Point Code for Keyboard Visualizer Application | -| | -| Adam Honse (calcprogrammer1@gmail.com), 12/11/2016 | -\*---------------------------------------------------------*/ - -#include "stdafx.h" -#include "resource.h" -#include "KeyboardVisDlg.h" -#include "..\KeyboardVisualizerCommon\LEDStrip.h" -#include "..\KeyboardVisualizerCommon\Visualizer.h" - -#include -#include -#include - -CWinApp app; -Visualizer vis; -static boolean startminimized; - - -void parse_argument_string(char * argument, char * value) -{ - if (strcmp(argument, "startminimized") == 0) - { - startminimized = TRUE; - } - - if (strcmp(argument, "amplitude") == 0) - { - vis.amplitude = atoi(value); - } - - if (strcmp(argument, "bkgd_bright") == 0) - { - vis.bkgd_bright = atoi(value); - } - - if (strcmp(argument, "avg_size") == 0) - { - vis.avg_size = atoi(value); - if (vis.avg_size < 1) - { - vis.avg_size = 1; - } - else if (vis.avg_size > 128) - { - vis.avg_size = 128; - } - } - - if (strcmp(argument, "decay") == 0) - { - vis.decay = atoi(value); - } - - if (strcmp(argument, "delay") == 0) - { - vis.delay = atoi(value); - } - - if (strcmp(argument, "nrml_ofst") == 0) - { - vis.nrml_ofst = strtod(value, NULL); - } - - if (strcmp(argument, "nrml_scl") == 0) - { - vis.nrml_scl = strtod(value, NULL); - } - - if (strcmp(argument, "fltr_const") == 0) - { - vis.filter_constant = strtod(value, NULL); - if (vis.filter_constant > 1.0f) - { - vis.filter_constant = 1.0f; - } - else if (vis.filter_constant < 0.0f) - { - vis.filter_constant = 0.0f; - } - } - - if (strcmp(argument, "anim_speed") == 0) - { - vis.anim_speed = strtod(value, NULL); - } - - if (strcmp(argument, "window_mode") == 0) - { - if ((atoi(value) >= 0) && (atoi(value) <= 4)) - { - vis.window_mode = atoi(value); - } - } - - if (strcmp(argument, "bkgd_mode") == 0) - { - if ((atoi(value) >= 0) && (atoi(value) <= VISUALIZER_NUM_PATTERNS)) - { - vis.bkgd_mode = atoi(value); - } - } - - if (strcmp(argument, "frgd_mode") == 0) - { - if ((atoi(value) >= 0) && (atoi(value) <= VISUALIZER_NUM_PATTERNS)) - { - vis.frgd_mode = atoi(value); - } - } - - if (strcmp(argument, "single_color_mode") == 0) - { - if ((atoi(value) >= 0) && (atoi(value) <= VISUALIZER_NUM_SINGLE_COLOR)) - { - vis.single_color_mode = atoi(value); - } - } - - if (strcmp(argument, "avg_mode") == 0) - { - if ((atoi(value) >= 0) && (atoi(value) <= 1)) - { - vis.avg_mode = atoi(value); - } - } - - if (strcmp(argument, "ledmatrix") == 0) - { - vis.BeginLEDMatrix(atoi(value)); - } - - if (strcmp(argument, "ledsections") == 0) - { - vis.LEDStripSections(atoi(value)); - } - - if (strcmp(argument, "ledmirrorx") == 0) - { - vis.LEDMirrorX(); - } - - if (strcmp(argument, "ledmirrory") == 0) - { - vis.LEDMirrorY(); - } - - if (strcmp(argument, "ledsinglecolor") == 0) - { - vis.LEDSingleColor(); - } - - if (strcmp(argument, "ledrotatex") == 0) - { - vis.LEDRotateX(atoi(value)); - } - - if (strcmp(argument, "ledstrip") == 0) - { - vis.AddLEDStrip(LED_STRIP_NORMAL, value); - } - - if (strcmp(argument, "xmas") == 0) - { - vis.AddLEDStrip(LED_STRIP_XMAS, value); - } - - if (strcmp(argument, "hueplus") == 0) - { - vis.AddLEDStrip(LED_STRIP_NORMAL, value); - } - - if (strcmp(argument, "server") == 0) - { - vis.InitServer(value); - } - - if (strcmp(argument, "client") == 0) - { - vis.InitClient(value); - } - - if (strcmp(argument, "reactive_bkgd") == 0) - { - vis.reactive_bkgd = atoi(value); - - if ((vis.silent_bkgd == TRUE) && (vis.reactive_bkgd == TRUE)) - { - vis.silent_bkgd = FALSE; - } - } - - if (strcmp(argument, "silent_bkgd") == 0) - { - vis.silent_bkgd = atoi(value); - - if ((vis.silent_bkgd == TRUE) && (vis.reactive_bkgd == TRUE)) - { - vis.reactive_bkgd = FALSE; - } - } - - if (strcmp(argument, "background_timeout") == 0) - { - vis.background_timeout = atoi(value); - vis.background_timer = 0; - } - - if (strcmp(argument, "audio_device_idx") == 0) - { - vis.audio_device_idx = atoi(value); - vis.ChangeAudioDevice(); - } - - if (strcmp(argument, "razer_use_keyboard_custom_effect") == 0) - { - vis.SetDeviceProperty(argument, value); - } - - if (strcmp(argument, "razer_use_headset_custom_effect") == 0) - { - vis.SetDeviceProperty(argument, value); - } - - if (strcmp(argument, "razer_use_chromalink_single_color") == 0) - { - vis.SetDeviceProperty(argument, value); - } - - if (strcmp(argument, "razer_disable_chromalink") == 0) - { - vis.SetDeviceProperty(argument, value); - } - - if (strcmp(argument, "razer_chroma_box_mode") == 0) - { - vis.SetDeviceProperty(argument, value); - } -} - -boolean parse_command_line(char * command_line) -{ - LPTSTR argument; - LPTSTR value; - LPTSTR next; - value = strtok_s(command_line, " ", &next); - - while (value != NULL) - { - argument = strtok_s(value, "=", &value); - - if (strcmp(argument, "help") == 0) - { - printf("\r\n"); - printf("Available command line commands:\r\n"); - printf(" help - Display this message and quit\r\n"); - //printf(" nogui - Run visualizer with no GUI\r\n"); - printf(" startminimized - Start in system tray\r\n"); - printf("\r\n"); - printf("Available command line arguments:\r\n"); - printf(" Usage: argument1=value1 argument2=value2 ...\r\n"); - printf("\r\n"); - printf(" amplitude - Adjust the amplitude of the visualizer\r\n"); - printf(" bkgd_bright - Adjust the background brightness\r\n"); - printf(" avg_size - Number of points to average\r\n"); - printf(" decay - Percentage of value to decay every step\r\n"); - printf(" delay - Milliseconds between each device update\r\n"); - printf(" nrml_ofst - Normalization offset, floating point value\r\n"); - printf(" nrml_scl - Normalization scale, floating point value\r\n"); - printf(" fltr_const - Low pass filter constant, floating point value 0-1\r\n"); - printf(" window_mode - FFT windowing mode selector, values are:\r\n"); - printf(" - 0: No windowing\r\n"); - printf(" - 1: Hanning window\r\n"); - printf(" - 2: Hamming window\r\n"); - printf(" - 3: Blackman window\r\n"); - printf(" bkgd_mode - Background mode, values are:\r\n"); - for (int i = 0; i < VISUALIZER_NUM_PATTERNS; i++) - { - if (i < 10) - { - printf(" - %d %s\r\n", i, visualizer_pattern_labels[i]); - } - else - { - printf(" - %d %s\r\n", i, visualizer_pattern_labels[i]); - } - } - printf(" frgd_mode - Foreground mode, values are:\r\n"); - for (int i = 0; i < VISUALIZER_NUM_PATTERNS; i++) - { - if (i < 10) - { - printf(" - %d %s\r\n", i, visualizer_pattern_labels[i]); - } - else - { - printf(" - %d %s\r\n", i, visualizer_pattern_labels[i]); - } - } - printf(" single_color_mode - Single color mode, values are:\r\n"); - for (int i = 0; i < VISUALIZER_NUM_SINGLE_COLOR; i++) - { - if (i < 10) - { - printf(" - %d %s\r\n", i, visualizer_single_color_labels[i]); - } - else - { - printf(" - %d %s\r\n", i, visualizer_single_color_labels[i]); - } - } - printf(" avg_mode - Visualizer averaging mode\r\n"); - printf(" - 0: Binning\r\n"); - printf(" - 1: Low-pass filtering\r\n"); - printf(" anim_speed - Animation Speed (percent)\r\n"); - printf(" server - Configure this instance as a server for synchronization\r\n"); - printf(" - Takes what port to serve on as argument, i.e. server=1234\r\n"); - printf(" client - Configure this instance as a client for synchronization\r\n"); - printf(" - Takes the IP/hostname of the server and port as arguments,\r\n"); - printf(" - i.e. client=192.168.1.100,1234\r\n"); - printf(" ledstrip - LED config strings :\r\n"); - printf(" - Serial : ledstrip=port,baud,num_leds\r\n"); - printf(" - (ex.ledstrip=COM1,115200,30)\r\n"); - printf(" - UDP : ledstrip=udp:client,port,num_leds\r\n"); - printf(" - (ex.ledstrip=udp:192.168.1.5,1234,30)\r\n"); - printf(" ledmatrix - Add this line before ledstrip lines to create a matrix of LEDs\r\n"); - printf(" - Takes the number of strips to create a matrix from, treated as rows\r\n"); - printf(" xmas - COM port, ex. xmas=COM2\r\n"); - printf(" hueplus - HUE+ config:\r\n"); - printf(" - hueplus=port,channel,num_leds\r\n"); - printf(" - channel: 0 -> both channels, 1 -> channel 1, 2 -> channel 2\r\n"); - printf(" - num_leds: Fans * 8 ex. 3 Fans -> 24\r\n"); - printf(" - Important for Fans: If you have connected fans on both channels only count the fans on the channel with the most fans\r\n"); - printf(" ex. 3 Fans on Ch. 1 4 Fans on CH. 2: num_leds 32 for the 4 Fans\r\n"); - printf(" For best Visualizer results don`t connect on one channel 3 fans more than on the other channel\r\n"); - printf(" - (ex. hueplus=COM4,1,24\r\n"); - printf(" razer_use_keyboard_custom_effect\r\n"); - printf(" - Use custom effect type in the Razer SDK, enables effects better scaled for specific keyboards, but does not support all models\r\n"); - printf(" razer_use_headset_custom_effect\r\n"); - printf(" - Use custom effect for headsets, allows smooth color transitions on the Kraken V2 but disables the Kraken V1\r\n"); - printf(" razer_use_chromalink_single_color\r\n"); - printf(" - Use the single color option for the Chroma Link SDK outputs instead of bar graph option\r\n"); - printf(" razer_disable_chromalink\r\n"); - printf(" - Disable the Chroma Link SDK, works around a bug in the current Chroma SDK where the Chroma HDK commands are overridden\r\n"); - printf(" razer_chroma_box_mode\r\n"); - printf(" - razer_chroma_box_mode=mode\r\n"); - printf(" - 0: Matrix (use 4 strips for best effect)\r\n"); - printf(" - 1: Bar graph per single strip\r\n"); - printf(" - 2: Bar graph stretched across 2 strips each\r\n"); - printf(" - 3: Bar graph stretched across all 4 strips\r\n"); - return FALSE; - } - - parse_argument_string(argument, value); - - value = strtok_s(next, " ", &next); - } - return TRUE; -} - - -void parse_settings_file(char * filename) -{ - std::ifstream infile; - - //Open settings file - infile.open(filename); - - if (infile.good()) - { - for (std::string line; std::getline(infile, line); ) - { - if (line == "") - { - continue; - } - if ((line[0] != ';') && (line[0] != '#') && (line[0] != '/')) - { - LPSTR argument; - LPSTR value; - - value = (LPSTR)line.c_str(); - - argument = strtok_s(value, "=", &value); - strtok(argument, "\r"); - parse_argument_string(argument, value); - } - } - } -} - - -int APIENTRY _tWinMain(HINSTANCE hInst, HINSTANCE h0, LPTSTR lpCmdLine, int nCmdShow) -{ - AttachConsole(-1); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); - - afxCurrentInstanceHandle = hInst; - afxCurrentResourceHandle = hInst; - app.m_hInstance = hInst; - - startminimized = FALSE; - - //Initialize Visualizer - vis.Initialize(); - - //Parse Settings File in Executable Directory - char filename[2048]; - GetModuleFileName(NULL, filename, 2048); - strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str()); - strcat(filename, "\\settings.txt"); - parse_settings_file(filename); - - //Parse Command Line - if (!parse_command_line(lpCmdLine)) - { - return 0; - } - - //Start Visualizer Threads - vis.StartThread(); - - //Create Dialog - KeyboardVisDlg dlg; - dlg.StartMinimized(startminimized); - dlg.SetVisualizer(&vis); - dlg.DoModal(); - - return 0; -} \ No newline at end of file diff --git a/KeyboardVisualizerVC/resource.h b/KeyboardVisualizerVC/resource.h deleted file mode 100644 index bb8ab31..0000000 --- a/KeyboardVisualizerVC/resource.h +++ /dev/null @@ -1,39 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc -// -#define IDD_KEYBOARD_VISUALIZER_DLG 101 -#define IDB_PNG1 105 -#define IDI_ICON 106 -#define IDC_EDIT_AMPLITUDE 1002 -#define IDC_COMBO_WINDOW 1003 -#define IDC_EDIT_BACKGROUND_BRIGHTNESS 1004 -#define IDC_IMAGE_VISUALIZATION 1005 -#define IDC_EDIT_AVERAGE_SIZE 1006 -#define IDC_COMBO_BKGD_MODE 1007 -#define IDC_EDIT_DECAY 1008 -#define IDC_EDIT_DELAY 1009 -#define IDC_COMBO_FRGD_MODE 1010 -#define IDC_COMBO_SNGL_CLR_MODE 1011 -#define IDC_COMBO_AVG_MODE 1012 -#define IDC_EDIT_NRML_OFST 1013 -#define IDC_EDIT_NRML_SCL 1014 -#define IDC_BUTTON_SAVE 1015 -#define IDC_EDIT_ANIM_SPEED 1016 -#define IDC_CHECK_REACTIVE_BACKGROUND 1017 -#define IDC_COMBO_AUDIO_DEVICE 1018 -#define IDC_EDIT_FILTER_CONSTANT 1019 -#define IDC_EDIT_BACKGROUND_TIMEOUT 1020 -#define IDC_CHECK1 1021 -#define IDC_CHECK_SILENT_BACKGROUND 1021 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 107 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1022 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/KeyboardVisualizerVC/stdafx.h b/KeyboardVisualizerVC/stdafx.h deleted file mode 100644 index 77c3409..0000000 --- a/KeyboardVisualizerVC/stdafx.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1b6155a --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + OpenAuraSDK + Copyright (C) 2019 Adam Honse + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/OpenRGB b/OpenRGB new file mode 160000 index 0000000..b24f989 --- /dev/null +++ b/OpenRGB @@ -0,0 +1 @@ +Subproject commit b24f989dbc9ecdcb1ae6fe49050f83609ed2b48e diff --git a/PWM_RGB_ESP8266/PWM_RGB_ESP8266.ino b/PWM_RGB_ESP8266/PWM_RGB_ESP8266.ino deleted file mode 100644 index 48cc036..0000000 --- a/PWM_RGB_ESP8266/PWM_RGB_ESP8266.ino +++ /dev/null @@ -1,75 +0,0 @@ -/*---------------------------------------------------------*\ -| | -| RGB LED Serial Controlled LED Strip Driver | -| for use with Keyboard Visualizer VCUI | -| | -| Adam Honse (calcprogrammer1) 12/9/2016 | -| | -\*---------------------------------------------------------*/ - -#include -#include - -const char* ssid = ""; -const char* password = ""; - -// A UDP instance to let us send and receive packets over UDP -WiFiUDP Udp; - -char packet_buf[1024]; - -#define LEDS 1 -#define PACKET_SZ ( (LEDS * 3) + 3 ) - - -void setup() -{ - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - } - Udp.begin(1234); - - pinMode(1, OUTPUT); - pinMode(2, OUTPUT); - pinMode(3, OUTPUT); -} - -int value = 0; - -void loop() -{ - int noBytes = Udp.parsePacket(); - - if( noBytes ) - { - Udp.read(packet_buf, noBytes); - - if( noBytes == PACKET_SZ && packet_buf[0] == 0xAA ) - { - unsigned short sum = 0; - int checksum_0 = PACKET_SZ - 2; - int checksum_1 = PACKET_SZ - 1; - - for( int i = 0; i < checksum_0; i++ ) - { - sum += packet_buf[i]; - } - - //Test if valid write packet - if( ( ( (unsigned short)packet_buf[checksum_0] << 8 ) | packet_buf[checksum_1] ) == sum ) - { - for( int i = 0; i < LEDS; i++ ) - { - int idx = 1 + ( 3 * i ); - - analogWrite(3, 4*packet_buf[idx]); - analogWrite(1, 4*packet_buf[idx+1]); - analogWrite(2, 4*packet_buf[idx+2]); - } - } - } - } -} - diff --git a/README.md b/README.md index e3f070d..3cb4d2f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,44 @@ -# Keyboard Visualizer ![Icon](https://raw.githubusercontent.com/CalcProgrammer1/KeyboardVisualizer/master/KeyboardVisualizerVC/Icon.png) -Razer Chroma and Corsair RGB Keyboard Spectrograph Visualizer for Windows and Linux +# Keyboard Visualizer ![Icon](https://raw.githubusercontent.com/CalcProgrammer1/KeyboardVisualizer/master/KeyboardVisualizerQT/KeyboardVisualizer.png) -Binary Windows builds can be downloaded from the Release submodule +## OpenRGB Audio Visualizer for Windows, Linux, and MacOS -You must have the Microsoft Visual C++ 2015 32-bit redistributable package installed to run this program (Windows). +Keyboard Visualizer turns your OpenRGB-supported RGB setup into a spectacular light show for your music. Keyboard Visualizer is able to listen to any input or loopback audio device on your computer so it can visualize audio from any music player, website, game, or other application. -To build this project in Linux, install QT Creator and libopenal-dev, libhidapi-dev and open/build the .pro file. +To use Keyboard Visualizer with your setup, you must first install OpenRGB and set it up to detect all of your RGB devices. OpenRGB can be found here: + +https://gitlab.com/CalcProgrammer1/OpenRGB + +## What about the old Keyboard Visualizer with Razer Chroma SDK, Corsair SDK, etc? + +Development on this version has stalled as I'm not interested in supporting a multitude of proprietary SDKs that change constantly and only work on Windows. This version remains as Keyboard Visualizer 3.x and downloads are still available in the Release submodule. I will accept pull requests for this version if others wish to keep it alive, but I plan to focus primarily on the OpenRGB version (4.x) going forwards. + +# Download/Build + +## Windows + * Pre-built binaries are available under the Releases section on GitLab. + + * If you wish to build the application yourself: + + 1. Download the latest Visual Studio Community Edition and Qt Creator. + 2. git clone https://gitlab.com/CalcProgrammer1/KeyboardVisualizer + 3. git submodule update --init --recursive + 4. Open the KeyboardVisualizer.pro project in Qt Creator. + 5. Use the MSVC compiler kit, either 32- or 64-bit, to build the application. + 6. Run the project from Qt Creator. If you want to use your custom build standalone, download the latest matching Release package and replace the OpenRGB.exe in it with your new build. + +## Linux + * Pre-built binaries are not currently available for Linux + + * You can build the project using Qt Creator or on the command line. The commands listed here work for Debian-based distros. + + 1. sudo apt install build-essential qtcreator qt5-default libopenal-dev + 2. git clone https://gitlab.com/CalcProgrammer1/KeyboardVisualizer + 3. cd KeyboardVisualizer + 4. git submodule update --init --recursive + 5. qmake KeyboardVisualizer.pro + 6. make -j8 + + * Run the application with ./KeyboardVisualizer # Settings @@ -127,34 +160,6 @@ Keyboard Visualizer allows you to save your custom settings in two different way client - Configure this instance as a client for synchronization - Takes the IP/hostname of the server and port as arguments, - i.e. client=192.168.1.100,1234 - ledstrip - LED config strings : - - Serial : ledstrip=port,baud,num_leds - - (ex.ledstrip=COM1,115200,30) - - UDP : ledstrip=udp:client,port,num_leds - - (ex.ledstrip=udp:192.168.1.5,1234,30) - xmas - COM port, ex. xmas=COM2 - hueplus - HUE+ config: - - hueplus=port,channel,num_leds - - channel: 0 -> both channels, 1 -> channel 1, 2 -> channel 2 - - num_leds: Fans * 8 ex. 3 Fans -> 24 - - Important for Fans: If you have connected fans on both channels only count the fans on the channel with the most fans - ex. 3 Fans on Ch. 1 4 Fans on CH. 2: num_leds 32 for the 4 Fans - For best Visualizer results don`t connect on one channel 3 fans more than on the other channel - - (ex. hueplus=COM4,1,24 - razer_use_keyboard_generic_effect - - Use generic effect type in the Razer SDK, allows the use of SDK-unsupported keyboards at the expense of scaling - razer_use_headset_custom_effect - - Use custom effect for headsets, allows smooth color transitions on the Kraken V2 but disables the Kraken V1 - razer_use_chromalink_single_color - - Use the single color option for the Chroma Link SDK outputs instead of bar graph option - razer_disable_chromalink - - Disable the Chroma Link SDK, works around a bug in the current Chroma SDK where the Chroma HDK commands are overridden - razer_chroma_box_mode - - razer_chroma_box_mode=mode - - 0: Matrix (use 4 strips for best effect) - - 1: Bar graph per single strip - - 2: Bar graph stretched across 2 strips each - - 3: Bar graph stretched across all 4 strips # Available Visual Effects @@ -162,164 +167,6 @@ Keyboard Visualizer allows you to save your custom settings in two different way * Bar - Shows a single bar representing bass frequencies * Single Color - Brightness and color represent strength of bass frequencies -# Supported Devices (Windows) - - * Razer Chroma SDK - - Keyboards - - BlackWidow Chroma (spectrograph) - - BlackWidow Chroma Tournament Edition (spectrograph) - - DeathStalker Chroma (horizontal bar) - - BlackWidow X Chroma (spectrograph) - - BlackWidow X Chroma Tournament Edition (spectrograph) - - Razer Blade Stealth (spectrograph) - - Razer Blade (spectrograph) - - Razer Ornata Chroma (spectrograph) - - - Unsupported keyboards may be used in "generic" mode by adding the razer_use_keyboard_generic_effect settings parameter - - This uses a single effect for all keyboards supported by the SDK core, even those that don't have a device ID - - Use this setting for support of these otherwise unsupported keyboards: - - Razer Blade Stealth (late 2016, Kaby Lake) (spectrograph) - - Razer BlackWidow Chroma V2 (spectrograph) - - Keypads - - Razer Orbweaver Chroma (spectrograph) - - Razer Tartarus Chroma (single color) - - Mice - - Diamondback Chroma (bar and single color) - - Mamba Tournament Edition (bar and single color) - - Mamba Chroma Wireless (bar and single color, wired and wireless) - - DeathAdder Chroma (single color) - - Naga Epic Chroma (single color, wired only) - - Naga Chroma (single color) - - Orochi Chroma (single color, wired only) - - Headsets - - Kraken 7.1 Chroma (single color) - - Kraken 7.1 Chroma V2 (single color) - - ManO'War (single color) - - - The Kraken 7.1 Chroma V1 does not support custom effects, so a flickery workaround is used. If you only have a V2 you - - can add the settings parameter razer_use_headset_custom_effect to make the V2 output a smooth, non-flickery output but - - if you also have a V1 or ManO'War connected it will go black. - - Mouse Mats - - Firefly (bar) - - External Graphics Dock - - Razer Core (bar and single color) - - Other - - Razer Chroma Mug (bar) - - * Corsair CUE SDK - - Keyboards - - K70 RGB (spectrograph) - - Likely other CUE SDK supported keyboards (spectrograph), untested - - * Cooler Master RGB - - Keyboards - - Masterkeys Pro L (spectrograph) - - Masterkeys Pro S (spectrograph) - - * Logitech G Gaming SDK - - Keyboards - - G910 Orion Spark (spectrograph) - - G810 Orion Spectrum (spectrograph) - - Other single-zone RGB and Monochrome keyboards (single color) - - Headsets - - G633 (single color) - - G933 (single color) - - Mice - - G600 (single color) - - G900 Chaos Spectrum (single color) - - G303 Daedalus Apex (single color) - - G502 Proteus Spectrum (single color) - * SteelSeries - - Keyboards - - Apex M800 (spectrograph) - - * MSI SteelSeries - - Keyboards - - MSI 3-zone laptop keyboards and additional LED zones (MSI GS63VR, etc) (bar, single color) - - * NZXT Hue+ - - - Configured using the hueplus=port,num_leds option in the settings file (bar) - - * WS28XX Pixel LED Strips - - - Arduino (Serial/USB-Serial) or ESP8266 (UDP over WiFi) may be used for controller - - WS2812B, WS2811, and compatible LED strips/strings supported - - Adjust the LEDs value in the Arduino sketch to match the number of LEDs on your LED strip/string - - Recommended maximum of 90 or so LEDs on Arduino using 115200 baud rate - - Configure LED strip using the ledstrip command line/settings file parameter - - Number of LEDs in Arduino sketch must match num_leds parameter in LED command string - - For serial connected LEDs, -ledstrip=port,baud,num_leds (ex. -ledstrip=COM1,115200,30) - - For WiFi connected LEDs, -ledstrip=client,port,num_leds (ex. -ledstrip=192.168.1.5,1234,30) - - - For up to 200 LEDs on Arduino using 1000000 baud rate, see my pixel_controller repository - - This requires AVR Studio 4 + WinAVR to build, but is more efficient by skipping Arduino IDE - -# Supported Devices (Linux) - - * Razer Linux Drivers (https://github.com/terrycain/razer-drivers) - - Keyboards - - BlackWidow Chroma (spectrograph) - - BlackWidow Chroma Tournament Edition (spectrograph) - - DeathStalker Chroma (horizontal bar) - - Razer Ornata Chroma (spectrograph) - - Razer Blade Stealth (spectrograph) - - Razer Blade Pro (spectrograph) - - Keypads - - Razer Tartarus Chroma (single color) - - Mice - - Diamondback Chroma (bar and single color) - - Mamba Tournament Edition (bar and single color) - - DeathAdder Chroma (single color) - - Headsets - - Kraken 7.1 Chroma (single color) - - Kraken 7.1 Chroma V2 (single color) - - Mouse Mats - - Firefly (bar) - - External Graphics Dock - - Razer Core (bar and single color) - - Other - - Razer Chroma Mug (bar) - - * SteelSeries - - Keyboards - - Apex M800 (spectrograph) - - * MSI SteelSeries - - Keyboards - - MSI 3-zone laptop keyboards and additional LED zones (MSI GS63VR, etc) (bar, single color) - - * NZXT Hue+ - - - Configured using the hueplus=port,num_leds option in the settings file (bar) - - * WS28XX Pixel LED Strips - - - See the information under the Windows supported devices list. - # Donations * I created this project for fun mostly, and Razer's support of sending free products for me to integrate is awesome, but several people have asked if I'd accept donations. I've gotten back into cryptocurrency and mining recently so if you want to send some Bitcoin, Dogecoin, or Ethereum my way you can do so with the addresses below. I don't want to bother with PayPal and its ugly fees and I detest online advertising and block all ads on my PCs so I would never put ads on my videos or programs. diff --git a/Release b/Release deleted file mode 160000 index 232c8a6..0000000 --- a/Release +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 232c8a6c45912b84036af03fb079e9ef884a1f32 diff --git a/WS2812B_LEDStrip_Arduino/WS2812B_LEDStrip_Arduino.ino b/WS2812B_LEDStrip_Arduino/WS2812B_LEDStrip_Arduino.ino deleted file mode 100644 index eabba09..0000000 --- a/WS2812B_LEDStrip_Arduino/WS2812B_LEDStrip_Arduino.ino +++ /dev/null @@ -1,111 +0,0 @@ -/*---------------------------------------------------------*\ -| | -| WS2812B (NeoPixel) Serial Controlled LED Strip Driver | -| for use with Keyboard Visualizer VCUI | -| | -| Adam Honse (calcprogrammer1) 12/9/2016 | -| | -\*---------------------------------------------------------*/ -#include -#ifdef __AVR__ - #include -#endif - -#define PIN 6 -#define LEDS 30 -#define PACKET_SZ ( (LEDS * 3) + 3 ) - -// Parameter 1 = number of pixels in strip -// Parameter 2 = Arduino pin number (most are valid) -// Parameter 3 = pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -Adafruit_NeoPixel strip = Adafruit_NeoPixel(LEDS, PIN, NEO_GRB + NEO_KHZ800); - -// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across -// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input -// and minimize distance between Arduino and first pixel. Avoid connecting -// on a live circuit...if you must, connect GND first. -unsigned char serial_buffer[PACKET_SZ]; -unsigned int head = 0; -unsigned int start; -unsigned int checksum_1; -unsigned int checksum_0; - -void setup() -{ - Serial.begin(115200); - strip.begin(); - strip.show(); -} - -void loop() -{ - if( Serial.available() ) - { - serial_buffer[head] = Serial.read(); - - if( head >= (PACKET_SZ - 1) ) - { - start = 0; - checksum_1 = head; - checksum_0 = head - 1; - head = 0; - } - else - { - start = head + 1; - checksum_1 = head; - if( head == 0 ) - { - checksum_0 = PACKET_SZ - 1; - } - else - { - checksum_0 = head - 1; - } - head++; - } - - if( serial_buffer[start] == 0xAA ) - { - unsigned short sum = 0; - - for( int i = 0; i < checksum_0; i++ ) - { - sum += serial_buffer[i]; - } - - if( start > 0 ) - { - for( int i = start; i < PACKET_SZ; i++ ) - { - sum += serial_buffer[i]; - } - } - - //Test if valid write packet - if( ( ( (unsigned short)serial_buffer[checksum_0] << 8 ) | serial_buffer[checksum_1] ) == sum ) - { - noInterrupts(); - for( int i = 0; i < LEDS; i++ ) - { - int idx = start + 1 + ( 3 * i ); - - if( idx >= (PACKET_SZ - 1) ) - { - idx = idx - PACKET_SZ; - } - - strip.setPixelColor(i, strip.Color(serial_buffer[idx], serial_buffer[idx+1], serial_buffer[idx+2])); - } - - - strip.show(); - interrupts(); - } - } - } -} diff --git a/WS2812B_LEDStrip_Arduino_FastLED/WS2812B_LEDStrip_Arduino_FastLED.ino b/WS2812B_LEDStrip_Arduino_FastLED/WS2812B_LEDStrip_Arduino_FastLED.ino deleted file mode 100644 index cdd31f7..0000000 --- a/WS2812B_LEDStrip_Arduino_FastLED/WS2812B_LEDStrip_Arduino_FastLED.ino +++ /dev/null @@ -1,105 +0,0 @@ -/*---------------------------------------------------------*\ -| | -| WS2812B (FastLED) Serial Controlled LED Strip Driver | -| for use with Keyboard Visualizer VCUI | -| | -| Adam Honse (calcprogrammer1) 12/9/2016 | -| | -\*---------------------------------------------------------*/ -#include "FastLED.h" -#ifdef __AVR__ - #include -#endif - -#define PIN 6 -#define LEDS 30 -#define PACKET_SZ ( (LEDS * 3) + 3 ) - -CRGB leds[LEDS]; -unsigned char serial_buffer[PACKET_SZ]; -unsigned int head = 0; -unsigned int start; -unsigned int checksum_1; -unsigned int checksum_0; - -void setup() -{ - FastLED.addLeds(leds, LEDS); - for( int i = 0; i < LEDS; i++ ) - { - leds[i] = CRGB::Black; - } - FastLED.show(); - - Serial.begin(115200); -} - -void loop() -{ - if( Serial.available() ) - { - serial_buffer[head] = Serial.read(); - - if( head >= (PACKET_SZ - 1) ) - { - start = 0; - checksum_1 = head; - checksum_0 = head - 1; - head = 0; - } - else - { - start = head + 1; - checksum_1 = head; - if( head == 0 ) - { - checksum_0 = PACKET_SZ - 1; - } - else - { - checksum_0 = head - 1; - } - head++; - } - - if( serial_buffer[start] == 0xAA ) - { - unsigned short sum = 0; - - for( int i = 0; i < checksum_0; i++ ) - { - sum += serial_buffer[i]; - } - - if( start > 0 ) - { - for( int i = start; i < PACKET_SZ; i++ ) - { - sum += serial_buffer[i]; - } - } - - //Test if valid write packet - if( ( ( (unsigned short)serial_buffer[checksum_0] << 8 ) | serial_buffer[checksum_1] ) == sum ) - { - noInterrupts(); - for( int i = 0; i < LEDS; i++ ) - { - int idx = start + 1 + ( 3 * i ); - - if( idx >= (PACKET_SZ - 1) ) - { - idx = idx - PACKET_SZ; - } - - leds[i].g = serial_buffer[idx]; - leds[i].r = serial_buffer[idx+1]; - leds[i].b = serial_buffer[idx+2]; - } - - FastLED.show(); - interrupts(); - } - } - } -} diff --git a/WS2812B_LEDStrip_ESP8266/WS2812B_LEDStrip_ESP8266.ino b/WS2812B_LEDStrip_ESP8266/WS2812B_LEDStrip_ESP8266.ino deleted file mode 100644 index 953b40d..0000000 --- a/WS2812B_LEDStrip_ESP8266/WS2812B_LEDStrip_ESP8266.ino +++ /dev/null @@ -1,99 +0,0 @@ -/*---------------------------------------------------------*\ -| | -| WS2812B (NeoPixel) Serial Controlled LED Strip Driver | -| for use with Keyboard Visualizer VCUI | -| | -| Adam Honse (calcprogrammer1) 12/9/2016 | -| | -\*---------------------------------------------------------*/ - -#include -#include -#include - -const char* ssid = ""; -const char* password = ""; - -// A UDP instance to let us send and receive packets over UDP -WiFiUDP Udp; - -char packet_buf[1024]; - -#define PIN 2 -#define LEDS 30 -#define PACKET_SZ ( (LEDS * 3) + 3 ) - -// Parameter 1 = number of pixels in strip -// Parameter 2 = Arduino pin number (most are valid) -// Parameter 3 = pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -Adafruit_NeoPixel strip = Adafruit_NeoPixel(LEDS, PIN, NEO_GRB + NEO_KHZ800); - -void setup() -{ - Serial.begin(115200); - delay(10); - - // We start by connecting to a WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - Udp.begin(1234); - strip.begin(); -} - -int value = 0; - -void loop() -{ - int noBytes = Udp.parsePacket(); - - if( noBytes ) - { - Serial.print("Received "); - Serial.print(noBytes); - Serial.print(" bytes\r\n"); - Udp.read(packet_buf, noBytes); - - if( noBytes == PACKET_SZ && packet_buf[0] == 0xAA ) - { - unsigned short sum = 0; - int checksum_0 = PACKET_SZ - 2; - int checksum_1 = PACKET_SZ - 1; - - for( int i = 0; i < checksum_0; i++ ) - { - sum += packet_buf[i]; - } - - //Test if valid write packet - if( ( ( (unsigned short)packet_buf[checksum_0] << 8 ) | packet_buf[checksum_1] ) == sum ) - { - for( int i = 0; i < LEDS; i++ ) - { - int idx = 1 + ( 3 * i ); - - strip.setPixelColor(i, strip.Color(packet_buf[idx], packet_buf[idx+1], packet_buf[idx+2])); - } - strip.show(); - } - } - } -} - diff --git a/WS2812B_LEDStrip_ESP8266_matrix/WS2812B_LEDStrip_ESP8266_matrix.ino b/WS2812B_LEDStrip_ESP8266_matrix/WS2812B_LEDStrip_ESP8266_matrix.ino deleted file mode 100644 index 6c52d95..0000000 --- a/WS2812B_LEDStrip_ESP8266_matrix/WS2812B_LEDStrip_ESP8266_matrix.ino +++ /dev/null @@ -1,107 +0,0 @@ -/*---------------------------------------------------------*\ -| | -| WS2812B (NeoPixel) Serial Controlled LED Strip Driver | -| for use with Keyboard Visualizer VCUI | -| | -| Adam Honse (calcprogrammer1) 12/9/2016 | -| | -\*---------------------------------------------------------*/ - -#include -#include -#include "FastLED.h" - -const char* ssid = ""; -const char* password = ""; - -// A UDP instance to let us send and receive packets over UDP -WiFiUDP Udp; - -char packet_buf[1024]; - -#define LEDS_PER_STRIP 50 -#define STRIPS 4 -#define PACKET_SZ ( (LEDS_PER_STRIP * STRIPS * 3) + 3 ) - -CRGB leds[STRIPS][LEDS_PER_STRIP]; - -void setup() -{ - pinMode(0, OUTPUT); - pinMode(1, OUTPUT); - pinMode(2, OUTPUT); - pinMode(3, OUTPUT); - - FastLED.addLeds (leds[0], LEDS_PER_STRIP); - FastLED.addLeds (leds[1], LEDS_PER_STRIP); - FastLED.addLeds (leds[2], LEDS_PER_STRIP); - FastLED.addLeds (leds[3], LEDS_PER_STRIP); - -leds[0][1].r = 0; -leds[0][1].g = 0; -leds[0][1].b = 0; - -leds[1][1].r = 0; -leds[1][1].g = 0; -leds[1][1].b = 0; - -leds[2][1].r = 255; -leds[2][1].g = 255; -leds[2][1].b = 0; - -leds[3][1].r = 255; -leds[3][1].g = 255; -leds[3][1].b = 255; - -FastLED.show(); - delay(10); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - } - Udp.begin(1234); -} - -int value = 0; - -void loop() -{ - int noBytes = Udp.parsePacket(); - - if( noBytes ) - { - Udp.read(packet_buf, noBytes); - - if( noBytes == PACKET_SZ && packet_buf[0] == 0xAA ) - { - unsigned short sum = 0; - int checksum_0 = PACKET_SZ - 2; - int checksum_1 = PACKET_SZ - 1; - - for( int i = 0; i < checksum_0; i++ ) - { - sum += packet_buf[i]; - } - - //Test if valid write packet - if( ( ( (unsigned short)packet_buf[checksum_0] << 8 ) | packet_buf[checksum_1] ) == sum ) - { - for( int i = 0; i < STRIPS; i++ ) - { - for( int j = 0; j < LEDS_PER_STRIP; j++ ) - { - int idx = 1 + ( i * LEDS_PER_STRIP * 3 ) + ( 3 * j ); - - leds[i][j].r = packet_buf[idx]; - leds[i][j].g = packet_buf[idx+1]; - leds[i][j].b = packet_buf[idx+2]; - } - FastLED.show(); - } - } - } - } -} - diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..169c6a1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +keyboardvisualizer (4.01.0) UNRELEASED; urgency=medium + + * Builds from git master. See git history for more information. + + -- Adam Honse Sun, 12 Apr 2020 22:57:34 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7be5a38 --- /dev/null +++ b/debian/control @@ -0,0 +1,23 @@ +Source: keyboardvisualizer +Maintainer: Adam Honse +Section: misc +Priority: optional +Standards-Version: 3.9.2 +Build-Depends: + debhelper (>= 9), + pkg-config, + qtbase5-dev, + qtbase5-dev-tools, + qt5-qmake, + libopenal-dev +Homepage: https://gitlab.com/CalcProgrammer1/KeyboardVisualizer + +Package: keyboardvisualizer +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Recommends: + openrgb +Description: Audio visualizer for OpenRGB devices + Keyboard Visualizer for OpenRGB devices \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..e69de29 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..5ff9e1e --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +export QT_SELECT := qt5 + +%: + dh $@ --parallel diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/dependencies/AURA SDK_02_04/AURA SDK Guide_2.0.1.pdf b/dependencies/AURA SDK_02_04/AURA SDK Guide_2.0.1.pdf deleted file mode 100644 index 8042dc9..0000000 Binary files a/dependencies/AURA SDK_02_04/AURA SDK Guide_2.0.1.pdf and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/kb/ClaymoreProtocol.dll b/dependencies/AURA SDK_02_04/device dll/kb/ClaymoreProtocol.dll deleted file mode 100644 index 3f27121..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/kb/ClaymoreProtocol.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/ms/EVOLVE SYNC Dll.dll b/dependencies/AURA SDK_02_04/device dll/ms/EVOLVE SYNC Dll.dll deleted file mode 100644 index cbf4228..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/ms/EVOLVE SYNC Dll.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/ms/RogNewmouseProtocol.dll b/dependencies/AURA SDK_02_04/device dll/ms/RogNewmouseProtocol.dll deleted file mode 100644 index 3f27121..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/ms/RogNewmouseProtocol.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/ms/SPATHA HID Library C++.dll b/dependencies/AURA SDK_02_04/device dll/ms/SPATHA HID Library C++.dll deleted file mode 100644 index a4d9449..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/ms/SPATHA HID Library C++.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/ms/SPATHA SYNC Dll.dll b/dependencies/AURA SDK_02_04/device dll/ms/SPATHA SYNC Dll.dll deleted file mode 100644 index 7e7da14..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/ms/SPATHA SYNC Dll.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/vga/LED_DLL_forMB.dll b/dependencies/AURA SDK_02_04/device dll/vga/LED_DLL_forMB.dll deleted file mode 100644 index 3b56c01..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/vga/LED_DLL_forMB.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/vga/VGA_Extra.dll b/dependencies/AURA SDK_02_04/device dll/vga/VGA_Extra.dll deleted file mode 100644 index c9003ee..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/vga/VGA_Extra.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/device dll/vga/Vender.dll b/dependencies/AURA SDK_02_04/device dll/vga/Vender.dll deleted file mode 100644 index 3433e99..0000000 Binary files a/dependencies/AURA SDK_02_04/device dll/vga/Vender.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/sdk/AURALightingSDK.h b/dependencies/AURA SDK_02_04/sdk/AURALightingSDK.h deleted file mode 100644 index 1bd5dae..0000000 --- a/dependencies/AURA SDK_02_04/sdk/AURALightingSDK.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include - - -typedef void* MbLightControl; -typedef void* GPULightControl; -typedef void* ClaymoreKeyboardLightControl; -typedef void* RogMouseLightControl; -typedef void* DramLightControl; - - -typedef DWORD(WINAPI* EnumerateMbControllerFunc)(MbLightControl handles[], DWORD size); -typedef DWORD(WINAPI* SetMbModeFunc) (MbLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetMbColorFunc) (MbLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetMbColorFunc) (MbLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetMbLedCountFunc)(MbLightControl handle); - -typedef DWORD(WINAPI* EnumerateGPUFunc)(GPULightControl handles[], DWORD size); -typedef DWORD(WINAPI* SetGPUModeFunc) (GPULightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetGPUColorFunc) (GPULightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetGPULedCountFunc)(GPULightControl handle); - -typedef DWORD(WINAPI* CreateClaymoreKeyboardFunc)(ClaymoreKeyboardLightControl* handle); -typedef DWORD(WINAPI* SetClaymoreKeyboardModeFunc) (ClaymoreKeyboardLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetClaymoreKeyboardColorFunc) (ClaymoreKeyboardLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetClaymoreKeyboardLedCountFunc)(ClaymoreKeyboardLightControl handle); - -typedef DWORD(WINAPI* CreateRogMouseFunc)(RogMouseLightControl* handle); -typedef DWORD(WINAPI* SetRogMouseModeFunc) (RogMouseLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetRogMouseColorFunc) (RogMouseLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* RogMouseLedCountFunc)(RogMouseLightControl handle); - -typedef DWORD(WINAPI* EnumerateDramFunc)(DramLightControl handles[], DWORD size); -typedef DWORD(WINAPI* SetDramModeFunc) (DramLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetDramColorFunc) (DramLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetDramColorFunc) (DramLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetDramLedCountFunc)(DramLightControl handle); \ No newline at end of file diff --git a/dependencies/AURA SDK_02_04/sdk/AURA_SDK.dll b/dependencies/AURA SDK_02_04/sdk/AURA_SDK.dll deleted file mode 100644 index 53ddc13..0000000 Binary files a/dependencies/AURA SDK_02_04/sdk/AURA_SDK.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/AURALightingSDK.h b/dependencies/AURA SDK_02_04/test code/AURALightingSDK.h deleted file mode 100644 index 7b009df..0000000 --- a/dependencies/AURA SDK_02_04/test code/AURALightingSDK.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include - - -typedef void* MbLightControl; -typedef void* GPULightControl; -typedef void* ClaymoreKeyboardLightControl; -typedef void* RogMouseLightControl; - - -typedef DWORD(WINAPI* EnumerateMbControllerFunc)(MbLightControl handles[], DWORD size); -typedef DWORD(WINAPI* SetMbModeFunc) (MbLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetMbColorFunc) (MbLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetMbColorFunc) (MbLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetMbLedCountFunc)(MbLightControl handle); - -typedef DWORD(WINAPI* EnumerateGPUFunc)(GPULightControl handles[], DWORD size); -typedef DWORD(WINAPI* SetGPUModeFunc) (GPULightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetGPUColorFunc) (GPULightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetGPULedCountFunc)(GPULightControl handle); - -typedef DWORD(WINAPI* CreateClaymoreKeyboardFunc)(ClaymoreKeyboardLightControl* handle); -typedef DWORD(WINAPI* SetClaymoreKeyboardModeFunc) (ClaymoreKeyboardLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetClaymoreKeyboardColorFunc) (ClaymoreKeyboardLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* GetClaymoreKeyboardLedCountFunc)(ClaymoreKeyboardLightControl handle); - -typedef DWORD(WINAPI* CreateRogMouseFunc)(RogMouseLightControl* handle); -typedef DWORD(WINAPI* SetRogMouseModeFunc) (RogMouseLightControl handle, DWORD mode); -typedef DWORD(WINAPI* SetRogMouseColorFunc) (RogMouseLightControl handle, BYTE* color, DWORD size); -typedef DWORD(WINAPI* RogMouseLedCountFunc)(RogMouseLightControl handle); diff --git a/dependencies/AURA SDK_02_04/test code/AURA_SDK.dll b/dependencies/AURA SDK_02_04/test code/AURA_SDK.dll deleted file mode 100644 index 53ddc13..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/AURA_SDK.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.cpp b/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.cpp deleted file mode 100644 index 329e94c..0000000 --- a/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.cpp +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include "AURALightingSDK.h" - -EnumerateMbControllerFunc EnumerateMbController; -SetMbModeFunc SetMbMode; -SetMbColorFunc SetMbColor; -GetMbColorFunc GetMbColor; -GetMbLedCountFunc GetMbLedCount; - -EnumerateGPUFunc EnumerateGPU; -SetGPUModeFunc SetGPUMode; -SetGPUColorFunc SetGPUColor; -GetGPULedCountFunc GetGPULedCount; - -CreateClaymoreKeyboardFunc CreateClaymoreKeyboard; -SetClaymoreKeyboardModeFunc SetClaymoreKeyboardMode; -SetClaymoreKeyboardColorFunc SetClaymoreKeyboardColor; -GetClaymoreKeyboardLedCountFunc GetClaymoreKeyboardLedCount; - -CreateRogMouseFunc CreateRogMouse; -SetRogMouseModeFunc SetRogMouseMode; -SetRogMouseColorFunc SetRogMouseColor; -RogMouseLedCountFunc RogMouseLedCount; - -void SDK_DEMO(){ - - - HMODULE hLib = nullptr; - - hLib = LoadLibraryA("AURA_SDK.dll"); - - if (hLib == nullptr) - return; - - (FARPROC&)EnumerateMbController = GetProcAddress(hLib, "EnumerateMbController"); - (FARPROC&)SetMbMode = GetProcAddress(hLib, "SetMbMode"); - (FARPROC&)SetMbColor = GetProcAddress(hLib, "SetMbColor"); - (FARPROC&)GetMbColor = GetProcAddress(hLib, "GetMbColor"); - (FARPROC&)GetMbLedCount = GetProcAddress(hLib, "GetMbLedCount"); - - (FARPROC&)EnumerateGPU = GetProcAddress(hLib, "EnumerateGPU"); - (FARPROC&)SetGPUMode = GetProcAddress(hLib, "SetGPUMode"); - (FARPROC&)SetGPUColor = GetProcAddress(hLib, "SetGPUColor"); - (FARPROC&)GetGPULedCount = GetProcAddress(hLib, "GetGPULedCount"); - - (FARPROC&)CreateClaymoreKeyboard = GetProcAddress(hLib, "CreateClaymoreKeyboard"); - (FARPROC&)SetClaymoreKeyboardMode = GetProcAddress(hLib, "SetClaymoreKeyboardMode"); - (FARPROC&)SetClaymoreKeyboardColor = GetProcAddress(hLib, "SetClaymoreKeyboardColor"); - (FARPROC&)GetClaymoreKeyboardLedCount = GetProcAddress(hLib, "GetClaymoreKeyboardLedCount"); - (FARPROC&)EnumerateMbController = GetProcAddress(hLib, "EnumerateMbController"); - - (FARPROC&)CreateRogMouse = GetProcAddress(hLib, "CreateRogMouse"); - (FARPROC&)SetRogMouseMode = GetProcAddress(hLib, "SetRogMouseMode"); - (FARPROC&)SetRogMouseColor = GetProcAddress(hLib, "SetRogMouseColor"); - (FARPROC&)RogMouseLedCount = GetProcAddress(hLib, "RogMouseLedCount"); - - - int loop_start_count = GetTickCount(); - - printf(" 0: mb demo.\n 1: vga demo.\n 2: kb demo.\n 3: mouse demo.\n"); - fflush(stdin); - int input_index = getchar(); - int effect_index = -1; - - if (input_index == '0'){ - - // MB - printf("Ready to demonstrate the control to the motherboard.\n"); - - DWORD _count = EnumerateMbController(NULL, 0); - - MbLightControl* _mbLightCtrl = new MbLightControl[_count]; - EnumerateMbController(_mbLightCtrl, _count); - - SetMbMode(_mbLightCtrl[0], 1); - - DWORD _ledCount = GetMbLedCount(_mbLightCtrl[0]); - - BYTE* _color = new BYTE[_ledCount * 3]; - ZeroMemory(_color, _ledCount * 3); - - for (int j = 0; j < 3; j++){ - - for (int t = 0; t < 125; t++){ - - for (size_t i = 0; i < _ledCount * 3; ++i) - { - if (i % 3 == 0 && j == 0){ - _color[i] = t * 2; - } - if (i % 3 == 1 && j == 1){ - _color[i] = t * 2; - } - if (i % 3 == 2 && j == 2){ - _color[i] = t * 2; - } - } - - SetMbColor(_mbLightCtrl[0], _color, _ledCount * 3); - Sleep(41); - } - } - - for (size_t i = 0; i < _ledCount * 3; ++i) - { - _color[i] = 0x00; - } - - GetMbColor(_mbLightCtrl[0], _color, _ledCount * 3); - - delete[] _color; - delete[] _mbLightCtrl; - - } - - - if (input_index == '1'){ - printf("Ready to demonstrate the control to the VGA card.\n"); - getchar(); - - DWORD count = EnumerateGPU(NULL, 0); - if (count > 0) - { - GPULightControl* GpuLightCtrl = new GPULightControl[count]; - - EnumerateGPU(GpuLightCtrl, count); - DWORD t = GetGPULedCount(GpuLightCtrl[0]); - SetGPUMode(GpuLightCtrl[0], 1); - BYTE *color = new BYTE[t * 3]; - ZeroMemory(color, t * 3); - for (size_t i = 0; i < t * 3; ++i) - { - if (i % 3 == 1) - color[i] = 0xFF; - else if (i % 3 == 2) - color[i] = 0x7F; - else - color[i] = 0x00; - } - - int _loop = 150; - while (0 < _loop) - { - for (size_t i = 0; i < t * 3; i++) - { - if (color[i] >= 0xFF) - color[i] = 0x0; - else - color[i] += 0x3; - } - SetGPUColor(GpuLightCtrl[0], color, t * 3); - - Sleep(40); - - --_loop; - } - - } - } - - if (input_index == '2'){ - // Keyboard - printf("Ready to demonstrate the control to the keyboard.\n"); - getchar(); - - ClaymoreKeyboardLightControl* KeyboardLightCtrl = new ClaymoreKeyboardLightControl; - DWORD Create = CreateClaymoreKeyboard(KeyboardLightCtrl); - - if (Create > 0) - { - DWORD ledCount = GetClaymoreKeyboardLedCount(*KeyboardLightCtrl); - SetClaymoreKeyboardMode(*KeyboardLightCtrl, 1); // sw mode. - - BYTE *color = new BYTE[ledCount * 3]; - ZeroMemory(color, ledCount * 3); - for (size_t i = 0; i < ledCount * 3; ++i) - { - if (i % 3 == 1) - color[i] = 0xFF; - else if (i % 3 == 2) - color[i] = 0x7F; - else - color[i] = 0x00; - } - - int _loop = 150; - while (0 < _loop) - { - - for (size_t i = 0; i < ledCount * 3; i++) - { - if (color[i] >= 0xFF) - color[i] = 0x0; - else - color[i] += 0x3; - } - SetClaymoreKeyboardColor(*KeyboardLightCtrl, color, ledCount * 3); - - Sleep(40); - - --_loop; - } - - } - else - { - delete KeyboardLightCtrl; - } - - SetClaymoreKeyboardMode(*KeyboardLightCtrl, 0); //end demo, back to default mode. - } - - if (input_index == '3'){ - // Mouse - printf("Ready to demonstrate the control to the mouse.\n"); - - - RogMouseLightControl* MouseLightCtrl = new RogMouseLightControl; - DWORD Create = CreateRogMouse(MouseLightCtrl); - - if (Create > 0) - { - DWORD ledCount = RogMouseLedCount(*MouseLightCtrl); - SetRogMouseMode(*MouseLightCtrl, 1); // sw mode. - - BYTE *color = new BYTE[ledCount * 3]; - ZeroMemory(color, ledCount * 3); - for (size_t i = 0; i < ledCount * 3; ++i) - { - if (i % 3 == 1) - color[i] = 0xFF; - else if (i % 3 == 2) - color[i] = 0x7F; - else - color[i] = 0x00; - } - - int _loop = 150; - while (0 < _loop) - { - for (size_t i = 0; i < ledCount * 3; i++) - { - if (color[i] >= 0xFF) - color[i] = 0x0; - else - color[i] += 0x3; - } - SetRogMouseColor(*MouseLightCtrl, color, ledCount * 3); - - Sleep(40); - - --_loop; - } - - } - else - { - delete MouseLightCtrl; - } - - SetRogMouseMode(*MouseLightCtrl, 0); //end demo, back to default mode. - } - - FreeLibrary(hLib); - - return; -} - -int _tmain(int argc, _TCHAR* argv[]) -{ - //============================== - - while (1){ - SDK_DEMO(); - Sleep(1000); - } - //============================== - - - return 0; -} diff --git a/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.exe b/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.exe deleted file mode 100644 index 4b28ba3..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/AURA_SDK_Test.exe and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/ClaymoreProtocol.dll b/dependencies/AURA SDK_02_04/test code/ClaymoreProtocol.dll deleted file mode 100644 index 3f27121..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/ClaymoreProtocol.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/EVOLVE SYNC Dll.dll b/dependencies/AURA SDK_02_04/test code/EVOLVE SYNC Dll.dll deleted file mode 100644 index cbf4228..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/EVOLVE SYNC Dll.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/LED_DLL_forMB.dll b/dependencies/AURA SDK_02_04/test code/LED_DLL_forMB.dll deleted file mode 100644 index 3b56c01..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/LED_DLL_forMB.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/RogNewmouseProtocol.dll b/dependencies/AURA SDK_02_04/test code/RogNewmouseProtocol.dll deleted file mode 100644 index 3f27121..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/RogNewmouseProtocol.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/SPATHA HID Library C++.dll b/dependencies/AURA SDK_02_04/test code/SPATHA HID Library C++.dll deleted file mode 100644 index a4d9449..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/SPATHA HID Library C++.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/SPATHA SYNC Dll.dll b/dependencies/AURA SDK_02_04/test code/SPATHA SYNC Dll.dll deleted file mode 100644 index 7e7da14..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/SPATHA SYNC Dll.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/VGA_Extra.dll b/dependencies/AURA SDK_02_04/test code/VGA_Extra.dll deleted file mode 100644 index c9003ee..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/VGA_Extra.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/test code/Vender.dll b/dependencies/AURA SDK_02_04/test code/Vender.dll deleted file mode 100644 index 3433e99..0000000 Binary files a/dependencies/AURA SDK_02_04/test code/Vender.dll and /dev/null differ diff --git a/dependencies/AURA SDK_02_04/ver.02.04.txt b/dependencies/AURA SDK_02_04/ver.02.04.txt deleted file mode 100644 index 9a8a72d..0000000 --- a/dependencies/AURA SDK_02_04/ver.02.04.txt +++ /dev/null @@ -1,17 +0,0 @@ -ver 02.03 release note: - -VGA : - DWORD mode; - SetGPUMode(GpuLightCtrl[0], mode); - -Now "mode" value can be 1. -SetGPUMode(GpuLightCtrl[0], 1) will set VGA to Static mode. - -//========= - -ver 02.04 release note: - -device dll update. - - - diff --git a/dependencies/coolermaster-sdk-160630/CoolerMaster LED Table.xls b/dependencies/coolermaster-sdk-160630/CoolerMaster LED Table.xls deleted file mode 100644 index 07b9bdd..0000000 Binary files a/dependencies/coolermaster-sdk-160630/CoolerMaster LED Table.xls and /dev/null differ diff --git a/dependencies/coolermaster-sdk-160630/SDKDLL.dll b/dependencies/coolermaster-sdk-160630/SDKDLL.dll deleted file mode 100644 index 699d1f4..0000000 Binary files a/dependencies/coolermaster-sdk-160630/SDKDLL.dll and /dev/null differ diff --git a/dependencies/coolermaster-sdk-160630/SDKDLL.h b/dependencies/coolermaster-sdk-160630/SDKDLL.h deleted file mode 100644 index dfee4a1..0000000 Binary files a/dependencies/coolermaster-sdk-160630/SDKDLL.h and /dev/null differ diff --git a/dependencies/coolermaster-sdk-160630/SDKDLL.lib b/dependencies/coolermaster-sdk-160630/SDKDLL.lib deleted file mode 100644 index 5c633f9..0000000 Binary files a/dependencies/coolermaster-sdk-160630/SDKDLL.lib and /dev/null differ diff --git a/dependencies/corsair-cue-1.15.28/include/CUESDK.h b/dependencies/corsair-cue-1.15.28/include/CUESDK.h deleted file mode 100644 index 3f81f54..0000000 --- a/dependencies/corsair-cue-1.15.28/include/CUESDK.h +++ /dev/null @@ -1,154 +0,0 @@ -#pragma once - -#include "CUESDKGlobal.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "CorsairLedIdEnum.h" - - enum CorsairDeviceType // contains list of available device types - { - CDT_Unknown = 0, - CDT_Mouse = 1, - CDT_Keyboard = 2, - CDT_Headset = 3 - }; - - enum CorsairPhysicalLayout // contains list of available physical layouts for keyboards - { - CPL_Invalid = 0, // dummy value - - CPL_US = 1, - CPL_UK = 2, - CPL_BR = 3, - CPL_JP = 4, - CPL_KR = 5, // valid values for keyboard - - CPL_Zones1 = 6, - CPL_Zones2 = 7, - CPL_Zones3 = 8, - CPL_Zones4 = 9, // valid values for mouse - }; - - enum CorsairLogicalLayout // contains list of available logical layouts for keyboards - { - CLL_Invalid = 0, // dummy value - CLL_US_Int = 1, - CLL_NA = 2, - CLL_EU = 3, - CLL_UK = 4, - CLL_BE = 5, - CLL_BR = 6, - CLL_CH = 7, - CLL_CN = 8, - CLL_DE = 9, - CLL_ES = 10, - CLL_FR = 11, - CLL_IT = 12, - CLL_ND = 13, - CLL_RU = 14, - CLL_JP = 15, - CLL_KR = 16, - CLL_TW = 17, - CLL_MEX = 18 - }; - - enum CorsairDeviceCaps // contains list of device capabilities - { - CDC_None = 0, // for devices that do not support any SDK functions - CDC_Lighting = 1 // for devices that has controlled lighting - }; - - enum CorsairAccessMode // contains list of available SDK access modes - { - CAM_ExclusiveLightingControl = 0 - }; - - enum CorsairError // contains shared list of all errors which could happen during calling of Corsair* functions - { - CE_Success, // if previously called function completed successfully - CE_ServerNotFound, // CUE is not running or was shut down or third-party control is disabled in CUE settings(runtime error) - CE_NoControl, // if some other client has or took over exclusive control (runtime error) - CE_ProtocolHandshakeMissing, // if developer did not perform protocol handshake(developer error) - CE_IncompatibleProtocol, // if developer is calling the function that is not supported by the server(either because protocol has broken by server or client or because the function is new and server is too old. Check CorsairProtocolDetails for details) (developer error) - CE_InvalidArguments, // if developer supplied invalid arguments to the function(for specifics look at function descriptions). (developer error) - }; - - struct CorsairDeviceInfo // contains information about device - { - CorsairDeviceType type; // enum describing device type - const char* model; // null - terminated device model(like “K95RGB”) - CorsairPhysicalLayout physicalLayout; // enum describing physical layout of the keyboard or mouse - CorsairLogicalLayout logicalLayout; // enum describing logical layout of the keyboard as set in CUE settings - int capsMask; // mask that describes device capabilities, formed as logical “or” of CorsairDeviceCaps enum values - }; - - struct CorsairLedPosition // contains led id and position of led rectangle.Most of the keys are rectangular.In case if key is not rectangular(like Enter in ISO / UK layout) it returns the smallest rectangle that fully contains the key - { - CorsairLedId ledId; // identifier of led - double top; - double left; - double height; - double width; // values in mm - }; - - struct CorsairLedPositions // contains number of leds and arrays with their positions - { - int numberOfLed; // integer value.Number of elements in following array - CorsairLedPosition* pLedPosition; // array of led positions - }; - - struct CorsairLedColor // contains information about led and its color - { - CorsairLedId ledId; // identifier of LED to set - int r; // red brightness[0..255] - int g; // green brightness[0..255] - int b; // blue brightness[0..255] - }; - - struct CorsairProtocolDetails // contains information about SDK and CUE versions - { - const char* sdkVersion; // null - terminated string containing version of SDK(like “1.0.0.1”). Always contains valid value even if there was no CUE found - const char* serverVersion; // null - terminated string containing version of CUE(like “1.0.0.1”) or NULL if CUE was not found. - int sdkProtocolVersion; // integer number that specifies version of protocol that is implemented by current SDK. Numbering starts from 1. Always contains valid value even if there was no CUE found - int serverProtocolVersion; // integer number that specifies version of protocol that is implemented by CUE. Numbering starts from 1. If CUE was not found then this value will be 0 - bool breakingChanges; // boolean value that specifies if there were breaking changes between version of protocol implemented by server and client - }; - - - - // set specified leds to some colors.The color is retained until changed by successive calls.This function does not take logical layout into account - CORSAIR_LIGHTING_SDK_EXPORT bool CorsairSetLedsColors(int size, CorsairLedColor* ledsColors); - - CORSAIR_LIGHTING_SDK_EXPORT bool CorsairSetLedsColorsAsync(int size, CorsairLedColor* ledsColors, void(*CallbackType)(void*, bool, CorsairError), void *context); - - // returns number of connected Corsair devices that support lighting control. - CORSAIR_LIGHTING_SDK_EXPORT int CorsairGetDeviceCount(); - - // returns information about device at provided index - CORSAIR_LIGHTING_SDK_EXPORT CorsairDeviceInfo *CorsairGetDeviceInfo(int deviceIndex); - - // provides list of keyboard LEDs with their physical positions. - CORSAIR_LIGHTING_SDK_EXPORT CorsairLedPositions *CorsairGetLedPositions(); - - // retrieves led id for key name taking logical layout into account. - CORSAIR_LIGHTING_SDK_EXPORT CorsairLedId CorsairGetLedIdForKeyName(char keyName); - - // requestes control using specified access mode. By default client has shared control over lighting so there is no need to call CorsairRequestControl unless client requires exclusive control - CORSAIR_LIGHTING_SDK_EXPORT bool CorsairRequestControl(CorsairAccessMode accessMode); - - // checks file and protocol version of CUE to understand which of SDK functions can be used with this version of CUE - CORSAIR_LIGHTING_SDK_EXPORT CorsairProtocolDetails CorsairPerformProtocolHandshake(); - - // returns last error that occured while using any of Corsair* functions - CORSAIR_LIGHTING_SDK_EXPORT CorsairError CorsairGetLastError(); - - //releases previously requested control for specified access mode - CORSAIR_LIGHTING_SDK_EXPORT bool CorsairReleaseControl(CorsairAccessMode accessMode); - -#ifdef __cplusplus -} //exten "C" -#endif diff --git a/dependencies/corsair-cue-1.15.28/include/CUESDKGlobal.h b/dependencies/corsair-cue-1.15.28/include/CUESDKGlobal.h deleted file mode 100644 index 3202555..0000000 --- a/dependencies/corsair-cue-1.15.28/include/CUESDKGlobal.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#ifndef _LIB -#ifdef CORSAIR_LIGHTING_SDK_DLL -#define CORSAIR_LIGHTING_SDK_EXPORT __declspec(dllexport) -#else -#define CORSAIR_LIGHTING_SDK_EXPORT __declspec(dllimport) -#endif -#else -#define CORSAIR_LIGHTING_SDK_EXPORT -#endif diff --git a/dependencies/corsair-cue-1.15.28/include/CorsairLedIdEnum.h b/dependencies/corsair-cue-1.15.28/include/CorsairLedIdEnum.h deleted file mode 100644 index d263e79..0000000 --- a/dependencies/corsair-cue-1.15.28/include/CorsairLedIdEnum.h +++ /dev/null @@ -1,162 +0,0 @@ -#pragma once - -enum CorsairLedId -{ - CLI_Invalid = 0, - CLK_Escape = 1, - CLK_F1 = 2, - CLK_F2 = 3, - CLK_F3 = 4, - CLK_F4 = 5, - CLK_F5 = 6, - CLK_F6 = 7, - CLK_F7 = 8, - CLK_F8 = 9, - CLK_F9 = 10, - CLK_F10 = 11, - CLK_F11 = 12, - CLK_GraveAccentAndTilde = 13, - CLK_1 = 14, - CLK_2 = 15, - CLK_3 = 16, - CLK_4 = 17, - CLK_5 = 18, - CLK_6 = 19, - CLK_7 = 20, - CLK_8 = 21, - CLK_9 = 22, - CLK_0 = 23, - CLK_MinusAndUnderscore = 24, - CLK_Tab = 25, - CLK_Q = 26, - CLK_W = 27, - CLK_E = 28, - CLK_R = 29, - CLK_T = 30, - CLK_Y = 31, - CLK_U = 32, - CLK_I = 33, - CLK_O = 34, - CLK_P = 35, - CLK_BracketLeft = 36, - CLK_CapsLock = 37, - CLK_A = 38, - CLK_S = 39, - CLK_D = 40, - CLK_F = 41, - CLK_G = 42, - CLK_H = 43, - CLK_J = 44, - CLK_K = 45, - CLK_L = 46, - CLK_SemicolonAndColon = 47, - CLK_ApostropheAndDoubleQuote = 48, - CLK_LeftShift = 49, - CLK_NonUsBackslash = 50, - CLK_Z = 51, - CLK_X = 52, - CLK_C = 53, - CLK_V = 54, - CLK_B = 55, - CLK_N = 56, - CLK_M = 57, - CLK_CommaAndLessThan = 58, - CLK_PeriodAndBiggerThan = 59, - CLK_SlashAndQuestionMark = 60, - CLK_LeftCtrl = 61, - CLK_LeftGui = 62, - CLK_LeftAlt = 63, - CLK_Lang2 = 64, - CLK_Space = 65, - CLK_Lang1 = 66, - CLK_International2 = 67, - CLK_RightAlt = 68, - CLK_RightGui = 69, - CLK_Application = 70, - CLK_LedProgramming = 71, - CLK_Brightness = 72, - CLK_F12 = 73, - CLK_PrintScreen = 74, - CLK_ScrollLock = 75, - CLK_PauseBreak = 76, - CLK_Insert = 77, - CLK_Home = 78, - CLK_PageUp = 79, - CLK_BracketRight = 80, - CLK_Backslash = 81, - CLK_NonUsTilde = 82, - CLK_Enter = 83, - CLK_International1 = 84, - CLK_EqualsAndPlus = 85, - CLK_International3 = 86, - CLK_Backspace = 87, - CLK_Delete = 88, - CLK_End = 89, - CLK_PageDown = 90, - CLK_RightShift = 91, - CLK_RightCtrl = 92, - CLK_UpArrow = 93, - CLK_LeftArrow = 94, - CLK_DownArrow = 95, - CLK_RightArrow = 96, - CLK_WinLock = 97, - CLK_Mute = 98, - CLK_Stop = 99, - CLK_ScanPreviousTrack = 100, - CLK_PlayPause = 101, - CLK_ScanNextTrack = 102, - CLK_NumLock = 103, - CLK_KeypadSlash = 104, - CLK_KeypadAsterisk = 105, - CLK_KeypadMinus = 106, - CLK_KeypadPlus = 107, - CLK_KeypadEnter = 108, - CLK_Keypad7 = 109, - CLK_Keypad8 = 110, - CLK_Keypad9 = 111, - CLK_KeypadComma = 112, - CLK_Keypad4 = 113, - CLK_Keypad5 = 114, - CLK_Keypad6 = 115, - CLK_Keypad1 = 116, - CLK_Keypad2 = 117, - CLK_Keypad3 = 118, - CLK_Keypad0 = 119, - CLK_KeypadPeriodAndDelete = 120, - CLK_G1 = 121, - CLK_G2 = 122, - CLK_G3 = 123, - CLK_G4 = 124, - CLK_G5 = 125, - CLK_G6 = 126, - CLK_G7 = 127, - CLK_G8 = 128, - CLK_G9 = 129, - CLK_G10 = 130, - CLK_VolumeUp = 131, - CLK_VolumeDown = 132, - CLK_MR = 133, - CLK_M1 = 134, - CLK_M2 = 135, - CLK_M3 = 136, - CLK_G11 = 137, - CLK_G12 = 138, - CLK_G13 = 139, - CLK_G14 = 140, - CLK_G15 = 141, - CLK_G16 = 142, - CLK_G17 = 143, - CLK_G18 = 144, - CLK_International5 = 145, - CLK_International4 = 146, - CLK_Fn = 147, - CLM_1 = 148, - CLM_2 = 149, - CLM_3 = 150, - CLM_4 = 151, - CLH_LeftLogo = 152, - CLH_RightLogo = 153, - CLK_Logo = 154, - - CLI_Last = CLK_Logo -}; diff --git a/dependencies/corsair-cue-1.15.28/lib/i386/CUESDK_2013.lib b/dependencies/corsair-cue-1.15.28/lib/i386/CUESDK_2013.lib deleted file mode 100644 index da00af4..0000000 Binary files a/dependencies/corsair-cue-1.15.28/lib/i386/CUESDK_2013.lib and /dev/null differ diff --git a/dependencies/corsair-cue-1.15.28/lib/x64/CUESDK.x64_2013.lib b/dependencies/corsair-cue-1.15.28/lib/x64/CUESDK.x64_2013.lib deleted file mode 100644 index 5666b14..0000000 Binary files a/dependencies/corsair-cue-1.15.28/lib/x64/CUESDK.x64_2013.lib and /dev/null differ diff --git a/dependencies/logitech-gaming-led-sdk/Include/LogitechLEDLib.h b/dependencies/logitech-gaming-led-sdk/Include/LogitechLEDLib.h deleted file mode 100644 index a7b0643..0000000 --- a/dependencies/logitech-gaming-led-sdk/Include/LogitechLEDLib.h +++ /dev/null @@ -1,188 +0,0 @@ -// -// Logitech Gaming LED SDK -// -// Copyright (C) 2011-2014 Logitech. All rights reserved. -// Author: Tiziano Pigliucci -// Email: devtechsupport@logitech.com - -#pragma once - -#define LOGI_LED_BITMAP_WIDTH 21 -#define LOGI_LED_BITMAP_HEIGHT 6 -#define LOGI_LED_BITMAP_BYTES_PER_KEY 4 - -#define LOGI_LED_BITMAP_SIZE (LOGI_LED_BITMAP_WIDTH*LOGI_LED_BITMAP_HEIGHT*LOGI_LED_BITMAP_BYTES_PER_KEY) - -#define LOGI_LED_DURATION_INFINITE 0 - -#define LOGI_DEVICETYPE_MONOCHROME_ORD 0 -#define LOGI_DEVICETYPE_RGB_ORD 1 -#define LOGI_DEVICETYPE_PERKEY_RGB_ORD 2 - -#define LOGI_DEVICETYPE_MONOCHROME (1 << LOGI_DEVICETYPE_MONOCHROME_ORD) -#define LOGI_DEVICETYPE_RGB (1 << LOGI_DEVICETYPE_RGB_ORD) -#define LOGI_DEVICETYPE_PERKEY_RGB (1 << LOGI_DEVICETYPE_PERKEY_RGB_ORD) - -#define LOGI_DEVICETYPE_ALL (LOGI_DEVICETYPE_MONOCHROME | LOGI_DEVICETYPE_RGB | LOGI_DEVICETYPE_PERKEY_RGB) - - -namespace LogiLed -{ - typedef enum - { - ESC = 0x01, - F1 = 0x3b, - F2 = 0x3c, - F3 = 0x3d, - F4 = 0x3e, - F5 = 0x3f, - F6 = 0x40, - F7 = 0x41, - F8 = 0x42, - F9 = 0x43, - F10 = 0x44, - F11 = 0x57, - F12 = 0x58, - PRINT_SCREEN = 0x137, - SCROLL_LOCK = 0x46, - PAUSE_BREAK = 0x145, - TILDE = 0x29, - ONE = 0x02, - TWO = 0x03, - THREE = 0x04, - FOUR = 0x05, - FIVE = 0x06, - SIX = 0x07, - SEVEN = 0x08, - EIGHT = 0x09, - NINE = 0x0A, - ZERO = 0x0B, - MINUS = 0x0C, - EQUALS = 0x0D, - BACKSPACE = 0x0E, - INSERT = 0x152, - HOME = 0x147, - PAGE_UP = 0x149, - NUM_LOCK = 0x45, - NUM_SLASH = 0x135, - NUM_ASTERISK = 0x37, - NUM_MINUS = 0x4A, - TAB = 0x0F, - Q = 0x10, - W = 0x11, - E = 0x12, - R = 0x13, - T = 0x14, - Y = 0x15, - U = 0x16, - I = 0x17, - O = 0x18, - P = 0x19, - OPEN_BRACKET = 0x1A, - CLOSE_BRACKET = 0x1B, - BACKSLASH = 0x2B, - KEYBOARD_DELETE = 0x153, - END = 0x14F, - PAGE_DOWN = 0x151, - NUM_SEVEN = 0x47, - NUM_EIGHT = 0x48, - NUM_NINE = 0x49, - NUM_PLUS = 0x4E, - CAPS_LOCK = 0x3A, - A = 0x1E, - S = 0x1F, - D = 0x20, - F = 0x21, - G = 0x22, - H = 0x23, - J = 0x24, - K = 0x25, - L = 0x26, - SEMICOLON = 0x27, - APOSTROPHE = 0x28, - ENTER = 0x1C, - NUM_FOUR = 0x4B, - NUM_FIVE = 0x4C, - NUM_SIX = 0x4D, - LEFT_SHIFT = 0x2A, - Z = 0x2C, - X = 0x2D, - C = 0x2E, - V = 0x2F, - B = 0x30, - N = 0x31, - M = 0x32, - COMMA = 0x33, - PERIOD = 0x34, - FORWARD_SLASH = 0x35, - RIGHT_SHIFT = 0x36, - ARROW_UP = 0x148, - NUM_ONE = 0x4F, - NUM_TWO = 0x50, - NUM_THREE = 0x51, - NUM_ENTER = 0x11C, - LEFT_CONTROL = 0x1D, - LEFT_WINDOWS = 0x15B, - LEFT_ALT = 0x38, - SPACE = 0x39, - RIGHT_ALT = 0x138, - RIGHT_WINDOWS = 0x15C, - APPLICATION_SELECT = 0x15D, - RIGHT_CONTROL = 0x11D, - ARROW_LEFT = 0x14B, - ARROW_DOWN = 0x150, - ARROW_RIGHT = 0x14D, - NUM_ZERO = 0x52, - NUM_PERIOD = 0x53, - G_1 = 0xFFF1, - G_2 = 0xFFF2, - G_3 = 0xFFF3, - G_4 = 0xFFF4, - G_5 = 0xFFF5, - G_6 = 0xFFF6, - G_7 = 0xFFF7, - G_8 = 0xFFF8, - G_9 = 0xFFF9, - G_LOGO = 0xFFFF1, - G_BADGE = 0xFFFF2 - - }KeyName; -} - -bool LogiLedInit(); - -bool LogiLedGetSdkVersion(int *majorNum, int *minorNum, int *buildNum); -bool LogiLedGetConfigOptionNumber(const wchar_t *configPath, double *defaultValue); -bool LogiLedGetConfigOptionBool(const wchar_t *configPath, bool *defaultValue); -bool LogiLedGetConfigOptionColor(const wchar_t *configPath, int *defaultRed, int *defaultGreen, int *defaultBlue); -bool LogiLedGetConfigOptionKeyInput(const wchar_t *configPath, wchar_t *defaultValue, int bufferSize); -bool LogiLedSetConfigOptionLabel(const wchar_t *configPath, wchar_t *label); - -//Generic functions => Apply to any device type. -bool LogiLedSetTargetDevice(int targetDevice); -bool LogiLedSaveCurrentLighting(); -bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage); -bool LogiLedRestoreLighting(); -bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); -bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); -bool LogiLedStopEffects(); - -//Per-key functions => only apply to LOGI_DEVICETYPE_PERKEY_RGB devices. -bool LogiLedSetLightingFromBitmap(unsigned char bitmap[]); -bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); -bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); -bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); -bool LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage); -bool LogiLedSaveLightingForKey(LogiLed::KeyName keyName); -bool LogiLedRestoreLightingForKey(LogiLed::KeyName keyName); -bool LogiLedExcludeKeysFromBitmap(LogiLed::KeyName *keyList, int listCount); - -//Per-key effects => only apply to LOGI_DEVICETYPE_PERKEY_RGB devices. -bool LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval); -bool LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite); -bool LogiLedStopEffectsOnKey(LogiLed::KeyName keyName); - -void LogiLedShutdown(); - - - diff --git a/dependencies/logitech-gaming-led-sdk/Lib/x64/LogitechLEDLib.lib b/dependencies/logitech-gaming-led-sdk/Lib/x64/LogitechLEDLib.lib deleted file mode 100644 index 4e1b7be..0000000 Binary files a/dependencies/logitech-gaming-led-sdk/Lib/x64/LogitechLEDLib.lib and /dev/null differ diff --git a/dependencies/logitech-gaming-led-sdk/Lib/x86/LogitechLEDLib.lib b/dependencies/logitech-gaming-led-sdk/Lib/x86/LogitechLEDLib.lib deleted file mode 100644 index edefc86..0000000 Binary files a/dependencies/logitech-gaming-led-sdk/Lib/x86/LogitechLEDLib.lib and /dev/null differ diff --git a/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKDefines.h deleted file mode 100644 index 0372e28..0000000 --- a/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,58 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ -//! Razer Blackwidow Chroma device. -// {2EA1BB63-CA28-428D-9F06-196B88330BBB} -static const GUID BLACKWIDOW_CHROMA = -{ 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - -//! Razer Blackwidow Chroma Tournament Edition device. -// {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} -static const GUID BLACKWIDOW_CHROMA_TE = -{ 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - -//! Razer Deathadder Chroma device. -// {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} -static const GUID DEATHADDER_CHROMA = -{ 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - -//! Razer Kraken 7.1 Chroma device. -// {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} -static const GUID KRAKEN71_CHROMA = -{ 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - -//! Razer Firefly device. -// {80F95A94-73D2-48CA-AE9A-0986789A9AF2} -static const GUID FIREFLY_CHROMA = -{ 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - -//! Razer Tartarus device -// {00F0545C-E180-4AD1-8E8A-419061CE505E} -static const GUID TARTARUS_CHROMA = -{ 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - -//! Razer Orbweaver device -// {9D24B0AB-0162-466C-9640-7A924AA4D9FD} -static const GUID ORBWEAVER_CHROMA = -{ 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - -//! Razer Mamba Chroma Tournament Edition device -// {7EC00450-E0EE-4289-89D5-0D879C19061A} -static const GUID MAMBA_CHROMA_TE = -{ 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - -} - - -#endif diff --git a/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKTypes.h deleted file mode 100644 index d50295b..0000000 --- a/dependencies/razer-chroma-0.4.7/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,553 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5 //!< Keypad device. - } DeviceType; - - BOOL Connected; //!< Devioce is connected - } DEVICE_INFO_TYPE; - - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ forward slash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / backslash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs. - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout. - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Mouse LED Id defintion. - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-0.4.7/inc/RzErrors.h b/dependencies/razer-chroma-0.4.7/inc/RzErrors.h deleted file mode 100644 index ce8b057..0000000 --- a/dependencies/razer-chroma-0.4.7/inc/RzErrors.h +++ /dev/null @@ -1,44 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKDefines.h deleted file mode 100644 index 0372e28..0000000 --- a/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,58 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ -//! Razer Blackwidow Chroma device. -// {2EA1BB63-CA28-428D-9F06-196B88330BBB} -static const GUID BLACKWIDOW_CHROMA = -{ 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - -//! Razer Blackwidow Chroma Tournament Edition device. -// {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} -static const GUID BLACKWIDOW_CHROMA_TE = -{ 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - -//! Razer Deathadder Chroma device. -// {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} -static const GUID DEATHADDER_CHROMA = -{ 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - -//! Razer Kraken 7.1 Chroma device. -// {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} -static const GUID KRAKEN71_CHROMA = -{ 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - -//! Razer Firefly device. -// {80F95A94-73D2-48CA-AE9A-0986789A9AF2} -static const GUID FIREFLY_CHROMA = -{ 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - -//! Razer Tartarus device -// {00F0545C-E180-4AD1-8E8A-419061CE505E} -static const GUID TARTARUS_CHROMA = -{ 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - -//! Razer Orbweaver device -// {9D24B0AB-0162-466C-9640-7A924AA4D9FD} -static const GUID ORBWEAVER_CHROMA = -{ 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - -//! Razer Mamba Chroma Tournament Edition device -// {7EC00450-E0EE-4289-89D5-0D879C19061A} -static const GUID MAMBA_CHROMA_TE = -{ 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - -} - - -#endif diff --git a/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKTypes.h deleted file mode 100644 index 508842c..0000000 --- a/dependencies/razer-chroma-0.4.8/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,553 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5 //!< Keypad device. - } DeviceType; - - BOOL Connected; //!< Devioce is connected - } DEVICE_INFO_TYPE; - - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ backslash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / forward slash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs. - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout. - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Mouse LED Id defintion. - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-0.4.8/inc/RzErrors.h b/dependencies/razer-chroma-0.4.8/inc/RzErrors.h deleted file mode 100644 index ce8b057..0000000 --- a/dependencies/razer-chroma-0.4.8/inc/RzErrors.h +++ /dev/null @@ -1,44 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKDefines.h deleted file mode 100644 index 4a479c0..0000000 --- a/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,65 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ -//! Razer Blackwidow Chroma device. -// {2EA1BB63-CA28-428D-9F06-196B88330BBB} -static const GUID BLACKWIDOW_CHROMA = -{ 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - -//! Razer Blackwidow Chroma Tournament Edition device. -// {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} -static const GUID BLACKWIDOW_CHROMA_TE = -{ 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - -//! Razer Deathadder Chroma device. -// {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} -static const GUID DEATHADDER_CHROMA = -{ 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - -//! Razer Kraken 7.1 Chroma device. -// {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} -static const GUID KRAKEN71_CHROMA = -{ 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - -//! Razer Firefly device. -// {80F95A94-73D2-48CA-AE9A-0986789A9AF2} -static const GUID FIREFLY_CHROMA = -{ 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - -//! Razer Tartarus device -// {00F0545C-E180-4AD1-8E8A-419061CE505E} -static const GUID TARTARUS_CHROMA = -{ 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - -//! Razer Orbweaver device -// {9D24B0AB-0162-466C-9640-7A924AA4D9FD} -static const GUID ORBWEAVER_CHROMA = -{ 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - -//! Razer Mamba Chroma Tournament Edition device -// {7EC00450-E0EE-4289-89D5-0D879C19061A} -static const GUID MAMBA_CHROMA_TE = -{ 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - -// {18C5AD9B-4326-4828-92C4-2669A66D2283} -static const GUID DEATHSTALKER_CHROMA = -{ 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - -// {FF8A5929-4512-4257-8D59-C647BF9935D0} -static const GUID DIAMONDBACK_CHROMA= -{ 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; -} - - -#endif diff --git a/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKTypes.h deleted file mode 100644 index 5f024fc..0000000 --- a/dependencies/razer-chroma-1.0.3/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,608 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5 //!< Keypad device. - } DeviceType; - - BOOL Connected; //!< Devioce is connected - } DEVICE_INFO_TYPE; - - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ backslash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / forward slash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detailed Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.0.3/inc/RzErrors.h b/dependencies/razer-chroma-1.0.3/inc/RzErrors.h deleted file mode 100644 index ce8b057..0000000 --- a/dependencies/razer-chroma-1.0.3/inc/RzErrors.h +++ /dev/null @@ -1,44 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKDefines.h deleted file mode 100644 index 4a479c0..0000000 --- a/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,65 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ -//! Razer Blackwidow Chroma device. -// {2EA1BB63-CA28-428D-9F06-196B88330BBB} -static const GUID BLACKWIDOW_CHROMA = -{ 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - -//! Razer Blackwidow Chroma Tournament Edition device. -// {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} -static const GUID BLACKWIDOW_CHROMA_TE = -{ 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - -//! Razer Deathadder Chroma device. -// {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} -static const GUID DEATHADDER_CHROMA = -{ 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - -//! Razer Kraken 7.1 Chroma device. -// {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} -static const GUID KRAKEN71_CHROMA = -{ 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - -//! Razer Firefly device. -// {80F95A94-73D2-48CA-AE9A-0986789A9AF2} -static const GUID FIREFLY_CHROMA = -{ 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - -//! Razer Tartarus device -// {00F0545C-E180-4AD1-8E8A-419061CE505E} -static const GUID TARTARUS_CHROMA = -{ 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - -//! Razer Orbweaver device -// {9D24B0AB-0162-466C-9640-7A924AA4D9FD} -static const GUID ORBWEAVER_CHROMA = -{ 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - -//! Razer Mamba Chroma Tournament Edition device -// {7EC00450-E0EE-4289-89D5-0D879C19061A} -static const GUID MAMBA_CHROMA_TE = -{ 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - -// {18C5AD9B-4326-4828-92C4-2669A66D2283} -static const GUID DEATHSTALKER_CHROMA = -{ 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - -// {FF8A5929-4512-4257-8D59-C647BF9935D0} -static const GUID DIAMONDBACK_CHROMA= -{ 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; -} - - -#endif diff --git a/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKTypes.h deleted file mode 100644 index 1e47ed2..0000000 --- a/dependencies/razer-chroma-1.0.4/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,608 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5 //!< Keypad device. - } DeviceType; - - BOOL Connected; //!< Devioce is connected - } DEVICE_INFO_TYPE; - - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ backslash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / forward slash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detailed Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.0.4/inc/RzErrors.h b/dependencies/razer-chroma-1.0.4/inc/RzErrors.h deleted file mode 100644 index ce8b057..0000000 --- a/dependencies/razer-chroma-1.0.4/inc/RzErrors.h +++ /dev/null @@ -1,44 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKDefines.h deleted file mode 100644 index 815975d..0000000 --- a/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,92 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - -} - -#endif diff --git a/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKTypes.h deleted file mode 100644 index fdf4de4..0000000 --- a/dependencies/razer-chroma-1.1.5/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,614 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5 //!< Keypad device. - } DeviceType; - - BOOL Connected; //!< Device is connected - } DEVICE_INFO_TYPE; - - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ backslash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / forward slash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0020 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detailed Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.1.5/inc/RzErrors.h b/dependencies/razer-chroma-1.1.5/inc/RzErrors.h deleted file mode 100644 index ce8b057..0000000 --- a/dependencies/razer-chroma-1.1.5/inc/RzErrors.h +++ /dev/null @@ -1,44 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKDefines.h deleted file mode 100644 index c873431..0000000 --- a/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,104 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; -} - -#endif diff --git a/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKTypes.h deleted file mode 100644 index 9332454..0000000 --- a/dependencies/razer-chroma-1.2.2/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,627 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_STARLIGHT, //!< TODO - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - BOOL Connected; //!< Device is connected - } DEVICE_INFO_TYPE; - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc */ - RZKEY_F1 = 0x0003, /*!< F1 */ - RZKEY_F2 = 0x0004, /*!< F2 */ - RZKEY_F3 = 0x0005, /*!< F3 */ - RZKEY_F4 = 0x0006, /*!< F4 */ - RZKEY_F5 = 0x0007, /*!< F5 */ - RZKEY_F6 = 0x0008, /*!< F6 */ - RZKEY_F7 = 0x0009, /*!< F7 */ - RZKEY_F8 = 0x000A, /*!< F8 */ - RZKEY_F9 = 0x000B, /*!< F9 */ - RZKEY_F10 = 0x000C, /*!< F10 */ - RZKEY_F11 = 0x000D, /*!< F11 */ - RZKEY_F12 = 0x000E, /*!< F12 */ - RZKEY_1 = 0x0102, /*!< 1 */ - RZKEY_2 = 0x0103, /*!< 2 */ - RZKEY_3 = 0x0104, /*!< 3 */ - RZKEY_4 = 0x0105, /*!< 4 */ - RZKEY_5 = 0x0106, /*!< 5 */ - RZKEY_6 = 0x0107, /*!< 6 */ - RZKEY_7 = 0x0108, /*!< 7 */ - RZKEY_8 = 0x0109, /*!< 8 */ - RZKEY_9 = 0x010A, /*!< 9 */ - RZKEY_0 = 0x010B, /*!< 0 */ - RZKEY_A = 0x0302, /*!< A */ - RZKEY_B = 0x0407, /*!< B */ - RZKEY_C = 0x0405, /*!< C */ - RZKEY_D = 0x0304, /*!< D */ - RZKEY_E = 0x0204, /*!< E */ - RZKEY_F = 0x0305, /*!< F */ - RZKEY_G = 0x0306, /*!< G */ - RZKEY_H = 0x0307, /*!< H */ - RZKEY_I = 0x0209, /*!< I */ - RZKEY_J = 0x0308, /*!< J */ - RZKEY_K = 0x0309, /*!< K */ - RZKEY_L = 0x030A, /*!< L */ - RZKEY_M = 0x0409, /*!< M */ - RZKEY_N = 0x0408, /*!< N */ - RZKEY_O = 0x020A, /*!< O */ - RZKEY_P = 0x020B, /*!< P */ - RZKEY_Q = 0x0202, /*!< Q */ - RZKEY_R = 0x0205, /*!< R */ - RZKEY_S = 0x0303, /*!< S */ - RZKEY_T = 0x0206, /*!< T */ - RZKEY_U = 0x0208, /*!< U */ - RZKEY_V = 0x0406, /*!< V */ - RZKEY_W = 0x0203, /*!< W */ - RZKEY_X = 0x0404, /*!< X */ - RZKEY_Y = 0x0207, /*!< Y */ - RZKEY_Z = 0x0403, /*!< Z */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock */ - RZKEY_PAUSE = 0x0011, /*!< Pause */ - RZKEY_INSERT = 0x010F, /*!< Insert */ - RZKEY_HOME = 0x0110, /*!< Home */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up */ - RZKEY_DELETE = 0x020f, /*!< Delete */ - RZKEY_END = 0x0210, /*!< End */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down */ - RZKEY_UP = 0x0410, /*!< Up */ - RZKEY_LEFT = 0x050F, /*!< Left */ - RZKEY_DOWN = 0x0510, /*!< Down */ - RZKEY_RIGHT = 0x0511, /*!< Right */ - RZKEY_TAB = 0x0201, /*!< Tab */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock*/ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace */ - RZKEY_ENTER = 0x030E, /*!< Enter */ - RZKEY_LCTRL = 0x0501, /*!< Left Control*/ - RZKEY_LWIN = 0x0502, /*!< Left Window */ - RZKEY_LALT = 0x0503, /*!< Left Alt */ - RZKEY_SPACE = 0x0507, /*!< Spacebar */ - RZKEY_RALT = 0x050B, /*!< Right Alt */ - RZKEY_FN = 0x050C, /*!< 'Fn' function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu */ - RZKEY_RCTRL = 0x050E, /*!< Right Control */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1*/ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2*/ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4*/ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ tilde. 半角/全角 */ - RZKEY_OEM_2 = 0x010C, /*!< - minus. */ - RZKEY_OEM_3 = 0x010D, /*!< = equal. */ - RZKEY_OEM_4 = 0x020C, /*!< [ left sqaure bracket. */ - RZKEY_OEM_5 = 0x020D, /*!< ] right square bracket. */ - RZKEY_OEM_6 = 0x020E, /*!< \ backslash. */ - RZKEY_OEM_7 = 0x030B, /*!< ; semi-colon. */ - RZKEY_OEM_8 = 0x030C, /*!< ' apostrophe. */ - RZKEY_OEM_9 = 0x040A, /*!< , comma. */ - RZKEY_OEM_10 = 0x040B, /*!< . period. */ - RZKEY_OEM_11 = 0x040C, /*!< / forward slash. */ - RZKEY_EUR_1 = 0x030D, /*!< # */ - RZKEY_EUR_2 = 0x0402, /*!< \ */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ */ - RZKEY_JPN_2 = 0x040D, /*!< / */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ */ - RZKEY_KOR_1 = 0x0015, /*!< | */ - RZKEY_KOR_2 = 0x030D, - RZKEY_KOR_3 = 0x0402, - RZKEY_KOR_4 = 0x040D, - RZKEY_KOR_5 = 0x0504, /*!< 한자 */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 */ - RZKEY_KOR_7 = 0x050A, - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0020 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detail Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.2.2/inc/RzErrors.h b/dependencies/razer-chroma-1.2.2/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-1.2.2/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKDefines.h deleted file mode 100644 index 112ec1d..0000000 --- a/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,143 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_HEADSET = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Systems - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - - // Accessories - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - -} - -#endif diff --git a/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKTypes.h deleted file mode 100644 index 16f374c..0000000 --- a/dependencies/razer-chroma-1.5.0/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,783 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_STARLIGHT, //!< TODO - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect. - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect. - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_STARLIGHT, //!< Starlight effect. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detail Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.5.0/inc/RzErrors.h b/dependencies/razer-chroma-1.5.0/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-1.5.0/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKDefines.h deleted file mode 100644 index 112ec1d..0000000 --- a/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,143 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_HEADSET = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Systems - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - - // Accessories - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - -} - -#endif diff --git a/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKTypes.h deleted file mode 100644 index 16f374c..0000000 --- a/dependencies/razer-chroma-1.5.1/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,783 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_STARLIGHT, //!< TODO - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect. - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect. - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_STARLIGHT, //!< Starlight effect. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! \brief Custom effect using virtual grid. - //! - //! \detail Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.5.1/inc/RzErrors.h b/dependencies/razer-chroma-1.5.1/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-1.5.1/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKDefines.h deleted file mode 100644 index c2cd4ef..0000000 --- a/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,153 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Ornata Chroma - // {803378C1-CC48-4970-8539-D828CC1D420A} - static const GUID ORNATA_CHROMA = - { 0x803378c1, 0xcc48, 0x4970,{ 0x85, 0x39, 0xd8, 0x28, 0xcc, 0x1d, 0x42, 0xa } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - //! Razer Naga Hex Chroma device. - // {195D70F5-F285-4CFF-99F2-B8C0E9658DB4} - static const GUID NAGA_HEX_CHROMA = - { 0x195d70f5, 0xf285, 0x4cff, { 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_CHROMA = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Systems - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - - // Accessories - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - -} - -#endif diff --git a/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKTypes.h deleted file mode 100644 index d4c9e98..0000000 --- a/dependencies/razer-chroma-1.8.3/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,785 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_RESERVED, //!< TODO - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect. - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Breathing effect types. - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect. - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_RESERVED, //!< TODO. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect. - typedef struct STARLIGHT_EFFECT_TYPE - { - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (old definition to maintain backward compatibility). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type. - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect. - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect using virtual grid. - //! Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect. - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling. - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect. - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect. - CHROMA_STATIC, //!< Static effect. - CHROMA_WAVE, //!< Wave effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type. - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-1.8.3/inc/RzErrors.h b/dependencies/razer-chroma-1.8.3/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-1.8.3/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKDefines.h deleted file mode 100644 index 0eae622..0000000 --- a/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,169 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Ornata Chroma - // {803378C1-CC48-4970-8539-D828CC1D420A} - static const GUID ORNATA_CHROMA = - { 0x803378c1, 0xcc48, 0x4970,{ 0x85, 0x39, 0xd8, 0x28, 0xcc, 0x1d, 0x42, 0xa } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - //! Razer Blade Pro - // {A73AC338-F0E5-4BF7-91AE-DD1F7E1737A5} - static const GUID BLADE_PRO = - { 0xa73ac338, 0xf0e5, 0x4bf7,{ 0x91, 0xae, 0xdd, 0x1f, 0x7e, 0x17, 0x37, 0xa5 } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - //! Razer Naga Hex Chroma device. - // {195D70F5-F285-4CFF-99F2-B8C0E9658DB4} - static const GUID NAGA_HEX_CHROMA = - { 0x195d70f5, 0xf285, 0x4cff, { 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } }; - - //! Razer DeathAdder Elite Chroma device. - // {77834867-3237-4A9F-AD77-4A46C4183003} - static const GUID DEATHADDER_ELITE_CHROMA = - { 0x77834867, 0x3237, 0x4a9f,{ 0xad, 0x77, 0x4a, 0x46, 0xc4, 0x18, 0x30, 0x3 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_CHROMA = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - //! Razer Kraken 7.1 Chroma Refresh headset. - // {7FB8A36E-9E74-4BB3-8C86-CAC7F7891EBD} - static const GUID KRAKEN71_REFRESH_CHROMA = - { 0x7fb8a36e, 0x9e74, 0x4bb3,{ 0x8c, 0x86, 0xca, 0xc7, 0xf7, 0x89, 0x1e, 0xbd } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Chroma Linked devices - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - // {BB2E9C9B-B0D2-461A-BA52-230B5D6C3609} - static const GUID CHROMABOX = - { 0xbb2e9c9b, 0xb0d2, 0x461a,{ 0xba, 0x52, 0x23, 0xb, 0x5d, 0x6c, 0x36, 0x9 } }; - -} - -#endif diff --git a/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKTypes.h deleted file mode 100644 index 699b11a..0000000 --- a/dependencies/razer-chroma-2.3.2/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,816 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_RESERVED, //!< Reserved - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Breathing effect types. - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect (Deprecated and should not be used). - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used.). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_RESERVED, //!< Reserved. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (Deprecated and should not be used). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect using virtual grid. - //! Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect (Deprecated and should not be used). - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Chroma Link - namespace ChromaLink - { - //! Maximum number of elements/LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma Link effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Custom effect type.\n - //! Use Custom type to create a sequence of animated effects.\n - //! [ChromaLinkL#1|ChromaLinkL#2|ChromaLinkL#3|ChromaLinkL#4|ChromaLinkL#5].\n - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type.\n - //! Use Static type to create effects for all LEDs (ChromaLinkL#1). - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-2.3.2/inc/RzErrors.h b/dependencies/razer-chroma-2.3.2/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-2.3.2/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-2.6.0/inc/RzChromaLinkAPI.h b/dependencies/razer-chroma-2.6.0/inc/RzChromaLinkAPI.h deleted file mode 100644 index 119ce2b..0000000 --- a/dependencies/razer-chroma-2.6.0/inc/RzChromaLinkAPI.h +++ /dev/null @@ -1,62 +0,0 @@ -//! \file RzChromaLinkAPI.h -//! \brief Exported APIs. - -#ifndef _RZCHROMALINKAPI_H_ -#define _RZCHROMALINKAPI_H_ - -#pragma once - -#include "RzErrors.h" -#include "RzChromaSDKTypes.h" - -using namespace ChromaSDK; - -// Callback funtion -typedef LONG(*LPCHROMALINKPROC)(ChromaLink::EFFECT_TYPE Effect, PRZPARAM pData); - -// Exported functions -#ifdef __cplusplus -extern "C" -{ -#endif - /*! - * Initialize Chroma Link API. - * @return RZRESULT_ALREADY_INITIALIZED: Chroma Link API has already been initialized. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT Init(ChromaSDK::APPINFOTYPE AppInfo); - - /*! - * UnInitialize Chroma API. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnInit(void); - - /*! - * Register for Chroma Link effect events. - * @param[in] lpFunc Callback function. - * @return ERROR_INVALID_PARAMETER: lpFunc is invalid. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - * @remark - * - CHROMA_NONE : This event will be sent when there are no more Chroma Link events. - * Clients can resume their own lighting effects. - * - CHROMA_CUSTOM : This event will be sent when there is a ChromaSDK::ChromaLink::CHROMA_CUSTOM effect event. - * pData is casted to ChromaSDK::ChromaLink::CUSTOM_EFFECT_TYPE. - * The colors of each (5) LEDs can be accessed from the array. - * - CHROMA_STATIC : This event will be sent when there is a ChromaSDK::ChromaLink::CHROMA_STATIC effect event. - * pData is casted to ChromaSDK::ChromaLink::STATIC_EFFECT_TYPE. - * The color can be accessed from the structure. - */ - RZRESULT RegisterEventNotification(LPCHROMALINKPROC lpFunc); - - /*! - * Register for Chroma Link effect events. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnregisterEventNotification(void); - -#ifdef __cplusplus -} -#endif - -#endif // _RZCHROMALINKAPI_H_ diff --git a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDK.h b/dependencies/razer-chroma-2.6.0/inc/RzChromaSDK.h deleted file mode 100644 index b1bd807..0000000 --- a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDK.h +++ /dev/null @@ -1,189 +0,0 @@ - -//! \file RzChromaSDK.h -//! \brief Exported APIs. - -#ifndef _RZCHROMASDK_H_ -#define _RZCHROMASDK_H_ - -#pragma once - -#include "RzErrors.h" -#include "RzChromaSDKDefines.h" -#include "RzChromaSDKTypes.h" - -using namespace ChromaSDK; -using namespace ChromaSDK::Keyboard; -using namespace ChromaSDK::Mouse; -using namespace ChromaSDK::Headset; -using namespace ChromaSDK::Mousepad; -using namespace ChromaSDK::Keypad; -using namespace ChromaSDK::ChromaLink; - -// Exported functions -#ifdef __cplusplus -extern "C" -{ -#endif - - /*! - * Initialize Chroma SDK. - * @return RZRESULT_SERVICE_NOT_ACTIVE: Chroma SDK Service not running. - * @return RZRESULT_ALREADY_INITIALIZED: Chroma SDK has already been initialized. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT Init(void); - - /*! - * UnInitialize Chroma SDK. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. For every Init() call there should be a corresponding UnInit(). - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnInit(void); - - /*! - * Create generic effect for specific or all devices. - * @param[in] DeviceId Device Id defined in RzChromaSDKDefines.h - * @param[in] Effect Standard effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create keyboard effect. - * @param[in] Effect Keyboard effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create mouse effect. - * @param[in] Effect Mouse effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateMouseEffect(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create headset effect. - * @param[in] Effect Headset effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateHeadsetEffect(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create mousepad effect. - * @param[in] Effect Mousemat effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateMousepadEffect(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create keypad effect. - * @param[in] Effect Keypad effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateKeypadEffect(ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create effects on Chroma Linked devices. - * @param[in] Effect Chroma Link effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateChromaLinkEffect(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Delete effect - * @param[in] EffectId Id of the effect that needs to be deleted. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_NOT_FOUND: Effect Id not found. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT DeleteEffect(RZEFFECTID EffectId); - - /*! - * Set effect. - * @param[in] EffectId Id of the effect that needs to be set. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_ACCESS_DENIED: No permision to access device. - * @return RZRESULT_NOT_FOUND: Effect Id not found. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT SetEffect(RZEFFECTID EffectId); - - /*! - * Register for event notification. - * @param[in] hWnd Application window handle. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_ALREADY_INITIALIZED: Invalid Windows handle. - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - * @remark WM_CHROMA_EVENT will be sent if there is an event. - * @remark - * - \c wParam = 1 : Chroma SDK support. - * - \c lParam = 1 : Enabled. - * - \c lParam = 0 : Disabled. - * - \c wParam = 2 : Access to device. - * - \c lParam = 1 : Granted accessible. - * - \c lParam = 0 = Access revoked. - * - \c wParam = 3 : Application state. - * - \c lParam = 1 : Enabled. - * - \c lParam = 0 = Disabled. - */ - RZRESULT RegisterEventNotification(HWND hWnd); - - /*! - * Un-register for event notification. - * @return RZRESULT_NOT_VALID_STATE: Internal state is not valid. There was no event registered. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnregisterEventNotification(); - - /*! - * Query for device information. - * @param[in] DeviceId Device id found in RzChromaSDKDefines.h - * @param[out] DeviceInfo Contains device information specified by DeviceId. - * @return RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT QueryDevice(RZDEVICEID DeviceId, DEVICE_INFO_TYPE &DeviceInfo); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKDefines.h deleted file mode 100644 index 0eae622..0000000 --- a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,169 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Ornata Chroma - // {803378C1-CC48-4970-8539-D828CC1D420A} - static const GUID ORNATA_CHROMA = - { 0x803378c1, 0xcc48, 0x4970,{ 0x85, 0x39, 0xd8, 0x28, 0xcc, 0x1d, 0x42, 0xa } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - //! Razer Blade Pro - // {A73AC338-F0E5-4BF7-91AE-DD1F7E1737A5} - static const GUID BLADE_PRO = - { 0xa73ac338, 0xf0e5, 0x4bf7,{ 0x91, 0xae, 0xdd, 0x1f, 0x7e, 0x17, 0x37, 0xa5 } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - //! Razer Naga Hex Chroma device. - // {195D70F5-F285-4CFF-99F2-B8C0E9658DB4} - static const GUID NAGA_HEX_CHROMA = - { 0x195d70f5, 0xf285, 0x4cff, { 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } }; - - //! Razer DeathAdder Elite Chroma device. - // {77834867-3237-4A9F-AD77-4A46C4183003} - static const GUID DEATHADDER_ELITE_CHROMA = - { 0x77834867, 0x3237, 0x4a9f,{ 0xad, 0x77, 0x4a, 0x46, 0xc4, 0x18, 0x30, 0x3 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_CHROMA = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - //! Razer Kraken 7.1 Chroma Refresh headset. - // {7FB8A36E-9E74-4BB3-8C86-CAC7F7891EBD} - static const GUID KRAKEN71_REFRESH_CHROMA = - { 0x7fb8a36e, 0x9e74, 0x4bb3,{ 0x8c, 0x86, 0xca, 0xc7, 0xf7, 0x89, 0x1e, 0xbd } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Chroma Linked devices - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - // {BB2E9C9B-B0D2-461A-BA52-230B5D6C3609} - static const GUID CHROMABOX = - { 0xbb2e9c9b, 0xb0d2, 0x461a,{ 0xba, 0x52, 0x23, 0xb, 0x5d, 0x6c, 0x36, 0x9 } }; - -} - -#endif diff --git a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKTypes.h deleted file mode 100644 index 2b351e1..0000000 --- a/dependencies/razer-chroma-2.6.0/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,831 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Application information. - typedef struct APPINFOTYPE - { - TCHAR Title[256]; //!< Title of the application. - TCHAR Description[1024]; //!< A short description of the application. - //! Author information - struct Author - { - TCHAR Name[256]; //!< Name of the developer/company. - TCHAR Contact[256]; //!< Contact info. - } Author; - DWORD SupportedDevice; - DWORD Category; //!< 0 = Utility; 1 = Game; 2 = Chroma Link Broadcast - } APPINFOTYPE; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_RESERVED, //!< Reserved - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Breathing effect types. - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect (Deprecated and should not be used). - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used.). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_RESERVED, //!< Reserved. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (Deprecated and should not be used). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect using virtual grid. - //! Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect (Deprecated and should not be used). - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Chroma Link - namespace ChromaLink - { - //! Maximum number of elements/LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma Link effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Custom effect type.\n - //! Use Custom type to create a sequence of animated effects.\n - //! [ChromaLinkL#1|ChromaLinkL#2|ChromaLinkL#3|ChromaLinkL#4|ChromaLinkL#5].\n - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type.\n - //! Use Static type to create effects for all LEDs (ChromaLinkL#1). - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-2.6.0/inc/RzErrors.h b/dependencies/razer-chroma-2.6.0/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-2.6.0/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/dependencies/razer-chroma-2.9.0/inc/RzChromaLinkAPI.h b/dependencies/razer-chroma-2.9.0/inc/RzChromaLinkAPI.h deleted file mode 100644 index 119ce2b..0000000 --- a/dependencies/razer-chroma-2.9.0/inc/RzChromaLinkAPI.h +++ /dev/null @@ -1,62 +0,0 @@ -//! \file RzChromaLinkAPI.h -//! \brief Exported APIs. - -#ifndef _RZCHROMALINKAPI_H_ -#define _RZCHROMALINKAPI_H_ - -#pragma once - -#include "RzErrors.h" -#include "RzChromaSDKTypes.h" - -using namespace ChromaSDK; - -// Callback funtion -typedef LONG(*LPCHROMALINKPROC)(ChromaLink::EFFECT_TYPE Effect, PRZPARAM pData); - -// Exported functions -#ifdef __cplusplus -extern "C" -{ -#endif - /*! - * Initialize Chroma Link API. - * @return RZRESULT_ALREADY_INITIALIZED: Chroma Link API has already been initialized. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT Init(ChromaSDK::APPINFOTYPE AppInfo); - - /*! - * UnInitialize Chroma API. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnInit(void); - - /*! - * Register for Chroma Link effect events. - * @param[in] lpFunc Callback function. - * @return ERROR_INVALID_PARAMETER: lpFunc is invalid. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - * @remark - * - CHROMA_NONE : This event will be sent when there are no more Chroma Link events. - * Clients can resume their own lighting effects. - * - CHROMA_CUSTOM : This event will be sent when there is a ChromaSDK::ChromaLink::CHROMA_CUSTOM effect event. - * pData is casted to ChromaSDK::ChromaLink::CUSTOM_EFFECT_TYPE. - * The colors of each (5) LEDs can be accessed from the array. - * - CHROMA_STATIC : This event will be sent when there is a ChromaSDK::ChromaLink::CHROMA_STATIC effect event. - * pData is casted to ChromaSDK::ChromaLink::STATIC_EFFECT_TYPE. - * The color can be accessed from the structure. - */ - RZRESULT RegisterEventNotification(LPCHROMALINKPROC lpFunc); - - /*! - * Register for Chroma Link effect events. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnregisterEventNotification(void); - -#ifdef __cplusplus -} -#endif - -#endif // _RZCHROMALINKAPI_H_ diff --git a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDK.h b/dependencies/razer-chroma-2.9.0/inc/RzChromaSDK.h deleted file mode 100644 index b1bd807..0000000 --- a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDK.h +++ /dev/null @@ -1,189 +0,0 @@ - -//! \file RzChromaSDK.h -//! \brief Exported APIs. - -#ifndef _RZCHROMASDK_H_ -#define _RZCHROMASDK_H_ - -#pragma once - -#include "RzErrors.h" -#include "RzChromaSDKDefines.h" -#include "RzChromaSDKTypes.h" - -using namespace ChromaSDK; -using namespace ChromaSDK::Keyboard; -using namespace ChromaSDK::Mouse; -using namespace ChromaSDK::Headset; -using namespace ChromaSDK::Mousepad; -using namespace ChromaSDK::Keypad; -using namespace ChromaSDK::ChromaLink; - -// Exported functions -#ifdef __cplusplus -extern "C" -{ -#endif - - /*! - * Initialize Chroma SDK. - * @return RZRESULT_SERVICE_NOT_ACTIVE: Chroma SDK Service not running. - * @return RZRESULT_ALREADY_INITIALIZED: Chroma SDK has already been initialized. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT Init(void); - - /*! - * UnInitialize Chroma SDK. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. For every Init() call there should be a corresponding UnInit(). - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnInit(void); - - /*! - * Create generic effect for specific or all devices. - * @param[in] DeviceId Device Id defined in RzChromaSDKDefines.h - * @param[in] Effect Standard effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create keyboard effect. - * @param[in] Effect Keyboard effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create mouse effect. - * @param[in] Effect Mouse effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect. - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateMouseEffect(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create headset effect. - * @param[in] Effect Headset effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateHeadsetEffect(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create mousepad effect. - * @param[in] Effect Mousemat effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateMousepadEffect(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create keypad effect. - * @param[in] Effect Keypad effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateKeypadEffect(ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Create effects on Chroma Linked devices. - * @param[in] Effect Chroma Link effect type. - * @param[in] pParam Pointer to a parameter type specified by Effect defined in RzChromaSDKTypes.h - * @param[in,out] pEffectId Valid effect Id if successful. Set it to NULL if not required. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return RZRESULT_NOT_SUPPORTED: Effect not supported for this device. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT CreateChromaLinkEffect(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); - - /*! - * Delete effect - * @param[in] EffectId Id of the effect that needs to be deleted. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_NOT_FOUND: Effect Id not found. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT DeleteEffect(RZEFFECTID EffectId); - - /*! - * Set effect. - * @param[in] EffectId Id of the effect that needs to be set. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_ACCESS_DENIED: No permision to access device. - * @return RZRESULT_NOT_FOUND: Effect Id not found. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT SetEffect(RZEFFECTID EffectId); - - /*! - * Register for event notification. - * @param[in] hWnd Application window handle. - * @return RZRESULT_NOT_VALID_STATE: Chroma SDK not in a valid state. Did you forgot to call Init()? - * @return RZRESULT_ALREADY_INITIALIZED: Invalid Windows handle. - * @return RZRESULT_INVALID_PARAMETER: Invalid parameter. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - * @remark WM_CHROMA_EVENT will be sent if there is an event. - * @remark - * - \c wParam = 1 : Chroma SDK support. - * - \c lParam = 1 : Enabled. - * - \c lParam = 0 : Disabled. - * - \c wParam = 2 : Access to device. - * - \c lParam = 1 : Granted accessible. - * - \c lParam = 0 = Access revoked. - * - \c wParam = 3 : Application state. - * - \c lParam = 1 : Enabled. - * - \c lParam = 0 = Disabled. - */ - RZRESULT RegisterEventNotification(HWND hWnd); - - /*! - * Un-register for event notification. - * @return RZRESULT_NOT_VALID_STATE: Internal state is not valid. There was no event registered. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT UnregisterEventNotification(); - - /*! - * Query for device information. - * @param[in] DeviceId Device id found in RzChromaSDKDefines.h - * @param[out] DeviceInfo Contains device information specified by DeviceId. - * @return RZRESULT_DEVICE_NOT_AVAILABLE: Device not supported. - * @return For other error codes, please refer to [Windows System Error Codes](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx) from Windows SDK (WinError.h). - */ - RZRESULT QueryDevice(RZDEVICEID DeviceId, DEVICE_INFO_TYPE &DeviceInfo); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKDefines.h b/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKDefines.h deleted file mode 100644 index 8bfa4b2..0000000 --- a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKDefines.h +++ /dev/null @@ -1,182 +0,0 @@ -//! \file RzChromaSDKDefines.h -//! \brief Definitions of global and static variables. - -#ifndef _RZSCHROMADKDEFINES_H_ -#define _RZSCHROMADKDEFINES_H_ - -#pragma once - -#ifndef GUID_DEFINED -#include -#endif - -namespace ChromaSDK -{ - // Keyboards - //! Razer Blackwidow Chroma device. - // {2EA1BB63-CA28-428D-9F06-196B88330BBB} - static const GUID BLACKWIDOW_CHROMA = - { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; - - //! Razer Blackwidow Chroma Tournament Edition device. - // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} - static const GUID BLACKWIDOW_CHROMA_TE = - { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; - - //! Razer Deathstalker device. - // {18C5AD9B-4326-4828-92C4-2669A66D2283} - static const GUID DEATHSTALKER_CHROMA = - { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; - - //! Overwatch Keyboard. - // {872AB2A9-7959-4478-9FED-15F6186E72E4} - static const GUID OVERWATCH_KEYBOARD = - { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; - - //! Razer Blackwidow X Chroma device. - // {5AF60076-ADE9-43D4-B574-52599293B554} - static const GUID BLACKWIDOW_X_CHROMA = - { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; - - //! Razer Blackwidow X TE Chroma device. - // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} - static const GUID BLACKWIDOW_X_TE_CHROMA = - { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; - - //! Razer Ornata Chroma - // {803378C1-CC48-4970-8539-D828CC1D420A} - static const GUID ORNATA_CHROMA = - { 0x803378c1, 0xcc48, 0x4970,{ 0x85, 0x39, 0xd8, 0x28, 0xcc, 0x1d, 0x42, 0xa } }; - - //! Razer Blade Stealth. - // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} - static const GUID BLADE_STEALTH = - { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; - - //! Razer Blade - // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} - static const GUID BLADE = - { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; - - //! Razer Blade Pro - // {A73AC338-F0E5-4BF7-91AE-DD1F7E1737A5} - static const GUID BLADE_PRO = - { 0xa73ac338, 0xf0e5, 0x4bf7,{ 0x91, 0xae, 0xdd, 0x1f, 0x7e, 0x17, 0x37, 0xa5 } }; - - - // Mice - //! Razer Deathadder Chroma device. - // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} - static const GUID DEATHADDER_CHROMA = - { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; - - //! Razer Mamba Chroma Tournament Edition device. - // {7EC00450-E0EE-4289-89D5-0D879C19061A} - static const GUID MAMBA_CHROMA_TE = - { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; - - //! Razer Diamondback device. - // {FF8A5929-4512-4257-8D59-C647BF9935D0} - static const GUID DIAMONDBACK_CHROMA = - { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; - - //! Razer Mamba device. - // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} - static const GUID MAMBA_CHROMA = - { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; - - //! Razer Naga Epic device. - // {D714C50B-7158-4368-B99C-601ACB985E98} - static const GUID NAGA_EPIC_CHROMA = - { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; - - //! Razer Naga device. - // {F1876328-6CA4-46AE-BE04-BE812B414433} - static const GUID NAGA_CHROMA = - { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; - - //! Razer Orochi Chroma device. - // {52C15681-4ECE-4DD9-8A52-A1418459EB34} - static const GUID OROCHI_CHROMA = - { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; - - //! Razer Naga Hex Chroma device. - // {195D70F5-F285-4CFF-99F2-B8C0E9658DB4} - static const GUID NAGA_HEX_CHROMA = - { 0x195d70f5, 0xf285, 0x4cff, { 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } }; - - //! Razer DeathAdder Elite Chroma device. - // {77834867-3237-4A9F-AD77-4A46C4183003} - static const GUID DEATHADDER_ELITE_CHROMA = - { 0x77834867, 0x3237, 0x4a9f,{ 0xad, 0x77, 0x4a, 0x46, 0xc4, 0x18, 0x30, 0x3 } }; - - - // Headsets - //! Razer Kraken 7.1 Chroma device. - // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} - static const GUID KRAKEN71_CHROMA = - { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; - - //! Razer ManO'War device. - // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} - static const GUID MANOWAR_CHROMA = - { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; - - //! Razer Kraken 7.1 Chroma Refresh headset. - // {7FB8A36E-9E74-4BB3-8C86-CAC7F7891EBD} - static const GUID KRAKEN71_REFRESH_CHROMA = - { 0x7fb8a36e, 0x9e74, 0x4bb3,{ 0x8c, 0x86, 0xca, 0xc7, 0xf7, 0x89, 0x1e, 0xbd } }; - - - // Mouse mat - //! Razer Firefly device. - // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} - static const GUID FIREFLY_CHROMA = - { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; - - - // Keypads - //! Razer Tartarus device. - // {00F0545C-E180-4AD1-8E8A-419061CE505E} - static const GUID TARTARUS_CHROMA = - { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; - - //! Razer Orbweaver device. - // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} - static const GUID ORBWEAVER_CHROMA = - { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; - - - // Chroma Linked devices - // {35F6F18D-1AE5-436C-A575-AB44A127903A} - static const GUID LENOVO_Y900 = - { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; - - // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} - static const GUID LENOVO_Y27 = - { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; - - // {0201203B-62F3-4C50-83DD-598BABD208E0} - static const GUID CORE_CHROMA = - { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; - - // {BB2E9C9B-B0D2-461A-BA52-230B5D6C3609} - static const GUID CHROMABOX = - { 0xbb2e9c9b, 0xb0d2, 0x461a,{ 0xba, 0x52, 0x23, 0xb, 0x5d, 0x6c, 0x36, 0x9 } }; - - - // Speakers - //! Razer Nommo - // {45B308F2-CD44-4594-8375-4D5945AD880E} - static const GUID NOMMO_CHROMA = - { 0x45b308f2, 0xcd44, 0x4594,{ 0x83, 0x75, 0x4d, 0x59, 0x45, 0xad, 0x88, 0xe } }; - - - //! Razer Nommo Pro - // {3017280B-D7F9-4D7B-930E-7B47181B46B5} - static const GUID NOMMO_CHROMA_PRO = - { 0x3017280b, 0xd7f9, 0x4d7b,{ 0x93, 0xe, 0x7b, 0x47, 0x18, 0x1b, 0x46, 0xb5 } }; - -} - -#endif diff --git a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKTypes.h b/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKTypes.h deleted file mode 100644 index 77eea8a..0000000 --- a/dependencies/razer-chroma-2.9.0/inc/RzChromaSDKTypes.h +++ /dev/null @@ -1,832 +0,0 @@ -//! \file RzChromaSDKTypes.h -//! \brief Data types. - -#ifndef _RZCHROMASDKTYPES_H_ -#define _RZCHROMASDKTYPES_H_ - -#pragma once - -typedef LONG RZRESULT; //!< Return result. -typedef GUID RZEFFECTID; //!< Effect Id. -typedef GUID RZDEVICEID; //!< Device Id. -typedef unsigned int RZDURATION; //!< Milliseconds. -typedef size_t RZSIZE; //!< Size. -typedef void* PRZPARAM; //!< Context sensitive pointer. -typedef DWORD RZID; //!< Generic data type for Identifier. -typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) - -namespace ChromaSDK -{ - //! Event notification Window message - const UINT WM_CHROMA_EVENT = WM_APP+0x2000; - - //! Application information. - typedef struct APPINFOTYPE - { - TCHAR Title[256]; //!< Title of the application. - TCHAR Description[1024]; //!< A short description of the application. - //! Author information - struct Author - { - TCHAR Name[256]; //!< Name of the developer/company. - TCHAR Contact[256]; //!< Contact info. - } Author; - DWORD SupportedDevice; - DWORD Category; //!< 0 = Utility; 1 = Game; 2 = Chroma Link Broadcast - } APPINFOTYPE; - - //! Chroma generic effects. Note: Not all devices supported the listed effects. - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. - CHROMA_RESERVED, //!< Reserved - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Device info. - typedef struct DEVICE_INFO_TYPE - { - //! Device types. - enum DeviceType - { - DEVICE_KEYBOARD = 1, //!< Keyboard device. - DEVICE_MOUSE = 2, //!< Mouse device. - DEVICE_HEADSET = 3, //!< Headset device. - DEVICE_MOUSEPAD = 4, //!< Mousepad device. - DEVICE_KEYPAD = 5, //!< Keypad device. - DEVICE_SYSTEM = 6, //!< System device. - DEVICE_SPEAKERS = 7, //!< Speakers. - DEVICE_INVALID //!< Invalid device. - } DeviceType; - - DWORD Connected; //!< Number of devices connected. - } DEVICE_INFO_TYPE; - - const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. - const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. - - //! Blinking effect (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Blinking color - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Breathing effect types. - enum _Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; - } CUSTOM_EFFECT_TYPE; - - //! No effect. - typedef struct NO_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } NO_EFFECT_TYPE; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! Spectrum cycling effect (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect (Deprecated and should not be used). - typedef struct STATIC_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) - DWORD Param; //!< Extra parameters. - - //! Direction of effect. - enum _Direction - { - DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_FRONT_TO_BACK, //!< Front to back - DIRECTION_BACK_TO_FRONT //!< Back top front - } Direction; - } WAVE_EFFECT_TYPE; - - //! Keyboards - namespace Keyboard - { - //! Definitions of keys. - typedef enum RZKEY - { - RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ - RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ - RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ - RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ - RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ - RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ - RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ - RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ - RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ - RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ - RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ - RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ - RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ - RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ - RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ - RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ - RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ - RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ - RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ - RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ - RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ - RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ - RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ - RZKEY_A = 0x0302, /*!< A (VK_A) */ - RZKEY_B = 0x0407, /*!< B (VK_B) */ - RZKEY_C = 0x0405, /*!< C (VK_C) */ - RZKEY_D = 0x0304, /*!< D (VK_D) */ - RZKEY_E = 0x0204, /*!< E (VK_E) */ - RZKEY_F = 0x0305, /*!< F (VK_F) */ - RZKEY_G = 0x0306, /*!< G (VK_G) */ - RZKEY_H = 0x0307, /*!< H (VK_H) */ - RZKEY_I = 0x0209, /*!< I (VK_I) */ - RZKEY_J = 0x0308, /*!< J (VK_J) */ - RZKEY_K = 0x0309, /*!< K (VK_K) */ - RZKEY_L = 0x030A, /*!< L (VK_L) */ - RZKEY_M = 0x0409, /*!< M (VK_M) */ - RZKEY_N = 0x0408, /*!< N (VK_N) */ - RZKEY_O = 0x020A, /*!< O (VK_O) */ - RZKEY_P = 0x020B, /*!< P (VK_P) */ - RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ - RZKEY_R = 0x0205, /*!< R (VK_R) */ - RZKEY_S = 0x0303, /*!< S (VK_S) */ - RZKEY_T = 0x0206, /*!< T (VK_T) */ - RZKEY_U = 0x0208, /*!< U (VK_U) */ - RZKEY_V = 0x0406, /*!< V (VK_V) */ - RZKEY_W = 0x0203, /*!< W (VK_W) */ - RZKEY_X = 0x0404, /*!< X (VK_X) */ - RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ - RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ - RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ - RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ - RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ - RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ - RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ - RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ - RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ - RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ - RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ - RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ - RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ - RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ - RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ - RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ - RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ - RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ - RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ - RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ - RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ - RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ - RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ - RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ - RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ - RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ - RZKEY_END = 0x0210, /*!< End (VK_END) */ - RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ - RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ - RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ - RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ - RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ - RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ - RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ - RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ - RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ - RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ - RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ - RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ - RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ - RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ - RZKEY_FN = 0x050C, /*!< Function key. */ - RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ - RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ - RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ - RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ - RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ - RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ - RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ - RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ - RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ - RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ - RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ - RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ - RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ - RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ - RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ - RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ - RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ - RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ - RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ - RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ - RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ - RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ - RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ - RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ - RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ - RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ - RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ - RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ - RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ - RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ - RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ - RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ - RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ - RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ - RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ - } RZKEY; - - //! Definition of LEDs. - typedef enum RZLED - { - RZLED_LOGO = 0x0014 /*!< Razer logo */ - } RZLED; - - //! Maximum number of rows in a keyboard. - const RZSIZE MAX_ROW = 6; - - //! Maximum number of columns in a keyboard. - const RZSIZE MAX_COLUMN = 22; - - //! Maximum number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Maximum number of custom effects. - const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; - - //! Keyboard LED layout. - const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; - - //! Chroma keyboard effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used.). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_RESERVED, //!< Reserved. - CHROMA_CUSTOM_KEY, //!< Custom effects with keys. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keyboard effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect using a matrix type. - typedef struct CUSTOM_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect with keys. - typedef struct CUSTOM_KEY_EFFECT_TYPE - { - COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. - COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; - } CUSTOM_KEY_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Starlight effect (Deprecated and should not be used). - typedef struct STARLIGHT_EFFECT_TYPE - { - //! Starlight effect types. - enum _Type - { - TWO_COLORS = 1, //!< 2 colors. - RANDOM_COLORS //!< Random colors - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - - //! Duration of the effect. - enum _Duration - { - DURATION_SHORT = 1, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; //!< The time taken for the effect to fade away. - - } STARLIGHT_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Mice - namespace Mouse - { - //! Maximum number of custom LEDs (old definition to maintain backward compatibility). - const RZSIZE MAX_LEDS = 30; - - //! Mice LED layout (old definition to maintain backward compatibility). - const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; - - //! Maximum number of rows of the virtual grid. - const RZSIZE MAX_ROW = 9; - - //! Maximum number of columns of the virtual grid. - const RZSIZE MAX_COLUMN = 7; - - //! Maximum number of LEDs of the virtual grid. - const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; - - //! Mice LED virtual grid layout. - const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; - - //! Mouse LED Id defintion (Deprecated and should not be used). - typedef enum RZLED - { - RZLED_NONE = 0, //!< No LED. - RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. - RZLED_LOGO = 2, //!< Logo LED. - RZLED_BACKLIGHT = 3, //!< Backlight or numpad. - RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) - RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) - RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) - RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) - RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) - RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) - RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) - RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) - RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) - RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) - RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) - RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) - RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) - RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) - RZLED_ALL = 0xFFFF - } RZLED; - - //! Mouse LED Id defintion for the virtual grid. - typedef enum RZLED2 - { - RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. - RZLED2_LOGO = 0x0703, //!< Logo LED. - RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. - RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. - RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. - RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. - RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. - RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. - RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. - RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. - RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. - RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. - RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. - RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. - RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. - RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. - RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. - RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. - RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. - RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. - RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. - RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. - } RZLED2; - - //! Chroma mouse effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BLINKING, //!< Blinking effect (Deprecated and should not be used). - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect (Deprecated and should not be used). - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Blinking effect type (Deprecated and should not be used). - typedef struct BLINKING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - COLORREF Color; //!< Color. - } BLINKING_EFFECT_TYPE; - - //! Breathing effect (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Breathing type. - enum Type - { - ONE_COLOR = 1, //!< 1 color (Only fill Color1). - TWO_COLORS, //!< 2 colors. - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect (Deprecated and should not be used). - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Custom effect using virtual grid. - //! Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) - typedef struct CUSTOM_EFFECT_TYPE2 - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE2; - - //! Reactive effect (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG //!< Long duration. - } Duration; - - RZCOLOR Color; //!< Color of the effect. - } REACTIVE_EFFECT_TYPE; - - //! No effect (Deprecated and should not be used). - typedef struct NO_EFFECT_TYPE - { - RZLED LEDId; //!< LED Id - } NO_EFFECT_TYPE; - - //! Spectrum cycling (Deprecated and should not be used). - typedef struct SPECTRUMCYCLING_EFFECT_TYPE - { - RZLED LEDId; //!< LED id. - } SPECTRUMCYCLING_EFFECT_TYPE; - - //! Wave effect (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - FRONT_TO_BACK, //!< Front to back - BACK_TO_FRONT //!< Back to front - } Direction; - } WAVE_EFFECT_TYPE; - } - - //! Headsets - namespace Headset - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma headset effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effects. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - COLORREF Color; //!< Color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - } - - //! Mousepads - namespace Mousepad - { - //! Maximum number of LEDs - const RZSIZE MAX_LEDS = 15; - - //! Chroma mousepad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma mousepad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type. - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. - //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - COLORREF Color; //!< Color of the effect - } STATIC_EFFECT_TYPE; - - //! Wave effect type - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Keypads - namespace Keypad - { - //! Maximum number of rows. - const RZSIZE MAX_ROW = 4; - - //! Maximum number of columns. - const RZSIZE MAX_COLUMN = 5; - - //! Total number of keys. - const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; - - //! Chroma keypad effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_BREATHING, //!< Breathing effect (Deprecated and should not be used). - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_REACTIVE, //!< Reactive effect (Deprecated and should not be used). - CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (Deprecated and should not be used). - CHROMA_STATIC, //!< Static single color effect. - CHROMA_WAVE, //!< Wave effect (Deprecated and should not be used). - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - // Chroma keypad effects - //! Breathing effect type (Deprecated and should not be used). - typedef struct BREATHING_EFFECT_TYPE - { - //! Breathing effects. - enum Type - { - TWO_COLORS = 1, //!< 2 colors - RANDOM_COLORS, //!< Random colors - INVALID //!< Invalid type - } Type; - COLORREF Color1; //!< First color. - COLORREF Color2; //!< Second color. - } BREATHING_EFFECT_TYPE; - - //! Custom effect type - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. - //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. - } CUSTOM_EFFECT_TYPE; - - //! Reactive effect type (Deprecated and should not be used). - typedef struct REACTIVE_EFFECT_TYPE - { - //! Duration of the effect. - enum Duration - { - DURATION_NONE=0, //!< No duration. - DURATION_SHORT, //!< Short duration. - DURATION_MEDIUM, //!< Medium duration. - DURATION_LONG, //!< Long duration. - DURATION_INVALID //!< Invalid duration. - } Duration; //!< The time taken for the effect to fade away. - - COLORREF Color; //!< Color of the effect - } REACTIVE_EFFECT_TYPE; - - //! Static effect type - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - - //! Wave effect type (Deprecated and should not be used). - typedef struct WAVE_EFFECT_TYPE - { - //! Direction of the wave effect. - enum Direction - { - DIRECTION_NONE=0, //!< No direction. - DIRECTION_LEFT_TO_RIGHT, //!< Left to right. - DIRECTION_RIGHT_TO_LEFT, //!< Right to left. - DIRECTION_INVALID //!< Invalid direction. - } Direction; //!< Direction of the wave. - } WAVE_EFFECT_TYPE; - } - - //! Chroma Link - namespace ChromaLink - { - //! Maximum number of elements/LEDs - const RZSIZE MAX_LEDS = 5; - - //! Chroma Link effect types - typedef enum EFFECT_TYPE - { - CHROMA_NONE = 0, //!< No effect. - CHROMA_CUSTOM, //!< Custom effect. - CHROMA_STATIC, //!< Static single color effect. - CHROMA_INVALID //!< Invalid effect. - } EFFECT_TYPE; - - //! Custom effect type.\n - //! Use Custom type to create a sequence of animated effects.\n - //! [ChromaLinkL#1|ChromaLinkL#2|ChromaLinkL#3|ChromaLinkL#4|ChromaLinkL#5].\n - typedef struct CUSTOM_EFFECT_TYPE - { - RZCOLOR Color[MAX_LEDS]; //!< Array of colors. - } CUSTOM_EFFECT_TYPE; - - //! Static effect type.\n - //! Use Static type to create effects for all LEDs (ChromaLinkL#1). - typedef struct STATIC_EFFECT_TYPE - { - RZCOLOR Color; //!< Color of the effect. - } STATIC_EFFECT_TYPE; - } -} - -#endif diff --git a/dependencies/razer-chroma-2.9.0/inc/RzErrors.h b/dependencies/razer-chroma-2.9.0/inc/RzErrors.h deleted file mode 100644 index 6d3f29b..0000000 --- a/dependencies/razer-chroma-2.9.0/inc/RzErrors.h +++ /dev/null @@ -1,46 +0,0 @@ - -//! \file RzErrors.h -//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. - -#ifndef _RZERRORS_H_ -#define _RZERRORS_H_ - -#pragma once - -// Error codes -//! Invalid -#define RZRESULT_INVALID -1L -//! Success -#define RZRESULT_SUCCESS 0L -//! Access denied -#define RZRESULT_ACCESS_DENIED 5L -//! Invalid handle -#define RZRESULT_INVALID_HANDLE 6L -//! Not supported -#define RZRESULT_NOT_SUPPORTED 50L -//! Invalid parameter. -#define RZRESULT_INVALID_PARAMETER 87L -//! The service has not been started -#define RZRESULT_SERVICE_NOT_ACTIVE 1062L -//! Cannot start more than one instance of the specified program. -#define RZRESULT_SINGLE_INSTANCE_APP 1152L -//! Device not connected -#define RZRESULT_DEVICE_NOT_CONNECTED 1167L -//! Element not found. -#define RZRESULT_NOT_FOUND 1168L -//! Request aborted. -#define RZRESULT_REQUEST_ABORTED 1235L -//! An attempt was made to perform an initialization operation when initialization has already been completed. -#define RZRESULT_ALREADY_INITIALIZED 1247L -//! Resource not available or disabled -#define RZRESULT_RESOURCE_DISABLED 4309L -//! Device not available or supported -#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L -//! The group or resource is not in the correct state to perform the requested operation. -#define RZRESULT_NOT_VALID_STATE 5023L -//! No more items -#define RZRESULT_NO_MORE_ITEMS 259L -//! General failure. -#define RZRESULT_FAILED 2147500037L - -#endif diff --git a/scripts/build-appimage.sh b/scripts/build-appimage.sh new file mode 100755 index 0000000..c5cc589 --- /dev/null +++ b/scripts/build-appimage.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +#-----------------------------------------------------------------------# +# Keyboard Visualizer AppImage Build Script # +#-----------------------------------------------------------------------# + +set -x +set -e + +#-----------------------------------------------------------------------# +# Build in a temporary directory to keep the system clean # +# Use RAM disk if possible (if available and not building on a CI # +# system like Travis) # +#-----------------------------------------------------------------------# +if [ "$CI" == "" ] && [ -d /dev/shm ]; then + TEMP_BASE=/dev/shm +else + TEMP_BASE=/tmp +fi + +BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimage-build-XXXXXX) + +#-----------------------------------------------------------------------# +# This checks the Architecture of the system to work out if we're # +# building on i386 or x86_64 and saves for later use # +#-----------------------------------------------------------------------# + +if [ ${DEB_HOST_ARCH:0:1} == ${DEB_HOST_GNU_CPU:0:1} ]; then + ARCH="$DEB_HOST_ARCH" +else + ARCH="$DEB_HOST_GNU_CPU" +fi +echo Inputs: "$DEB_HOST_ARCH" "$DEB_HOST_GNU_CPU" +echo Calculated: "$ARCH" + +#-----------------------------------------------------------------------# +# Make sure to clean up build dir, even if errors occur # +#-----------------------------------------------------------------------# +cleanup () { + if [ -d "$BUILD_DIR" ]; then + rm -rf "$BUILD_DIR" + fi +} +trap cleanup EXIT + +#-----------------------------------------------------------------------# +# Store repo root as variable # +#-----------------------------------------------------------------------# +REPO_ROOT=$(readlink -f $(dirname $(dirname $0))) +OLD_CWD=$(readlink -f .) + +#-----------------------------------------------------------------------# +# Switch to build dir # +#-----------------------------------------------------------------------# +pushd "$BUILD_DIR" + +#-----------------------------------------------------------------------# +# Configure build files with qmake # +# we need to explicitly set the install prefix, as qmake's default is # +# /usr/local for some reason... # +#-----------------------------------------------------------------------# +qmake "$REPO_ROOT" + +#-----------------------------------------------------------------------# +# Build project and install files into AppDir # +#-----------------------------------------------------------------------# +make -j$(nproc) TARGET="$TARGET" +make install INSTALL_ROOT=AppDir + +#-----------------------------------------------------------------------# +# Make them executable # +#-----------------------------------------------------------------------# +chmod +x "$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy*.AppImage + +#-----------------------------------------------------------------------# +# Make sure Qt plugin finds QML sources so it can deploy the imported # +# files # +export QML_SOURCES_PATHS="$REPO_ROOT"/src + +"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir -e KeyboardVisualizer -i "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.png -d "$REPO_ROOT"/KeyboardVisualizerQT/KeyboardVisualizer.desktop +"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-plugin-qt-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir +"$REPO_ROOT"/OpenRGB/scripts/tools/linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run --appdir AppDir --output appimage + +#-----------------------------------------------------------------------# +# Move built AppImage back into original CWD # +#-----------------------------------------------------------------------# +mv Keyboard_Visualizer*.AppImage "$OLD_CWD" +