Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10295a19fc | ||
|
|
84f60fccc6 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: CalcProgrammer1
|
||||
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
|
||||
|
||||
@@ -28,7 +28,6 @@ Build/
|
||||
.qmake.stash
|
||||
.vscode
|
||||
.vs
|
||||
.idea
|
||||
|
||||
# Generic Files
|
||||
.DS_Store
|
||||
|
||||
+218
-128
@@ -65,22 +65,22 @@ before_script:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# OpenRGB Common Appimage Build Steps #
|
||||
# Linux (AppImage) i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
.hidden_appimage_script: &appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-${TGT_ARCH}
|
||||
"Linux i386 AppImage":
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-i386
|
||||
tags:
|
||||
- linux
|
||||
- ${TGT_ARCH}
|
||||
- i386
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh ${TGT_QT}
|
||||
- ./scripts/build-appimage.sh
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_${TGT_NAME}_${CI_COMMIT_SHORT_SHA}"
|
||||
name: "${CI_PROJECT_NAME}_Linux_i386_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-${TGT_PATH}.AppImage
|
||||
- OpenRGB-i386.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
@@ -88,43 +88,62 @@ before_script:
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux i386 AppImage":
|
||||
variables:
|
||||
TGT_ARCH: "i386"
|
||||
TGT_QT: ""
|
||||
TGT_NAME: "${TGT_ARCH}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) Qt6 i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux i386 AppImage Qt6":
|
||||
variables:
|
||||
TGT_ARCH: "i386"
|
||||
TGT_QT: "qt6"
|
||||
TGT_NAME: "${TGT_ARCH}_${TGT_QT^}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-i386
|
||||
tags:
|
||||
- linux
|
||||
- i386
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh qt6
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_i386_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-i386.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) amd64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux amd64 AppImage Base":
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-amd64
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_amd64_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-x86_64.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
|
||||
when: never
|
||||
|
||||
"Linux amd64 AppImage":
|
||||
variables:
|
||||
TGT_ARCH: "amd64"
|
||||
TGT_QT: ""
|
||||
TGT_NAME: "${TGT_ARCH}"
|
||||
TGT_PATH: "x86_64"
|
||||
<<: *appimage_script_steps
|
||||
extends: "Linux amd64 AppImage Base"
|
||||
rules:
|
||||
- !reference [.fork_local_runner_rules, rules]
|
||||
tags:
|
||||
- linux
|
||||
- amd64
|
||||
|
||||
"Linux amd64 AppImage (gitlab.com runner)":
|
||||
extends: "Linux amd64 AppImage"
|
||||
extends: "Linux amd64 AppImage Base"
|
||||
rules:
|
||||
- !reference [.fork_gitlab_runner_rules, rules]
|
||||
tags:
|
||||
@@ -134,66 +153,131 @@ before_script:
|
||||
# Linux (AppImage) Qt6 amd64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux amd64 AppImage Qt6":
|
||||
variables:
|
||||
TGT_ARCH: "amd64"
|
||||
TGT_QT: "qt6"
|
||||
TGT_NAME: "${TGT_ARCH}_${TGT_QT^}"
|
||||
TGT_PATH: "x86_64"
|
||||
<<: *appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-amd64
|
||||
tags:
|
||||
- linux
|
||||
- amd64
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh qt6
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_amd64_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-amd64.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) armhf Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux armhf AppImage":
|
||||
variables:
|
||||
TGT_ARCH: "armhf"
|
||||
TGT_QT: ""
|
||||
TGT_NAME: "${TGT_ARCH}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-armhf
|
||||
tags:
|
||||
- linux
|
||||
- armhf
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_armhf_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-armhf.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) Qt6 armhf Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux armhf AppImage Qt6":
|
||||
variables:
|
||||
TGT_ARCH: "armhf"
|
||||
TGT_QT: "qt6"
|
||||
TGT_NAME: "${TGT_ARCH}_${TGT_QT^}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-armhf
|
||||
tags:
|
||||
- linux
|
||||
- armhf
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh qt6
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_armhf_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-armhf.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) arm64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux arm64 AppImage":
|
||||
variables:
|
||||
TGT_ARCH: "arm64"
|
||||
TGT_QT: ""
|
||||
TGT_NAME: "${TGT_ARCH}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-arm64
|
||||
tags:
|
||||
- linux
|
||||
- arm64
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_arm64_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-arm64.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) Qt6 arm64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux arm64 AppImage Qt6":
|
||||
variables:
|
||||
TGT_ARCH: "arm64"
|
||||
TGT_QT: "qt6"
|
||||
TGT_NAME: "${TGT_ARCH}_${TGT_QT^}"
|
||||
TGT_PATH: "${TGT_ARCH}"
|
||||
<<: *appimage_script_steps
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# OpenRGB Common Debian Build Steps #
|
||||
#-----------------------------------------------------------------------#
|
||||
.hidden_deb_script: &debian_script_steps
|
||||
stage: build
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:$TGT_DEB-$TGT_ARCH
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-arm64
|
||||
tags:
|
||||
- linux
|
||||
- $TGT_ARCH
|
||||
- arm64
|
||||
stage: build
|
||||
script:
|
||||
- export $(dpkg-architecture)
|
||||
- ./scripts/build-appimage.sh qt6
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_arm64_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-arm64.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Bookworm i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux i386 .deb (Debian Bookworm)":
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-i386
|
||||
tags:
|
||||
- linux
|
||||
- i386
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-package-files.sh debian/changelog
|
||||
- dpkg-architecture -l
|
||||
@@ -202,86 +286,96 @@ before_script:
|
||||
- mv -v ../openrgb*.deb ./
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_${TGT_ARCH}_deb_${CI_COMMIT_SHORT_SHA}"
|
||||
name: "${CI_PROJECT_NAME}_Linux_i386_deb_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- openrgb*.deb
|
||||
exclude:
|
||||
- openrgb-dbgsym*.deb
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Bookworm i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux i386 .deb (Debian Bookworm)":
|
||||
variables:
|
||||
TGT_ARCH: "i386"
|
||||
TGT_DEB: "bookworm"
|
||||
<<: *debian_script_steps
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Trixie i386 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux i386 .deb (Debian Trixie)":
|
||||
variables:
|
||||
TGT_ARCH: "i386"
|
||||
TGT_DEB: "trixie"
|
||||
<<: *debian_script_steps
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Bookworm amd64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux amd64 .deb (Debian Bookworm)":
|
||||
variables:
|
||||
TGT_ARCH: "amd64"
|
||||
TGT_DEB: "bookworm"
|
||||
<<: *debian_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-amd64
|
||||
tags:
|
||||
- linux
|
||||
- amd64
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-package-files.sh debian/changelog
|
||||
- dpkg-architecture -l
|
||||
- dpkg-buildpackage -us -B
|
||||
- rm -v ../openrgb-dbgsym*.deb
|
||||
- mv -v ../openrgb*.deb ./
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Trixie amd64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux amd64 .deb (Debian Trixie)":
|
||||
variables:
|
||||
TGT_ARCH: "amd64"
|
||||
TGT_DEB: "trixie"
|
||||
<<: *debian_script_steps
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_amd64_deb_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- openrgb*.deb
|
||||
exclude:
|
||||
- openrgb-dbgsym*.deb
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Bookworm armhf Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux armhf .deb (Debian Bookworm)":
|
||||
variables:
|
||||
TGT_ARCH: "armhf"
|
||||
TGT_DEB: "bookworm"
|
||||
<<: *debian_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-armhf
|
||||
tags:
|
||||
- linux
|
||||
- armhf
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-package-files.sh debian/changelog
|
||||
- dpkg-architecture -l
|
||||
- dpkg-buildpackage -us -B
|
||||
- rm -v ../openrgb-dbgsym*.deb
|
||||
- mv -v ../openrgb*.deb ./
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Trixie armhf Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux armhf .deb (Debian Trixie)":
|
||||
variables:
|
||||
TGT_ARCH: "armhf"
|
||||
TGT_DEB: "trixie"
|
||||
<<: *debian_script_steps
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_armhf_deb_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- openrgb*.deb
|
||||
exclude:
|
||||
- openrgb-dbgsym*.deb
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Bookworm arm64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux arm64 .deb (Debian Bookworm)":
|
||||
variables:
|
||||
TGT_ARCH: "arm64"
|
||||
TGT_DEB: "bookworm"
|
||||
<<: *debian_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-arm64
|
||||
tags:
|
||||
- linux
|
||||
- arm64
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-package-files.sh debian/changelog
|
||||
- dpkg-architecture -l
|
||||
- dpkg-buildpackage -us -B
|
||||
- rm -v ../openrgb-dbgsym*.deb
|
||||
- mv -v ../openrgb*.deb ./
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.deb) Debian Trixie arm64 Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
"Linux arm64 .deb (Debian Trixie)":
|
||||
variables:
|
||||
TGT_ARCH: "arm64"
|
||||
TGT_DEB: "trixie"
|
||||
<<: *debian_script_steps
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_arm64_deb_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- openrgb*.deb
|
||||
exclude:
|
||||
- openrgb-dbgsym*.deb
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (.rpm, F40) 64-bit Build Target #
|
||||
@@ -398,7 +492,6 @@ before_script:
|
||||
- .shared_windows_runners
|
||||
stage: build
|
||||
script:
|
||||
- Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
- scripts\build-windows.bat 5.15.0 2019 32
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Windows_32_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -419,7 +512,6 @@ before_script:
|
||||
- .shared_windows_runners
|
||||
stage: build
|
||||
script:
|
||||
- Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
- scripts\build-windows.bat 6.8.3 2022 32
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Windows_32_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -440,7 +532,6 @@ before_script:
|
||||
- .shared_windows_runners
|
||||
stage: build
|
||||
script:
|
||||
- Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
- scripts\build-windows.bat 5.15.0 2019 64
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Windows_64_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -480,7 +571,6 @@ before_script:
|
||||
- .shared_windows_runners
|
||||
stage: build
|
||||
script:
|
||||
- Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
- scripts\build-windows.bat 6.8.3 2022 64
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Windows_64_Qt6_${CI_COMMIT_SHORT_SHA}"
|
||||
|
||||
@@ -23,7 +23,7 @@ Please add a link to the manufacturer's product page beneath this line
|
||||
~"DeviceType::IDK" <!-- I Don't know -->
|
||||
~"DeviceType::USB" <!-- The device connects to an internal header or external usb port -->
|
||||
~"DeviceType::GPU::AMD" <!-- The device is an AMD GPU -->
|
||||
~"DeviceType::GPU::NVidia" <!-- The device is a Nvidia GPU -->
|
||||
~"DeviceType::GPU::Nvidia" <!-- The device is a Nvidia GPU -->
|
||||
~"DeviceType::SMBus" <!-- The device is connected to the SMBus eg. RAM -->
|
||||
~"DeviceType::WMI" <!-- The device is controlled through Windows Management Instrumentation -->
|
||||
|
||||
|
||||
@@ -26,21 +26,21 @@ bool AutoStart::DisableAutoStart()
|
||||
std::error_code autostart_file_remove_errcode;
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*---------------------------------------------*/
|
||||
if(!filesystem::exists(autostart_file))
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
success = filesystem::remove(autostart_file, autostart_file_remove_errcode);
|
||||
@@ -63,26 +63,27 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
std::ofstream autostart_file_stream(autostart_file, std::ios::out | std::ios::trunc);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*---------------------------------------------*/
|
||||
if(!autostart_file_stream)
|
||||
{
|
||||
LOG_ERROR("[AutoStart] Could not open %s for writing.", autostart_file.c_str());
|
||||
success = false;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
//autostart_file_stream << desktop_file;
|
||||
autostart_file_stream.close();
|
||||
success = !autostart_file_stream.fail();
|
||||
|
||||
@@ -102,9 +103,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
|
||||
bool AutoStart::IsAutoStartEnabled()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
return(filesystem::exists(autostart_file));
|
||||
@@ -117,9 +118,9 @@ bool AutoStart::IsAutoStartEnabled()
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-------------------------------------------------*/
|
||||
char exepath[ PATH_MAX ];
|
||||
|
||||
ssize_t count = readlink("/proc/self/exe", exepath, PATH_MAX);
|
||||
@@ -133,16 +134,16 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
|
||||
autostart_name = name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get home and config paths |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Get home and config paths |
|
||||
\*-------------------------------------------------*/
|
||||
const char *xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||
const char *home = getenv("HOME");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-------------------------------------------------*/
|
||||
if(xdg_config_home != NULL)
|
||||
{
|
||||
autostart_dir = xdg_config_home;
|
||||
@@ -154,9 +155,9 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
autostart_dir = autostart_dir + "/.config/autostart/";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_dir != "")
|
||||
{
|
||||
std::error_code ec;
|
||||
|
||||
@@ -26,21 +26,21 @@ bool AutoStart::DisableAutoStart()
|
||||
std::error_code autostart_file_remove_errcode;
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*---------------------------------------------*/
|
||||
if(!filesystem::exists(autostart_file))
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
success = filesystem::remove(autostart_file, autostart_file_remove_errcode);
|
||||
@@ -63,25 +63,25 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
std::string desktop_file = GenerateDesktopFile(autostart_info);
|
||||
std::ofstream autostart_file_stream(autostart_file, std::ios::out | std::ios::trunc);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*---------------------------------------------*/
|
||||
if(!autostart_file_stream)
|
||||
{
|
||||
LOG_ERROR("[AutoStart] Could not open %s for writing.", autostart_file.c_str());
|
||||
success = false;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
autostart_file_stream << desktop_file;
|
||||
@@ -104,9 +104,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
|
||||
bool AutoStart::IsAutoStartEnabled()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
return(filesystem::exists(autostart_file));
|
||||
@@ -119,9 +119,9 @@ bool AutoStart::IsAutoStartEnabled()
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-------------------------------------------------*/
|
||||
char exepath[ PATH_MAX ];
|
||||
|
||||
ssize_t count = readlink("/proc/self/exe", exepath, PATH_MAX);
|
||||
@@ -129,17 +129,17 @@ std::string AutoStart::GetExePath()
|
||||
return(std::string(exepath, (count > 0) ? count : 0));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Linux AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Linux AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*-----------------------------------------------------*/
|
||||
|
||||
std::string AutoStart::GenerateDesktopFile(AutoStartInfo autostart_info)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Generate a .desktop file from the AutoStart |
|
||||
| parameters |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Generate a .desktop file from the AutoStart |
|
||||
| parameters |
|
||||
\*-------------------------------------------------*/
|
||||
std::stringstream fileContents;
|
||||
|
||||
fileContents << "[Desktop Entry]" << std::endl;
|
||||
@@ -151,9 +151,9 @@ std::string AutoStart::GenerateDesktopFile(AutoStartInfo autostart_info)
|
||||
fileContents << "Terminal=false" << std::endl;
|
||||
fileContents << "Type=Application" << std::endl;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the executable path and arguments |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Add the executable path and arguments |
|
||||
\*-------------------------------------------------*/
|
||||
fileContents << "Exec=" << autostart_info.path;
|
||||
|
||||
if (autostart_info.args != "")
|
||||
@@ -172,16 +172,16 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
|
||||
autostart_name = name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get home and config paths |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Get home and config paths |
|
||||
\*-------------------------------------------------*/
|
||||
const char *xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||
const char *home = getenv("HOME");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-------------------------------------------------*/
|
||||
if(xdg_config_home != NULL)
|
||||
{
|
||||
autostart_dir = xdg_config_home;
|
||||
@@ -193,9 +193,9 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
autostart_dir = autostart_dir + "/.config/autostart/";
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_dir != "")
|
||||
{
|
||||
std::error_code ec;
|
||||
|
||||
@@ -26,21 +26,21 @@ bool AutoStart::DisableAutoStart()
|
||||
std::error_code autostart_file_remove_errcode;
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*---------------------------------------------*/
|
||||
if(!filesystem::exists(autostart_file))
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
success = filesystem::remove(autostart_file, autostart_file_remove_errcode);
|
||||
@@ -63,25 +63,25 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
std::string desktop_file = GenerateLaunchAgentFile(autostart_info);
|
||||
std::ofstream autostart_file_stream(autostart_file, std::ios::out | std::ios::trunc);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Error out if the file could not be opened |
|
||||
\*---------------------------------------------*/
|
||||
if(!autostart_file_stream)
|
||||
{
|
||||
LOG_ERROR("[AutoStart] Could not open %s for writing.", autostart_file.c_str());
|
||||
success = false;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, write the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
autostart_file_stream << desktop_file;
|
||||
@@ -104,9 +104,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
|
||||
bool AutoStart::IsAutoStartEnabled()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
return(filesystem::exists(autostart_file));
|
||||
@@ -119,9 +119,9 @@ bool AutoStart::IsAutoStartEnabled()
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-------------------------------------------------*/
|
||||
char exepath[ PATH_MAX ];
|
||||
uint32_t exesize = PATH_MAX;
|
||||
|
||||
@@ -132,17 +132,17 @@ std::string AutoStart::GetExePath()
|
||||
return("");
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| MacOS AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| MacOS AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*-----------------------------------------------------*/
|
||||
|
||||
std::string AutoStart::GenerateLaunchAgentFile(AutoStartInfo autostart_info)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Generate a .plist file from the AutoStart |
|
||||
| parameters |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Generate a .plist file from the AutoStart |
|
||||
| parameters |
|
||||
\*-------------------------------------------------*/
|
||||
std::stringstream fileContents;
|
||||
|
||||
fileContents << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
|
||||
@@ -180,16 +180,16 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
|
||||
autostart_name = name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Determine where the autostart .desktop files are |
|
||||
| kept |
|
||||
\*-------------------------------------------------*/
|
||||
autostart_dir = getenv("HOME");
|
||||
autostart_dir = autostart_dir + "/Library/LaunchAgents/";
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_dir != "")
|
||||
{
|
||||
std::error_code ec;
|
||||
|
||||
@@ -25,21 +25,21 @@ bool AutoStart::DisableAutoStart()
|
||||
std::error_code autostart_file_remove_errcode;
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If file doesn't exist, disable is successful |
|
||||
\*---------------------------------------------*/
|
||||
if(!filesystem::exists(autostart_file))
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Otherwise, delete the file |
|
||||
\*---------------------------------------------*/
|
||||
else
|
||||
{
|
||||
success = filesystem::remove(autostart_file, autostart_file_remove_errcode);
|
||||
@@ -62,9 +62,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
bool weInitialised = false;
|
||||
@@ -79,9 +79,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
|
||||
result = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLinkW, (void**)&shellLink);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If not initialized, initialize |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If not initialized, initialize |
|
||||
\*---------------------------------------------*/
|
||||
if(result == CO_E_NOTINITIALIZED)
|
||||
{
|
||||
weInitialised = true;
|
||||
@@ -89,10 +89,10 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
result = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLinkW, (void**)&shellLink);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If successfully initialized, save a shortcut |
|
||||
| from the AutoStart parameters |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| If successfully initialized, save a shortcut |
|
||||
| from the AutoStart parameters |
|
||||
\*---------------------------------------------*/
|
||||
if(SUCCEEDED(result))
|
||||
{
|
||||
shellLink->SetPath(exepathw.c_str());
|
||||
@@ -114,9 +114,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
shellLink->Release();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Uninitialize when done |
|
||||
\*-------------------------------------------------*/
|
||||
/*---------------------------------------------*\
|
||||
| Uninitialize when done |
|
||||
\*---------------------------------------------*/
|
||||
if(weInitialised)
|
||||
{
|
||||
CoUninitialize();
|
||||
@@ -132,9 +132,9 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
|
||||
bool AutoStart::IsAutoStartEnabled()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Check if the filename is valid |
|
||||
\*-------------------------------------------------*/
|
||||
if(autostart_file != "")
|
||||
{
|
||||
return(filesystem::exists(autostart_file));
|
||||
@@ -147,9 +147,9 @@ bool AutoStart::IsAutoStartEnabled()
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-------------------------------------------------*/
|
||||
char exepath[MAX_PATH] = "";
|
||||
|
||||
DWORD count = GetModuleFileNameA(NULL, exepath, MAX_PATH);
|
||||
@@ -157,10 +157,10 @@ std::string AutoStart::GetExePath()
|
||||
return(std::string(exepath, (count > 0) ? count : 0));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Windows AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Windows AutoStart Implementation |
|
||||
| Private Methods |
|
||||
\*-----------------------------------------------------*/
|
||||
|
||||
void AutoStart::InitAutoStart(std::string name)
|
||||
{
|
||||
@@ -168,9 +168,9 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
|
||||
autostart_name = name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get startup applications path |
|
||||
\*-----------------------------------------------------*/
|
||||
/*-------------------------------------------------*\
|
||||
| Get startup applications path |
|
||||
\*-------------------------------------------------*/
|
||||
HRESULT result = SHGetFolderPathA(NULL, CSIDL_PROGRAMS, NULL, 0, startMenuPath);
|
||||
|
||||
if(SUCCEEDED(result))
|
||||
@@ -185,10 +185,10 @@ void AutoStart::InitAutoStart(std::string name)
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Convert an UTF8 string to a wide Unicode String |
|
||||
| (from wmi.cpp) |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Convert an UTF8 string to a wide Unicode String |
|
||||
| (from wmi.cpp) |
|
||||
\*-----------------------------------------------------*/
|
||||
std::wstring AutoStart::utf8_decode(const std::string& str)
|
||||
{
|
||||
if(str.empty())
|
||||
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
#-----------------------------------------------------------#
|
||||
# CMakeLists.txt #
|
||||
# #
|
||||
# CMake configuration for building OpenRGB #
|
||||
# #
|
||||
# Adam Honse (CalcProgrammer1) 24 May 2025 #
|
||||
# #
|
||||
# This file is part of the OpenRGB project #
|
||||
# SPDX-License-Identifier: GPL-2.0-only #
|
||||
#-----------------------------------------------------------#
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Project Definition #
|
||||
#-----------------------------------------------------------#
|
||||
project(OpenRGB LANGUAGES CXX)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Executable #
|
||||
#-----------------------------------------------------------#
|
||||
add_executable(OpenRGB)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# CMake Configuration #
|
||||
#-----------------------------------------------------------#
|
||||
set(CMAKE_CXX_STANDARD 17 )
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON )
|
||||
set(CMAKE_AUTOMOC ON )
|
||||
set(CMAKE_AUTORCC ON )
|
||||
set(CMAKE_AUTOUIC ON )
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON )
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Qt Configuration #
|
||||
#-----------------------------------------------------------#
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
||||
qt_standard_project_setup()
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Version #
|
||||
#-----------------------------------------------------------#
|
||||
set(MAJOR "0" )
|
||||
set(MINOR "9" )
|
||||
set(SUFFIX "git" )
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Git Information #
|
||||
#-----------------------------------------------------------#
|
||||
set(LASTTAG "release_${MAJOR}.${MINOR}" )
|
||||
|
||||
execute_process(COMMAND git rev-parse --short=7 HEAD
|
||||
OUTPUT_VARIABLE SHORTHASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND git rev-list --count ${LASTTAG}..HEAD
|
||||
OUTPUT_VARIABLE COMMITS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND sh ${CMAKE_SOURCE_DIR}/scripts/git-get-branch.sh
|
||||
OUTPUT_VARIABLE GITBRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Version Strings #
|
||||
#-----------------------------------------------------------#
|
||||
set(VERSION_NUM "${MAJOR}.${MINOR}.${COMMITS}" )
|
||||
set(VERSION_STR "${MAJOR}.${MINOR}" )
|
||||
|
||||
set(VERSION_DEB ${VERSION_NUM} )
|
||||
set(VERSION_WIX ${VERSION_NUM} )
|
||||
set(VERSION_AUR ${VERSION_NUM} )
|
||||
set(VERSION_RPM ${VERSION_NUM} )
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# If suffix is "git", use package-specific git versioning #
|
||||
# Otherwise, append suffix if it is not empty #
|
||||
#-----------------------------------------------------------#
|
||||
if("${SUFFIX}" STREQUAL "git")
|
||||
set(VERSION_STR "${VERSION_STR}+ (${SUFFIX}${COMMITS})" )
|
||||
set(VERSION_DEB "${VERSION_DEB}~git${SHORTHASH}" )
|
||||
set(VERSION_AUR "${VERSION_AUR}.g${SHORTHASH}" )
|
||||
set(VERSION_RPM "${VERSION_RPM}^git${SHORTHASH}" )
|
||||
elseif(NOT "${SUFFIX}" STREQUAL "")
|
||||
set(VERSION_STR "${VERSION_STR}+ (${SUFFIX})" )
|
||||
set(VERSION_DEB "${VERSION_DEB}~${SUFFIX}" )
|
||||
set(VERSION_AUR "${VERSION_AUR}.${SUFFIX}" )
|
||||
set(VERSION_RPM "${VERSION_RPM}^${SUFFIX}" )
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Print build configuration information #
|
||||
#-----------------------------------------------------------#
|
||||
message(STATUS "OpenRGB ${VERSION_STR} CMake Build" )
|
||||
message(STATUS "-------------------------------------------")
|
||||
message(STATUS " Last release tag: ${LASTTAG}" )
|
||||
message(STATUS " Shorthash: ${SHORTHASH}" )
|
||||
message(STATUS " Commits since release: ${COMMITS}" )
|
||||
message(STATUS " Git branch: ${GITBRANCH}" )
|
||||
message(STATUS " Version: Main: ${VERSION_STR}" )
|
||||
message(STATUS " Windows: ${VERSION_WIX}" )
|
||||
message(STATUS " Debian: ${VERSION_DEB}" )
|
||||
message(STATUS " Arch (AUR): ${VERSION_AUR}" )
|
||||
message(STATUS " Fedora: ${VERSION_RPM}" )
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Build list of controller headers, include directories, #
|
||||
# and source files #
|
||||
#-----------------------------------------------------------#
|
||||
file(GLOB_RECURSE children LIST_DIRECTORIES true
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*" )
|
||||
|
||||
foreach(child ${children})
|
||||
if(IS_DIRECTORY ${curdir}/${child})
|
||||
list(APPEND CONTROLLER_INC ${child})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE CONTROLLER_H
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*.h" )
|
||||
|
||||
file(GLOB_RECURSE CONTROLLER_CPP
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*.cpp" )
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Remove OS-specific files from the overall controller #
|
||||
# headers and sources lists. The suffixes _Windows, _Linux,#
|
||||
# _FreeBSD, and _MacOS are usable to denote that a file #
|
||||
# only applies to one or more OSes. The suffixes may be #
|
||||
# combined such as <file>_Windows_Linux.cpp. #
|
||||
#-----------------------------------------------------------#
|
||||
file(GLOB_RECURSE CONTROLLER_H_WINDOWS
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_Windows*.h" )
|
||||
file(GLOB_RECURSE CONTROLLER_CPP_WINDOWS
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_Windows*.cpp" )
|
||||
file(GLOB_RECURSE CONTROLLER_H_LINUX
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_Linux*.h" )
|
||||
file(GLOB_RECURSE CONTROLLER_CPP_LINUX
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_Linux*.cpp" )
|
||||
file(GLOB_RECURSE CONTROLLER_H_MACOS
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_MacOS*.h" )
|
||||
file(GLOB_RECURSE CONTROLLER_CPP_MACOS
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_MacOS*.cpp" )
|
||||
file(GLOB_RECURSE CONTROLLER_H_FREEBSD
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_FreeBSD*.h" )
|
||||
file(GLOB_RECURSE CONTROLLER_CPP_FREEBSD
|
||||
"${CMAKE_SOURCE_DIR}/Controllers/*_FreeBSD*.cpp" )
|
||||
|
||||
list(REMOVE_ITEM CONTROLLER_H ${CONTROLLER_H_WINDOWS} )
|
||||
list(REMOVE_ITEM CONTROLLER_CPP ${CONTROLLER_CPP_WINDOWS} )
|
||||
list(REMOVE_ITEM CONTROLLER_H ${CONTROLLER_H_LINUX} )
|
||||
list(REMOVE_ITEM CONTROLLER_CPP ${CONTROLLER_CPP_LINUX} )
|
||||
list(REMOVE_ITEM CONTROLLER_H ${CONTROLLER_H_MACOS} )
|
||||
list(REMOVE_ITEM CONTROLLER_CPP ${CONTROLLER_CPP_MACOS} )
|
||||
list(REMOVE_ITEM CONTROLLER_H ${CONTROLLER_H_FREEBSD} )
|
||||
list(REMOVE_ITEM CONTROLLER_CPP ${CONTROLLER_CPP_FREEBSD} )
|
||||
|
||||
target_sources(OpenRGB PRIVATE ${CONTROLLER_CPP} )
|
||||
target_include_directories(OpenRGB PRIVATE ${CONTROLLER_INC})
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/AutoStart)
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/dmiinfo)
|
||||
target_sources(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/dmiinfo/dmiinfo.cpp)
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/hidapi_wrapper)
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/i2c_smbus)
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/i2c_tools)
|
||||
target_sources(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/i2c_tools/i2c_tools.cpp)
|
||||
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/interop)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/KeyboardLayoutManager)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/net_port)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/pci_ids)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/qt)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/RGBController)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/scsiapi)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/serial_port)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/SPDAccessor)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/super_io)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/SuspendResume)
|
||||
target_include_directories(OpenRGB PRIVATE ${CMAKE_SOURCE_DIR}/wmi)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# CRCpp #
|
||||
#-----------------------------------------------------------#
|
||||
set(CRCPP_DIR ${CMAKE_SOURCE_DIR}/dependencies/CRCpp)
|
||||
|
||||
add_library(CRCpp INTERFACE)
|
||||
target_include_directories(CRCpp INTERFACE ${CRCPP_DIR}/)
|
||||
|
||||
target_link_libraries(OpenRGB CRCpp)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# hidapi #
|
||||
#-----------------------------------------------------------#
|
||||
find_package(hidapi REQUIRED)
|
||||
target_link_libraries(OpenRGB hidapi::hidapi)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# httplib #
|
||||
#-----------------------------------------------------------#
|
||||
set(HTTPLIB_DIR ${CMAKE_SOURCE_DIR}/dependencies/httplib)
|
||||
|
||||
add_library(httplib INTERFACE)
|
||||
target_include_directories(httplib INTERFACE ${HTTPLIB_DIR}/)
|
||||
|
||||
target_link_libraries(OpenRGB httplib)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# libe131 #
|
||||
#-----------------------------------------------------------#
|
||||
set(LIBE131_DIR ${CMAKE_SOURCE_DIR}/dependencies/libe131)
|
||||
|
||||
add_library(libe131 STATIC)
|
||||
target_include_directories(libe131 PUBLIC ${LIBE131_DIR}/src)
|
||||
target_sources(libe131 PRIVATE ${LIBE131_DIR}/src/e131.c)
|
||||
|
||||
target_link_libraries(OpenRGB libe131)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# libusb #
|
||||
#-----------------------------------------------------------#
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libusb-1.0 REQUIRED IMPORTED_TARGET GLOBAL libusb-1.0)
|
||||
|
||||
target_link_libraries(OpenRGB PkgConfig::libusb-1.0)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# hueplusplus #
|
||||
#-----------------------------------------------------------#
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/dependencies/hueplusplus-1.2.0)
|
||||
target_link_libraries(OpenRGB hueplusplusstatic)
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# nlohmann_json #
|
||||
#-----------------------------------------------------------#
|
||||
find_package(nlohmann_json REQUIRED)
|
||||
target_link_libraries(OpenRGB nlohmann_json)
|
||||
@@ -67,8 +67,3 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
|
||||
| This is a comment |
|
||||
\*_-------------------------------*/
|
||||
```
|
||||
|
||||
## Translating
|
||||
|
||||
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
|
||||
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
|
||||
|
||||
@@ -33,8 +33,9 @@ void DetectA4TechMouseControllers(hid_device_info* info, const std::string& name
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id);
|
||||
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
@@ -46,8 +47,9 @@ void DetectBloodyB820R(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path);
|
||||
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
@@ -20,11 +20,10 @@
|
||||
| the second packet. |
|
||||
\*-------------------------------------------------------------------------------------*/
|
||||
|
||||
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
BloodyB820RController::BloodyB820RController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendControlPacket(BLOODY_B820R_GAIN_CONTROL);
|
||||
}
|
||||
@@ -53,11 +52,6 @@ std::string BloodyB820RController::GetLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string BloodyB820RController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void BloodyB820RController::SendControlPacket(uint8_t data)
|
||||
{
|
||||
uint8_t buffer[BLOODY_B820R_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
@@ -39,17 +39,15 @@ enum
|
||||
class BloodyB820RController
|
||||
{
|
||||
public:
|
||||
BloodyB820RController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
BloodyB820RController(hid_device* dev_handle, const char* path);
|
||||
~BloodyB820RController();
|
||||
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
|
||||
void SetLEDDirect(std::vector<RGBColor> colors);
|
||||
void SendControlPacket(uint8_t data);
|
||||
private:
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ RGBController_BloodyB820R::RGBController_BloodyB820R(BloodyB820RController *cont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "Bloody B820R";
|
||||
vendor = "A4Tech";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "A4Tech Bloody Keyboard";
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
#include "BloodyMouseController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
BloodyMouseController::BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id, std::string dev_name)
|
||||
BloodyMouseController::BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
pid = product_id;
|
||||
name = dev_name;
|
||||
|
||||
InitDevice();
|
||||
}
|
||||
@@ -50,11 +49,6 @@ std::string BloodyMouseController::GetLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string BloodyMouseController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void BloodyMouseController::InitDevice()
|
||||
{
|
||||
uint8_t buffer[BLOODYMOUSE_WRITE_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
@@ -50,20 +50,18 @@ enum
|
||||
class BloodyMouseController
|
||||
{
|
||||
public:
|
||||
BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id, std::string dev_name);
|
||||
BloodyMouseController(hid_device* dev_handle, const char* path, uint16_t product_id);
|
||||
~BloodyMouseController();
|
||||
|
||||
uint16_t GetPid();
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
|
||||
void SetLedsDirect(std::vector<RGBColor> colors);
|
||||
|
||||
private:
|
||||
uint16_t pid;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
|
||||
void InitDevice();
|
||||
|
||||
@@ -71,7 +71,6 @@ RGBController_BloodyMouse::RGBController_BloodyMouse(BloodyMouseController *cont
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
}
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "Bloody";
|
||||
description = "Controller compatible with the Bloody W60 Pro and MP 50RS";
|
||||
serial = controller->GetSerial();
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AMBXController.cpp |
|
||||
| |
|
||||
| Driver for Philips amBX Gaming lights |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "AMBXController.h"
|
||||
#include "LogManager.h"
|
||||
#include "StringUtils.h"
|
||||
#include <cstring>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
AMBXController::AMBXController(const char* path)
|
||||
{
|
||||
initialized = false;
|
||||
usb_context = nullptr;
|
||||
dev_handle = nullptr;
|
||||
|
||||
location = "USB: ";
|
||||
location += path;
|
||||
|
||||
// Initialize libusb in this instance
|
||||
if(libusb_init(&usb_context) < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the device list
|
||||
libusb_device** device_list;
|
||||
ssize_t device_count = libusb_get_device_list(usb_context, &device_list);
|
||||
|
||||
if(device_count < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(ssize_t i = 0; i < device_count; i++)
|
||||
{
|
||||
libusb_device* device = device_list[i];
|
||||
struct libusb_device_descriptor desc;
|
||||
|
||||
if(libusb_get_device_descriptor(device, &desc) != LIBUSB_SUCCESS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(desc.idVendor == AMBX_VID && desc.idProduct == AMBX_PID)
|
||||
{
|
||||
uint8_t bus = libusb_get_bus_number(device);
|
||||
uint8_t address = libusb_get_device_address(device);
|
||||
|
||||
char current_path[32];
|
||||
snprintf(current_path, sizeof(current_path), "%d-%d", bus, address);
|
||||
|
||||
if(strcmp(path, current_path) == 0)
|
||||
{
|
||||
// Try to open this device
|
||||
if(libusb_open(device, &dev_handle) != LIBUSB_SUCCESS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Try to detach the kernel driver if attached
|
||||
if(libusb_kernel_driver_active(dev_handle, 0))
|
||||
{
|
||||
libusb_detach_kernel_driver(dev_handle, 0);
|
||||
}
|
||||
|
||||
// Set auto-detach for Windows compatibility
|
||||
libusb_set_auto_detach_kernel_driver(dev_handle, 1);
|
||||
|
||||
// Claim the interface
|
||||
if(libusb_claim_interface(dev_handle, 0) != LIBUSB_SUCCESS)
|
||||
{
|
||||
libusb_close(dev_handle);
|
||||
dev_handle = nullptr;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get string descriptor for serial number if available
|
||||
if(desc.iSerialNumber != 0)
|
||||
{
|
||||
unsigned char serial_str[256];
|
||||
int serial_result = libusb_get_string_descriptor_ascii(dev_handle, desc.iSerialNumber,
|
||||
serial_str, sizeof(serial_str));
|
||||
if(serial_result > 0)
|
||||
{
|
||||
serial = std::string(reinterpret_cast<char*>(serial_str), serial_result);
|
||||
}
|
||||
}
|
||||
|
||||
// Successfully opened and claimed the device
|
||||
initialized = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
libusb_free_device_list(device_list, 1);
|
||||
}
|
||||
|
||||
AMBXController::~AMBXController()
|
||||
{
|
||||
if(initialized)
|
||||
{
|
||||
// Turn off all lights before closing
|
||||
unsigned int led_ids[5] =
|
||||
{
|
||||
AMBX_LIGHT_LEFT,
|
||||
AMBX_LIGHT_RIGHT,
|
||||
AMBX_LIGHT_WALL_LEFT,
|
||||
AMBX_LIGHT_WALL_CENTER,
|
||||
AMBX_LIGHT_WALL_RIGHT
|
||||
};
|
||||
|
||||
RGBColor colors[5] = { 0, 0, 0, 0, 0 };
|
||||
SetLEDColors(led_ids, colors, 5);
|
||||
}
|
||||
|
||||
if(dev_handle != nullptr)
|
||||
{
|
||||
// Release the interface
|
||||
libusb_release_interface(dev_handle, 0);
|
||||
|
||||
// Close the device
|
||||
libusb_close(dev_handle);
|
||||
dev_handle = nullptr;
|
||||
}
|
||||
|
||||
if(usb_context != nullptr)
|
||||
{
|
||||
libusb_exit(usb_context);
|
||||
usb_context = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::string AMBXController::GetDeviceLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
std::string AMBXController::GetSerialString()
|
||||
{
|
||||
return serial;
|
||||
}
|
||||
|
||||
bool AMBXController::IsInitialized()
|
||||
{
|
||||
return initialized;
|
||||
}
|
||||
|
||||
void AMBXController::SendPacket(unsigned char* packet, unsigned int size)
|
||||
{
|
||||
if(!initialized || dev_handle == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int actual_length = 0;
|
||||
libusb_interrupt_transfer(dev_handle, AMBX_ENDPOINT_OUT, packet, size, &actual_length, 100);
|
||||
}
|
||||
|
||||
void AMBXController::SetLEDColor(unsigned int led, RGBColor color)
|
||||
{
|
||||
if(!initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char color_buf[6] =
|
||||
{
|
||||
AMBX_PACKET_HEADER,
|
||||
static_cast<unsigned char>(led),
|
||||
AMBX_SET_COLOR,
|
||||
(unsigned char)RGBGetRValue(color),
|
||||
(unsigned char)RGBGetGValue(color),
|
||||
(unsigned char)RGBGetBValue(color)
|
||||
};
|
||||
|
||||
SendPacket(color_buf, 6);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2));
|
||||
}
|
||||
|
||||
void AMBXController::SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count)
|
||||
{
|
||||
for(unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
SetLEDColor(leds[i], colors[i]);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AMBXController.h |
|
||||
| |
|
||||
| Driver for Philips amBX Gaming lights |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "dependencies/libusb-1.0.27/include/libusb.h"
|
||||
#else
|
||||
#include <libusb.h>
|
||||
#endif
|
||||
|
||||
#define AMBX_VID 0x0471
|
||||
#define AMBX_PID 0x083F
|
||||
#define AMBX_ENDPOINT_OUT 0x02
|
||||
#define AMBX_PACKET_HEADER 0xA1
|
||||
#define AMBX_SET_COLOR 0x03
|
||||
|
||||
enum
|
||||
{
|
||||
AMBX_LIGHT_LEFT = 0x0B,
|
||||
AMBX_LIGHT_RIGHT = 0x1B,
|
||||
AMBX_LIGHT_WALL_LEFT = 0x2B,
|
||||
AMBX_LIGHT_WALL_CENTER = 0x3B,
|
||||
AMBX_LIGHT_WALL_RIGHT = 0x4B
|
||||
};
|
||||
|
||||
class AMBXController
|
||||
{
|
||||
public:
|
||||
AMBXController(const char* path);
|
||||
~AMBXController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetSerialString();
|
||||
|
||||
bool IsInitialized();
|
||||
void SetLEDColor(unsigned int led, RGBColor color);
|
||||
void SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count);
|
||||
|
||||
private:
|
||||
libusb_context* usb_context;
|
||||
libusb_device_handle* dev_handle;
|
||||
std::string location;
|
||||
std::string serial;
|
||||
bool initialized;
|
||||
|
||||
void SendPacket(unsigned char* packet, unsigned int size);
|
||||
};
|
||||
@@ -1,83 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AMBXControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Philips amBX Gaming lights |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "Detector.h"
|
||||
#include "AMBXController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AMBX.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "dependencies/libusb-1.0.27/include/libusb.h"
|
||||
#else
|
||||
#include <libusb.h>
|
||||
#endif
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAMBXControllers *
|
||||
* *
|
||||
* Detect Philips amBX Gaming devices *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectAMBXControllers()
|
||||
{
|
||||
libusb_context* ctx = NULL;
|
||||
|
||||
if(libusb_init(&ctx) < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
libusb_device** devs;
|
||||
ssize_t num_devs = libusb_get_device_list(ctx, &devs);
|
||||
|
||||
if(num_devs <= 0)
|
||||
{
|
||||
libusb_exit(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
for(ssize_t i = 0; i < num_devs; i++)
|
||||
{
|
||||
libusb_device* dev = devs[i];
|
||||
libusb_device_descriptor desc;
|
||||
|
||||
if(libusb_get_device_descriptor(dev, &desc) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(desc.idVendor == AMBX_VID && desc.idProduct == AMBX_PID)
|
||||
{
|
||||
uint8_t bus = libusb_get_bus_number(dev);
|
||||
uint8_t address = libusb_get_device_address(dev);
|
||||
char device_path[32];
|
||||
snprintf(device_path, sizeof(device_path), "%d-%d", bus, address);
|
||||
|
||||
// Use the AMBXController to handle opening and initializing
|
||||
AMBXController* controller = new AMBXController(device_path);
|
||||
|
||||
if(controller->IsInitialized())
|
||||
{
|
||||
RGBController_AMBX* rgb_controller = new RGBController_AMBX(controller);
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
libusb_free_device_list(devs, 1);
|
||||
libusb_exit(ctx);
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Philips amBX", DetectAMBXControllers);
|
||||
@@ -1,179 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AMBX.cpp |
|
||||
| |
|
||||
| RGB Controller for Philips amBX Gaming lights |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_AMBX.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Philips amBX
|
||||
@category Accessory
|
||||
@type USB
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectAMBXControllers
|
||||
@comment The Philips amBX Gaming lights system includes left and right
|
||||
lights and a wall-washer bar with three zones.
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_AMBX::RGBController_AMBX(AMBXController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Philips amBX";
|
||||
vendor = "Philips";
|
||||
type = DEVICE_TYPE_ACCESSORY;
|
||||
description = "Philips amBX Gaming Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_AMBX::~RGBController_AMBX()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_AMBX::SetupZones()
|
||||
{
|
||||
// Set up zones
|
||||
zone side_lights_zone;
|
||||
side_lights_zone.name = "Side Lights";
|
||||
side_lights_zone.type = ZONE_TYPE_LINEAR;
|
||||
side_lights_zone.leds_min = 2;
|
||||
side_lights_zone.leds_max = 2;
|
||||
side_lights_zone.leds_count = 2;
|
||||
side_lights_zone.matrix_map = NULL;
|
||||
zones.push_back(side_lights_zone);
|
||||
|
||||
zone wallwasher_zone;
|
||||
wallwasher_zone.name = "Wallwasher";
|
||||
wallwasher_zone.type = ZONE_TYPE_LINEAR;
|
||||
wallwasher_zone.leds_min = 3;
|
||||
wallwasher_zone.leds_max = 3;
|
||||
wallwasher_zone.leds_count = 3;
|
||||
wallwasher_zone.matrix_map = NULL;
|
||||
zones.push_back(wallwasher_zone);
|
||||
|
||||
// Set up LEDs
|
||||
led left_light;
|
||||
left_light.name = "Left";
|
||||
left_light.value = AMBX_LIGHT_LEFT;
|
||||
leds.push_back(left_light);
|
||||
|
||||
led right_light;
|
||||
right_light.name = "Right";
|
||||
right_light.value = AMBX_LIGHT_RIGHT;
|
||||
leds.push_back(right_light);
|
||||
|
||||
led wall_left;
|
||||
wall_left.name = "Wall Left";
|
||||
wall_left.value = AMBX_LIGHT_WALL_LEFT;
|
||||
leds.push_back(wall_left);
|
||||
|
||||
led wall_center;
|
||||
wall_center.name = "Wall Center";
|
||||
wall_center.value = AMBX_LIGHT_WALL_CENTER;
|
||||
leds.push_back(wall_center);
|
||||
|
||||
led wall_right;
|
||||
wall_right.name = "Wall Right";
|
||||
wall_right.value = AMBX_LIGHT_WALL_RIGHT;
|
||||
leds.push_back(wall_right);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_AMBX::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
// This device does not support resizing zones
|
||||
}
|
||||
|
||||
void RGBController_AMBX::DeviceUpdateLEDs()
|
||||
{
|
||||
if(!controller->IsInitialized())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int led_values[5];
|
||||
RGBColor led_colors[5];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
led_values[led_idx] = leds[led_idx].value;
|
||||
led_colors[led_idx] = colors[led_idx];
|
||||
}
|
||||
|
||||
controller->SetLEDColors(led_values, led_colors, static_cast<unsigned int>(leds.size()));
|
||||
}
|
||||
|
||||
void RGBController_AMBX::UpdateZoneLEDs(int zone)
|
||||
{
|
||||
if(!controller->IsInitialized())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int start_idx = 0;
|
||||
unsigned int zone_size = 0;
|
||||
|
||||
// Calculate start index and size
|
||||
for(unsigned int z_idx = 0; z_idx < zones.size(); z_idx++)
|
||||
{
|
||||
if(z_idx == (unsigned int)zone)
|
||||
{
|
||||
zone_size = zones[z_idx].leds_count;
|
||||
break;
|
||||
}
|
||||
|
||||
start_idx += zones[z_idx].leds_count;
|
||||
}
|
||||
|
||||
unsigned int led_values[5];
|
||||
RGBColor led_colors[5];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < zone_size; led_idx++)
|
||||
{
|
||||
unsigned int current_idx = start_idx + led_idx;
|
||||
led_values[led_idx] = leds[current_idx].value;
|
||||
led_colors[led_idx] = colors[current_idx];
|
||||
}
|
||||
|
||||
controller->SetLEDColors(led_values, led_colors, zone_size);
|
||||
}
|
||||
|
||||
void RGBController_AMBX::UpdateSingleLED(int led)
|
||||
{
|
||||
if(!controller->IsInitialized())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int led_value = leds[led].value;
|
||||
RGBColor color = colors[led];
|
||||
controller->SetLEDColor(led_value, color);
|
||||
}
|
||||
|
||||
void RGBController_AMBX::DeviceUpdateMode()
|
||||
{
|
||||
if(!controller->IsInitialized())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AMBX.h |
|
||||
| |
|
||||
| RGB Controller for Philips amBX Gaming lights |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "AMBXController.h"
|
||||
|
||||
class RGBController_AMBX : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_AMBX(AMBXController* controller_ptr);
|
||||
~RGBController_AMBX();
|
||||
|
||||
void SetupZones();
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
AMBXController* controller;
|
||||
};
|
||||
@@ -35,12 +35,11 @@
|
||||
void DetectAMDWraithPrismControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
if( dev )
|
||||
{
|
||||
AMDWraithPrismController* controller = new AMDWraithPrismController(dev, info->path);
|
||||
RGBController_AMDWraithPrism* rgb_controller = new RGBController_AMDWraithPrism(controller);
|
||||
|
||||
// Constructor sets the name
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
AOCKeyboardController::AOCKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AOCKeyboardController::AOCKeyboardController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AOCKeyboardController::~AOCKeyboardController()
|
||||
@@ -34,11 +33,6 @@ std::string AOCKeyboardController::GetDeviceLocation()
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCKeyboardController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AOCKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -64,11 +64,10 @@ enum
|
||||
class AOCKeyboardController
|
||||
{
|
||||
public:
|
||||
AOCKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AOCKeyboardController(hid_device* dev_handle, const char* path);
|
||||
~AOCKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetLightingConfig
|
||||
@@ -89,7 +88,6 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void SendStartPacket();
|
||||
void SendEndPacket();
|
||||
|
||||
@@ -34,8 +34,9 @@ void DetectAOCKeyboardControllers(hid_device_info* info, const std::string& name
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AOCKeyboardController* controller = new AOCKeyboardController(dev, info->path, name);
|
||||
AOCKeyboardController* controller = new AOCKeyboardController(dev, info->path);
|
||||
RGBController_AOCKeyboard* rgb_controller = new RGBController_AOCKeyboard(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ RGBController_AOCKeyboard::RGBController_AOCKeyboard(AOCKeyboardController* cont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "AOC Keyboard Device";
|
||||
vendor = "AOC";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "AOC Keyboard Device";
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
#include "AOCMouseController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AOCMouseController::AOCMouseController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AOCMouseController::AOCMouseController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AOCMouseController::~AOCMouseController()
|
||||
@@ -30,11 +29,6 @@ std::string AOCMouseController::GetDeviceLocation()
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -56,11 +56,10 @@ enum
|
||||
class AOCMouseController
|
||||
{
|
||||
public:
|
||||
AOCMouseController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AOCMouseController(hid_device* dev_handle, const char* path);
|
||||
~AOCMouseController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendDirect
|
||||
@@ -80,5 +79,4 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,9 @@ void DetectAOCMouseControllers(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AOCMouseController* controller = new AOCMouseController(dev, info->path, name);
|
||||
AOCMouseController* controller = new AOCMouseController(dev, info->path);
|
||||
RGBController_AOCMouse* rgb_controller = new RGBController_AOCMouse(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ RGBController_AOCMouse::RGBController_AOCMouse(AOCMouseController* controller_pt
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "AOC Mouse Device";
|
||||
vendor = "AOC";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "AOC Mouse Device";
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
#include "AOCMousematController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AOCMousematController::AOCMousematController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AOCMousematController::AOCMousematController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AOCMousematController::~AOCMousematController()
|
||||
@@ -30,11 +29,6 @@ std::string AOCMousematController::GetDeviceLocation()
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCMousematController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AOCMousematController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -55,11 +55,10 @@ enum
|
||||
class AOCMousematController
|
||||
{
|
||||
public:
|
||||
AOCMousematController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AOCMousematController(hid_device* dev_handle, const char* path);
|
||||
~AOCMousematController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendDirect
|
||||
@@ -79,5 +78,4 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,9 @@ void DetectAOCMousematControllers(hid_device_info* info, const std::string& name
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AOCMousematController* controller = new AOCMousematController(dev, info->path, name);
|
||||
AOCMousematController* controller = new AOCMousematController(dev, info->path);
|
||||
RGBController_AOCMousemat* rgb_controller = new RGBController_AOCMousemat(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ RGBController_AOCMousemat::RGBController_AOCMousemat(AOCMousematController* cont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "AOC Mousemat Device";
|
||||
vendor = "AOC";
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
description = "AOC Mousemat Device";
|
||||
|
||||
+1
-7
@@ -14,11 +14,10 @@
|
||||
#include "AlienwareAW410KController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AlienwareAW410KController::AlienwareAW410KController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AlienwareAW410KController::AlienwareAW410KController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendCommit();
|
||||
}
|
||||
@@ -33,11 +32,6 @@ std::string AlienwareAW410KController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AlienwareAW410KController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AlienwareAW410KController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+1
-3
@@ -75,11 +75,10 @@ struct SelectedButtons
|
||||
class AlienwareAW410KController
|
||||
{
|
||||
public:
|
||||
AlienwareAW410KController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AlienwareAW410KController(hid_device* dev_handle, const char* path);
|
||||
~AlienwareAW410KController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendInitialize();
|
||||
@@ -141,7 +140,6 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void SendMode
|
||||
(
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ RGBController_AlienwareAW410K::RGBController_AlienwareAW410K(AlienwareAW410KCont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "Alienware AW410K Keyboard Device";
|
||||
vendor = "Alienware";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Alienware AW410K Keyboard Device";
|
||||
|
||||
+1
-7
@@ -13,11 +13,10 @@
|
||||
#include "AlienwareAW510KController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AlienwareAW510KController::AlienwareAW510KController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AlienwareAW510KController::AlienwareAW510KController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendCommit();
|
||||
}
|
||||
@@ -32,11 +31,6 @@ std::string AlienwareAW510KController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AlienwareAW510KController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AlienwareAW510KController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+1
-3
@@ -77,11 +77,10 @@ struct SelectedKeys
|
||||
class AlienwareAW510KController
|
||||
{
|
||||
public:
|
||||
AlienwareAW510KController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AlienwareAW510KController(hid_device* dev_handle, const char* path);
|
||||
~AlienwareAW510KController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendInitialize();
|
||||
@@ -143,7 +142,6 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void SendMode
|
||||
(
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ RGBController_AlienwareAW510K::RGBController_AlienwareAW510K(AlienwareAW510KCont
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "Alienware AW510K Keyboard Device";
|
||||
vendor = "Alienware";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Alienware AW510K Keyboard Device";
|
||||
|
||||
@@ -38,9 +38,9 @@ void DetectAlienwareAW510KControllers(hid_device_info* info, const std::string&
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if( dev )
|
||||
{
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path);
|
||||
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@ void DetectAlienwareAW410KControllers(hid_device_info* info, const std::string&
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if( dev )
|
||||
{
|
||||
AlienwareAW410KController* controller = new AlienwareAW410KController(dev, info->path, name);
|
||||
AlienwareAW410KController* controller = new AlienwareAW410KController(dev, info->path);
|
||||
RGBController_AlienwareAW410K* rgb_controller = new RGBController_AlienwareAW410K(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}/* DetectAlienwareKeyboardControllers() */
|
||||
|
||||
@@ -127,7 +127,7 @@ std::vector<unsigned char> AlienwareAW3423DWFController::GenerateKey(
|
||||
if(response.size() > 14)
|
||||
{
|
||||
unsigned char idx = response[14] & 0x07;
|
||||
if((idx + 8) < (unsigned char)response.size())
|
||||
if((idx + 8) < response.size())
|
||||
{
|
||||
out_buffer[idx] ^= response[idx + 8];
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
unsigned char endpoint_out = 0x02;
|
||||
unsigned char endpoint_in = 0x81;
|
||||
|
||||
static const std::vector<std::vector<unsigned char>> OEM_KEYS;
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
|
||||
#include "AlienwareMonitorController.h"
|
||||
|
||||
AlienwareMonitorController::AlienwareMonitorController(hid_device *dev_handle, const char *path, std::string dev_name)
|
||||
AlienwareMonitorController::AlienwareMonitorController(hid_device *dev_handle, const char *path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
@@ -34,11 +33,6 @@ std::string AlienwareMonitorController::GetLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AlienwareMonitorController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AlienwareMonitorController::GetSerialString()
|
||||
{
|
||||
return("");
|
||||
@@ -62,7 +56,6 @@ void AlienwareMonitorController::SendColor(unsigned char led_id, unsigned char r
|
||||
|
||||
memset(packet, 0xFF, sizeof(packet));
|
||||
|
||||
packet[0] = 0x00;
|
||||
packet[1] = 0x92;
|
||||
packet[2] = 0x37;
|
||||
packet[3] = 0x0a;
|
||||
@@ -94,7 +87,6 @@ void AlienwareMonitorController::Initialize()
|
||||
|
||||
memset(packet, 0xFF, sizeof(packet));
|
||||
|
||||
packet[0] = 0x00;
|
||||
packet[1] = 0x95;
|
||||
packet[2] = 0x00;
|
||||
packet[3] = 0x00;
|
||||
@@ -109,7 +101,6 @@ void AlienwareMonitorController::Initialize()
|
||||
|
||||
memset(packet, 0xFF, sizeof(packet));
|
||||
|
||||
packet[0] = 0x00;
|
||||
packet[1] = 0x92;
|
||||
packet[2] = 0x37;
|
||||
packet[3] = 0x08;
|
||||
@@ -132,7 +123,6 @@ void AlienwareMonitorController::Initialize()
|
||||
|
||||
memset(packet, 0x00, sizeof(packet));
|
||||
|
||||
packet[0] = 0x00;
|
||||
packet[1] = 0x93;
|
||||
packet[2] = 0x37;
|
||||
packet[3] = 0x12;
|
||||
|
||||
@@ -18,18 +18,16 @@
|
||||
class AlienwareMonitorController
|
||||
{
|
||||
public:
|
||||
AlienwareMonitorController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AlienwareMonitorController(hid_device* dev_handle, const char* path);
|
||||
~AlienwareMonitorController();
|
||||
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
void SendColor(unsigned char led_id, unsigned char r, unsigned char g, unsigned char b);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void Initialize();
|
||||
};
|
||||
|
||||
@@ -42,9 +42,8 @@ void DetectAlienwareAW3423DWFControllers(hid_device_info* info, const std::strin
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path);
|
||||
AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path);
|
||||
RGBController_AlienwareAW3423DWF* rgb_controller = new RGBController_AlienwareAW3423DWF(controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -55,8 +54,9 @@ void DetectAlienwareMonitorControllers(hid_device_info* info, const std::string&
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareMonitorController* controller = new AlienwareMonitorController(dev, info->path, name);
|
||||
AlienwareMonitorController* controller = new AlienwareMonitorController(dev, info->path);
|
||||
RGBController_AlienwareMonitor* rgb_controller = new RGBController_AlienwareMonitor(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ RGBController_AlienwareMonitor::RGBController_AlienwareMonitor(AlienwareMonitorC
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "Alienware Monitor";
|
||||
description = "Alienware Monitor";
|
||||
vendor = "Alienware";
|
||||
type = DEVICE_TYPE_MONITOR;
|
||||
|
||||
@@ -40,12 +40,11 @@
|
||||
void DetectAnnePro2Controllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
if( dev )
|
||||
{
|
||||
AnnePro2Controller* controller = new AnnePro2Controller(dev, info->path);
|
||||
RGBController_AnnePro2* rgb_controller = new RGBController_AnnePro2(controller);
|
||||
|
||||
// Constructor sets the name
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@ void ArcticController::SetChannels(std::vector<RGBColor> colors)
|
||||
{
|
||||
const unsigned int offset = ARCTIC_COMMAND_PAYLOAD_OFFSET + channel * 3;
|
||||
|
||||
buffer[offset + 0x00] = (char)std::min<unsigned int>(254, RGBGetRValue(colors[channel]));
|
||||
buffer[offset + 0x01] = (char)std::min<unsigned int>(254, RGBGetGValue(colors[channel]));
|
||||
buffer[offset + 0x02] = (char)std::min<unsigned int>(254, RGBGetBValue(colors[channel]));
|
||||
buffer[offset + 0x00] = std::min<unsigned int>(254, RGBGetRValue(colors[channel]));
|
||||
buffer[offset + 0x01] = std::min<unsigned int>(254, RGBGetGValue(colors[channel]));
|
||||
buffer[offset + 0x02] = std::min<unsigned int>(254, RGBGetBValue(colors[channel]));
|
||||
}
|
||||
|
||||
serialport.serial_write(buffer, sizeof(buffer));
|
||||
|
||||
@@ -35,7 +35,7 @@ void DetectAsusAuraCoreControllers(hid_device_info* info, const std::string& /*n
|
||||
{
|
||||
AuraCoreController* controller = new AuraCoreController(dev, info->path);
|
||||
RGBController_AuraCore* rgb_controller = new RGBController_AuraCore(controller);
|
||||
|
||||
// Constructor sets the name
|
||||
if(rgb_controller->type != DEVICE_TYPE_UNKNOWN)
|
||||
{
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
@@ -55,7 +55,7 @@ void DetectAsusAuraCoreLaptopControllers(hid_device_info* info, const std::strin
|
||||
{
|
||||
AsusAuraCoreLaptopController* controller = new AsusAuraCoreLaptopController(dev, info->path);
|
||||
RGBController_AsusAuraCoreLaptop* rgb_controller = new RGBController_AsusAuraCoreLaptop(controller);
|
||||
|
||||
// Constructor sets the name
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,12 @@
|
||||
#include "AsusAuraGPUController.h"
|
||||
#include "pci_ids.h"
|
||||
|
||||
AuraGPUController::AuraGPUController(i2c_smbus_interface* bus, aura_gpu_dev_id dev, std::string dev_name)
|
||||
AuraGPUController::AuraGPUController(i2c_smbus_interface* bus, aura_gpu_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
|
||||
strcpy(device_name, "ASUS Aura GPU"); // Would be nice to get the actual GPU name. Using this as a placeholder.
|
||||
}
|
||||
|
||||
AuraGPUController::~AuraGPUController()
|
||||
@@ -27,7 +28,7 @@ AuraGPUController::~AuraGPUController()
|
||||
|
||||
std::string AuraGPUController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string AuraGPUController::GetDeviceLocation()
|
||||
|
||||
@@ -43,7 +43,7 @@ enum
|
||||
class AuraGPUController
|
||||
{
|
||||
public:
|
||||
AuraGPUController(i2c_smbus_interface* bus, aura_gpu_dev_id, std::string dev_name);
|
||||
AuraGPUController(i2c_smbus_interface* bus, aura_gpu_dev_id);
|
||||
~AuraGPUController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
bool direct = false; // Temporary solution to check if we are in "Direct" mode
|
||||
|
||||
private:
|
||||
char device_name[16];
|
||||
i2c_smbus_interface * bus;
|
||||
aura_gpu_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
@@ -56,8 +56,9 @@ void DetectAsusAuraGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, co
|
||||
{
|
||||
if(TestForAsusAuraGPUController(bus, i2c_addr))
|
||||
{
|
||||
AuraGPUController* controller = new AuraGPUController(bus, i2c_addr, name);
|
||||
AuraGPUController* controller = new AuraGPUController(bus, i2c_addr);
|
||||
RGBController_AuraGPU* rgb_controller = new RGBController_AuraGPU(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
@@ -73,7 +74,6 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1050 Ti Gaming OC",
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1050 Ti Gaming OC", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1050TI_O4G_GAMING_2, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1060 Gaming", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1060_6G_GAMING, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1060 Gaming", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1060, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1060 Gaming", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1060_865B, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1070 Gaming", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070_8G_GAMING, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1070 Gaming OC", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070_O8G_GAMING, 0x29);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce GTX 1070 OC", DetectAsusAuraGPUControllers, NVIDIA_VEN, NVIDIA_GTX1070_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_GTX1070_OC, 0x29);
|
||||
|
||||
+1
-7
@@ -13,11 +13,10 @@
|
||||
#include "AsusAuraHeadsetStandController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AuraHeadsetStandController::AuraHeadsetStandController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AuraHeadsetStandController::AuraHeadsetStandController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AuraHeadsetStandController::~AuraHeadsetStandController()
|
||||
@@ -30,11 +29,6 @@ std::string AuraHeadsetStandController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraHeadsetStandController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AuraHeadsetStandController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+17
-19
@@ -33,33 +33,31 @@ enum
|
||||
class AuraHeadsetStandController
|
||||
{
|
||||
public:
|
||||
AuraHeadsetStandController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraHeadsetStandController(hid_device* dev_handle, const char* path);
|
||||
virtual ~AuraHeadsetStandController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void SaveMode();
|
||||
void SaveMode();
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+61
-61
@@ -24,88 +24,88 @@
|
||||
|
||||
RGBController_AuraHeadsetStand::RGBController_AuraHeadsetStand(AuraHeadsetStandController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_HEADSET_STAND;
|
||||
description = "ASUS Aura Headset Stand Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS Aura Headset Stand";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_HEADSET_STAND;
|
||||
description = "ASUS Aura Headset Stand Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_HEADSET_STAND_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_HEADSET_STAND_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_HEADSET_STAND_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Static.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Static.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_HEADSET_STAND_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Static.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Static.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_HEADSET_STAND_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
Breathing.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Breathing.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_HEADSET_STAND_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
Breathing.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Breathing.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Strobing;
|
||||
Strobing.name = "Flashing";
|
||||
Strobing.value = AURA_HEADSET_STAND_MODE_STROBING;
|
||||
Strobing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Strobing.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Strobing.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Strobing.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Strobing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Strobing.colors_min = 1;
|
||||
Strobing.colors_max = 1;
|
||||
Strobing.name = "Flashing";
|
||||
Strobing.value = AURA_HEADSET_STAND_MODE_STROBING;
|
||||
Strobing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Strobing.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Strobing.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Strobing.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Strobing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Strobing.colors_min = 1;
|
||||
Strobing.colors_max = 1;
|
||||
Strobing.colors.resize(1);
|
||||
modes.push_back(Strobing);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_HEADSET_STAND_MODE_COLOR_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
SpectrumCycle.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
SpectrumCycle.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
SpectrumCycle.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
SpectrumCycle.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
SpectrumCycle.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
SpectrumCycle.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_HEADSET_STAND_MODE_COLOR_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
SpectrumCycle.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
SpectrumCycle.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
SpectrumCycle.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
SpectrumCycle.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
SpectrumCycle.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
SpectrumCycle.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow Wave";
|
||||
Rainbow.value = AURA_HEADSET_STAND_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Rainbow.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
Rainbow.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
Rainbow.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
Rainbow.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Rainbow.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Rainbow.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
Rainbow.name = "Rainbow Wave";
|
||||
Rainbow.value = AURA_HEADSET_STAND_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Rainbow.speed_min = AURA_HEADSETSTAND_SPEED_MIN;
|
||||
Rainbow.speed_max = AURA_HEADSETSTAND_SPEED_MAX;
|
||||
Rainbow.speed = AURA_HEADSETSTAND_SPEED_DEFAULT;
|
||||
Rainbow.brightness_min = AURA_HEADSETSTAND_BRIGHTNESS_MIN;
|
||||
Rainbow.brightness_max = AURA_HEADSETSTAND_BRIGHTNESS_MAX;
|
||||
Rainbow.brightness = AURA_HEADSETSTAND_BRIGHTNESS_DEFAULT;
|
||||
modes.push_back(Rainbow);
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
+1
-7
@@ -13,11 +13,10 @@
|
||||
#include "AsusAuraKeyboardController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AuraKeyboardController::AuraKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AuraKeyboardController::AuraKeyboardController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AuraKeyboardController::~AuraKeyboardController()
|
||||
@@ -30,11 +29,6 @@ std::string AuraKeyboardController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraKeyboardController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AuraKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+8
-10
@@ -19,21 +19,19 @@
|
||||
class AuraKeyboardController
|
||||
{
|
||||
public:
|
||||
AuraKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraKeyboardController(hid_device* dev_handle, const char* path);
|
||||
virtual ~AuraKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendDirect
|
||||
(
|
||||
unsigned char frame_count,
|
||||
unsigned char * frame_data
|
||||
);
|
||||
void SendDirect
|
||||
(
|
||||
unsigned char frame_count,
|
||||
unsigned char * frame_data
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+12
-12
@@ -358,21 +358,21 @@ static const std::vector<aura_keyboard_led> default_65pct_led_names =
|
||||
|
||||
RGBController_AuraKeyboard::RGBController_AuraKeyboard(AuraKeyboardController* controller_ptr, AuraKeyboardMappingLayoutType keyboard_layout)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
layout = keyboard_layout;
|
||||
controller = controller_ptr;
|
||||
layout = keyboard_layout;
|
||||
|
||||
name = controller->GetNameString();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS Aura Keyboard";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
+1
-7
@@ -14,12 +14,11 @@
|
||||
#include "LogManager.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AuraMonitorController::AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name)
|
||||
AuraMonitorController::AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
device_pid = pid;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AuraMonitorController::~AuraMonitorController()
|
||||
@@ -32,11 +31,6 @@ std::string AuraMonitorController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraMonitorController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AuraMonitorController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+7
-9
@@ -27,21 +27,19 @@ enum
|
||||
class AuraMonitorController
|
||||
{
|
||||
public:
|
||||
AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name);
|
||||
AuraMonitorController(hid_device* dev_handle, const char* path, uint16_t pid);
|
||||
virtual ~AuraMonitorController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
void BeginUpdate();
|
||||
void UpdateLed(int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void ApplyChanges();
|
||||
void BeginUpdate();
|
||||
void UpdateLed(int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void ApplyChanges();
|
||||
|
||||
uint16_t device_pid;
|
||||
uint16_t device_pid;
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+11
-11
@@ -24,20 +24,20 @@
|
||||
|
||||
RGBController_AuraMonitor::RGBController_AuraMonitor(AuraMonitorController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetNameString();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MONITOR;
|
||||
description = "ASUS Aura Monitor Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS Aura Monitor";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MONITOR;
|
||||
description = "ASUS Aura Monitor Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
+24
-32
@@ -13,14 +13,11 @@
|
||||
#include "AsusAuraMouseController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
#define HID_MAX_STR 255
|
||||
|
||||
AuraMouseController::AuraMouseController(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name)
|
||||
AuraMouseController::AuraMouseController(hid_device* dev_handle, const char* path, uint16_t pid)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
device_pid = pid;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AuraMouseController::~AuraMouseController()
|
||||
@@ -33,9 +30,30 @@ std::string AuraMouseController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraMouseController::GetName()
|
||||
std::string AuraMouseController::CleanSerial(const std::wstring& wstr)
|
||||
{
|
||||
return(name);
|
||||
/*---------------------------------------------------------------*\
|
||||
| Cleans garbage at the end of serial numbers |
|
||||
| (apparently 2 characters too much, but maybe variable) |
|
||||
| Limited to new devices, old ones don't even have serial numbers |
|
||||
\*---------------------------------------------------------------*/
|
||||
std::string result;
|
||||
for(wchar_t c : wstr)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Forbid anything besides digits and upper case letters |
|
||||
\*-----------------------------------------------------*/
|
||||
bool isUpperCaseLetter = (c >= 64 && c <= 90);
|
||||
bool isDigit = (c >= 48 && c <= 57);
|
||||
if(!isUpperCaseLetter && !isDigit)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
result += (char)c;
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
std::string AuraMouseController::GetSerialString()
|
||||
@@ -105,32 +123,6 @@ std::string AuraMouseController::GetVersion(bool wireless, int protocol)
|
||||
return str;
|
||||
}
|
||||
|
||||
std::string AuraMouseController::CleanSerial(const std::wstring& wstr)
|
||||
{
|
||||
/*---------------------------------------------------------------*\
|
||||
| Cleans garbage at the end of serial numbers |
|
||||
| (apparently 2 characters too much, but maybe variable) |
|
||||
| Limited to new devices, old ones don't even have serial numbers |
|
||||
\*---------------------------------------------------------------*/
|
||||
std::string result;
|
||||
for(wchar_t c : wstr)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Forbid anything besides digits and upper case letters |
|
||||
\*-----------------------------------------------------*/
|
||||
bool isUpperCaseLetter = (c >= 64 && c <= 90);
|
||||
bool isDigit = (c >= 48 && c <= 57);
|
||||
if(!isUpperCaseLetter && !isDigit)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
result += (char)c;
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
void AuraMouseController::SaveMode()
|
||||
{
|
||||
unsigned char usb_save_buf[ASUS_AURA_MOUSE_PACKET_SIZE] = { 0x00, 0x50, 0x03 };
|
||||
|
||||
+23
-25
@@ -17,42 +17,40 @@
|
||||
#include "AsusAuraMouseDevices.h"
|
||||
|
||||
#define ASUS_AURA_MOUSE_PACKET_SIZE 65
|
||||
#define HID_MAX_STR 255
|
||||
|
||||
class AuraMouseController
|
||||
{
|
||||
public:
|
||||
AuraMouseController(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name);
|
||||
AuraMouseController(hid_device* dev_handle, const char* path, uint16_t pid);
|
||||
virtual ~AuraMouseController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string CleanSerial(const std::wstring& wstr);
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion(bool wireless, int protocol);
|
||||
|
||||
std::string CleanSerial(const std::wstring& wstr);
|
||||
void SaveMode();
|
||||
void SendUpdate
|
||||
(
|
||||
unsigned char zone,
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu,
|
||||
unsigned char dir,
|
||||
bool random,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void SendDirect
|
||||
(
|
||||
std::vector<RGBColor> zone_colors
|
||||
);
|
||||
|
||||
void SaveMode();
|
||||
void SendUpdate
|
||||
(
|
||||
unsigned char zone,
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu,
|
||||
unsigned char dir,
|
||||
bool random,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void SendDirect
|
||||
(
|
||||
std::vector<RGBColor> zone_colors
|
||||
);
|
||||
|
||||
uint16_t device_pid;
|
||||
uint16_t device_pid;
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+11
-11
@@ -33,19 +33,19 @@ static std::string aura_mouse_zone_names[5]
|
||||
|
||||
RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
pid = controller->device_pid;
|
||||
pid = controller->device_pid;
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "ASUS Aura Mouse Device";
|
||||
version = controller->GetVersion(aura_mouse_devices[pid].wireless, aura_mouse_devices[pid].version_protocol);
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS Aura Mouse";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "ASUS Aura Mouse Device";
|
||||
version = controller->GetVersion(aura_mouse_devices[pid].wireless, aura_mouse_devices[pid].version_protocol);
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
std::vector<uint8_t> mm = aura_mouse_devices[pid].mouse_modes;
|
||||
std::vector<uint8_t> mm = aura_mouse_devices[pid].mouse_modes;
|
||||
|
||||
if(aura_mouse_devices[pid].direct)
|
||||
{
|
||||
@@ -57,7 +57,7 @@ RGBController_AuraMouse::RGBController_AuraMouse(AuraMouseController* controller
|
||||
modes.push_back(Direct);
|
||||
}
|
||||
|
||||
int mode_value = 0;
|
||||
int mode_value = 0;
|
||||
|
||||
for(std::vector<uint8_t>::iterator it = mm.begin(); it != mm.end(); it++)
|
||||
{
|
||||
|
||||
+1
-7
@@ -15,12 +15,11 @@
|
||||
#include "AsusAuraMouseGen1Controller.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AsusAuraMouseGen1Controller::AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name)
|
||||
AsusAuraMouseGen1Controller::AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
device_pid = pid;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AsusAuraMouseGen1Controller::~AsusAuraMouseGen1Controller()
|
||||
@@ -33,11 +32,6 @@ std::string AsusAuraMouseGen1Controller::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AsusAuraMouseGen1Controller::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AsusAuraMouseGen1Controller::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[HID_MAX_STR];
|
||||
|
||||
+18
-22
@@ -21,37 +21,33 @@
|
||||
class AsusAuraMouseGen1Controller
|
||||
{
|
||||
public:
|
||||
AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid, std::string dev_name);
|
||||
AsusAuraMouseGen1Controller(hid_device* dev_handle, const char* path, uint16_t pid);
|
||||
virtual ~AsusAuraMouseGen1Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
int GetActiveProfile();
|
||||
|
||||
int GetActiveProfile();
|
||||
void SendUpdate
|
||||
(
|
||||
unsigned char key,
|
||||
unsigned char value
|
||||
);
|
||||
|
||||
void SendUpdate
|
||||
(
|
||||
unsigned char key,
|
||||
unsigned char value
|
||||
);
|
||||
void UpdateProfile
|
||||
(
|
||||
unsigned char key,
|
||||
unsigned char profile,
|
||||
unsigned char value
|
||||
);
|
||||
void SendDirectSpatha(std::vector<RGBColor> colors);
|
||||
|
||||
void UpdateProfile
|
||||
(
|
||||
unsigned char key,
|
||||
unsigned char profile,
|
||||
unsigned char value
|
||||
);
|
||||
void ResetToSavedLighting();
|
||||
|
||||
void SendDirectSpatha(std::vector<RGBColor> colors);
|
||||
|
||||
void ResetToSavedLighting();
|
||||
|
||||
uint16_t device_pid;
|
||||
uint16_t device_pid;
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ RGBController_AsusROGSpatha::RGBController_AsusROGSpatha(AsusAuraMouseGen1Contro
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "ASUS ROG Spatha";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "ASUS Aura Mouse Device";
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ RGBController_AsusROGStrixEvolve::RGBController_AsusROGStrixEvolve(AsusAuraMouse
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "ASUS ROG Strix Evolve";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "ASUS Aura Mouse Device";
|
||||
|
||||
+1
-7
@@ -13,11 +13,10 @@
|
||||
#include "AsusAuraMousematController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AuraMousematController::AuraMousematController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AuraMousematController::AuraMousematController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AuraMousematController::~AuraMousematController()
|
||||
@@ -30,11 +29,6 @@ std::string AuraMousematController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraMousematController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AuraMousematController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+16
-18
@@ -31,32 +31,30 @@ enum
|
||||
class AuraMousematController
|
||||
{
|
||||
public:
|
||||
AuraMousematController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraMousematController(hid_device* dev_handle, const char* path);
|
||||
virtual ~AuraMousematController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char pattern
|
||||
);
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char pattern
|
||||
);
|
||||
|
||||
void SaveMode();
|
||||
void SaveMode();
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ RGBController_AuraMousemat::RGBController_AuraMousemat(AuraMousematController* c
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "ASUS Aura Mousemat";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
description = "ASUS Aura Mousemat Device";
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "AsusAuraRyuoAIOController.h"
|
||||
|
||||
AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path, std::string dev_name) : AuraUSBController(dev_handle, path, dev_name)
|
||||
AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Add addressable devices |
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public:
|
||||
SPEED_FASTEST = 0x00, // Fastest speed
|
||||
};
|
||||
|
||||
AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AsusAuraRyuoAIOController(hid_device* dev_handle, const char* path);
|
||||
~AsusAuraRyuoAIOController();
|
||||
|
||||
std::string GetLocation();
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ RGBController_AsusAuraRyuoAIO::RGBController_AsusAuraRyuoAIO(AsusAuraRyuoAIOCont
|
||||
controller = controller_ptr;
|
||||
uint8_t speed = controller->SPEED_NORMAL;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "ROG Ryuo AIO";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_COOLER;
|
||||
description = "ASUS Liquid Cooler with 120mm and 240mm radiators.";
|
||||
|
||||
+1
-9
@@ -19,13 +19,10 @@
|
||||
#include "AsusAuraTUFKeyboardController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
#define HID_MAX_STR 128
|
||||
|
||||
AuraTUFKeyboardController::AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short version, std::string dev_name)
|
||||
AuraTUFKeyboardController::AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short version)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
device_pid = pid;
|
||||
rev_version = version;
|
||||
|
||||
@@ -42,11 +39,6 @@ std::string AuraTUFKeyboardController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AuraTUFKeyboardController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AuraTUFKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[HID_MAX_STR];
|
||||
|
||||
+56
-58
@@ -17,6 +17,8 @@
|
||||
#include "RGBController.h"
|
||||
#include "AsusAuraTUFKeyboardLayouts.h"
|
||||
|
||||
#define HID_MAX_STR 128
|
||||
|
||||
enum
|
||||
{
|
||||
AURA_KEYBOARD_MODE_STATIC = 0,
|
||||
@@ -67,81 +69,77 @@ struct led_color
|
||||
class AuraTUFKeyboardController
|
||||
{
|
||||
public:
|
||||
AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short version, std::string dev_name);
|
||||
AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short version);
|
||||
~AuraTUFKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
|
||||
int GetLayout();
|
||||
int GetNumpadLocation();
|
||||
void SaveMode();
|
||||
void AllowRemoteControl(unsigned char type);
|
||||
|
||||
void UpdateSingleLed
|
||||
(
|
||||
int led,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
void UpdateSingleLed
|
||||
(
|
||||
int led,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<led_color> colors
|
||||
);
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<led_color> colors
|
||||
);
|
||||
|
||||
void UpdateK1Wave
|
||||
(
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateK1Wave
|
||||
(
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void UpdateScopeIIRainbowRipple
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateScopeIIRainbowRipple
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void UpdateScopeIIQuicksand
|
||||
(
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateScopeIIQuicksand
|
||||
(
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char direction,
|
||||
unsigned char color_mode,
|
||||
unsigned char speed,
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateQuicksandColors(std::vector<RGBColor> colors);
|
||||
void UpdateMode(unsigned char mode);
|
||||
void AwaitResponse(int ms);
|
||||
void ClearResponses();
|
||||
|
||||
void UpdateQuicksandColors(std::vector<RGBColor> colors);
|
||||
void UpdateMode(unsigned char mode);
|
||||
void AwaitResponse(int ms);
|
||||
void ClearResponses();
|
||||
|
||||
uint16_t device_pid;
|
||||
bool is_per_led_keyboard;
|
||||
uint16_t device_pid;
|
||||
bool is_per_led_keyboard;
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
unsigned short rev_version;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
unsigned short rev_version;
|
||||
};
|
||||
|
||||
|
||||
+147
-155
@@ -26,19 +26,19 @@
|
||||
|
||||
RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
pid = controller->device_pid;
|
||||
pid = controller->device_pid;
|
||||
|
||||
if(pid != AURA_ROG_CLAYMORE_PID)
|
||||
{
|
||||
name = controller->GetName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS Aura Keyboard";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
unsigned char AURA_KEYBOARD_SPEED_MIN = 0;
|
||||
unsigned char AURA_KEYBOARD_SPEED_MAX = 0;
|
||||
@@ -51,7 +51,6 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
|
||||
AURA_KEYBOARD_SPEED_MAX = 2;
|
||||
AURA_KEYBOARD_SPEED_DEFAULT = 1;
|
||||
break;
|
||||
|
||||
case AURA_ROG_STRIX_FLARE_PID:
|
||||
case AURA_ROG_STRIX_FLARE_PNK_LTD_PID:
|
||||
case AURA_ROG_STRIX_FLARE_COD_BO4_PID:
|
||||
@@ -61,7 +60,6 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
|
||||
AURA_KEYBOARD_SPEED_MAX = 0;
|
||||
AURA_KEYBOARD_SPEED_DEFAULT = 8;
|
||||
break;
|
||||
|
||||
case AURA_ROG_AZOTH_USB_PID:
|
||||
case AURA_ROG_AZOTH_2_4_PID:
|
||||
case AURA_ROG_FALCHION_WIRED_PID:
|
||||
@@ -81,83 +79,77 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
|
||||
AURA_KEYBOARD_SPEED_MAX = 0;
|
||||
AURA_KEYBOARD_SPEED_DEFAULT = 30;
|
||||
break;
|
||||
|
||||
default:
|
||||
AURA_KEYBOARD_SPEED_MIN = 15;
|
||||
AURA_KEYBOARD_SPEED_MAX = 0;
|
||||
AURA_KEYBOARD_SPEED_DEFAULT = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_KEYBOARD_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Static.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_KEYBOARD_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Static.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
if(controller->is_per_led_keyboard)
|
||||
{
|
||||
Breathing.flags |= MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
}
|
||||
Breathing.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Breathing.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Breathing.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 2;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
if(controller->is_per_led_keyboard) Breathing.flags |= MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
|
||||
Breathing.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Breathing.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Breathing.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 2;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Color_Cycle;
|
||||
Color_Cycle.name = "Spectrum Cycle";
|
||||
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
|
||||
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Color_Cycle.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Color_Cycle.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Color_Cycle.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Color_Cycle.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Color_Cycle.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Color_Cycle.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Color_Cycle.color_mode = MODE_COLORS_NONE;
|
||||
Color_Cycle.name = "Spectrum Cycle";
|
||||
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
|
||||
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Color_Cycle.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Color_Cycle.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Color_Cycle.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Color_Cycle.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Color_Cycle.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Color_Cycle.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Color_Cycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Color_Cycle);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
if(controller->is_per_led_keyboard)
|
||||
{
|
||||
Wave.flags |= MODE_FLAG_HAS_DIRECTION_UD;
|
||||
}
|
||||
Wave.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Wave.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Wave.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Wave.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Wave.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
if(controller->is_per_led_keyboard) Wave.flags |= MODE_FLAG_HAS_DIRECTION_UD;
|
||||
|
||||
Wave.speed_min = AURA_KEYBOARD_SPEED_MIN;
|
||||
Wave.speed_max = AURA_KEYBOARD_SPEED_MAX;
|
||||
Wave.speed = AURA_KEYBOARD_SPEED_DEFAULT;
|
||||
Wave.brightness_min = AURA_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = AURA_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Wave.brightness = AURA_KEYBOARD_BRIGHTNESS_DEFAULT;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
|
||||
if(!controller->is_per_led_keyboard)
|
||||
{
|
||||
@@ -276,129 +268,129 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont
|
||||
else
|
||||
{
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
name = "ASUS ROG Claymore";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Aura Keyboard Device";
|
||||
version = controller->GetVersion();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_KEYBOARD_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_KEYBOARD_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_KEYBOARD_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Breathing.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Breathing.speed = AURA_CLAYMORE_SPEED_DEFAULT_BREATHING;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 2;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_KEYBOARD_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Breathing.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Breathing.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Breathing.speed = AURA_CLAYMORE_SPEED_DEFAULT_BREATHING;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 2;
|
||||
Breathing.colors.resize(2);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Color_Cycle;
|
||||
Color_Cycle.name = "Spectrum Cycle";
|
||||
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
|
||||
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Color_Cycle.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Color_Cycle.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Color_Cycle.speed = AURA_CLAYMORE_SPEED_DEFAULT_COLOR_CYCLE;
|
||||
Color_Cycle.color_mode = MODE_COLORS_NONE;
|
||||
Color_Cycle.name = "Spectrum Cycle";
|
||||
Color_Cycle.value = AURA_KEYBOARD_MODE_COLOR_CYCLE;
|
||||
Color_Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Color_Cycle.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Color_Cycle.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Color_Cycle.speed = AURA_CLAYMORE_SPEED_DEFAULT_COLOR_CYCLE;
|
||||
Color_Cycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Color_Cycle);
|
||||
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = AURA_KEYBOARD_MODE_REACTIVE;
|
||||
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Reactive.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Reactive.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Reactive.speed = AURA_CLAYMORE_SPEED_DEFAULT_REACTIVE;
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Reactive.colors_min = 1;
|
||||
Reactive.colors_max = 2;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = AURA_KEYBOARD_MODE_REACTIVE;
|
||||
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Reactive.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Reactive.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Reactive.speed = AURA_CLAYMORE_SPEED_DEFAULT_REACTIVE;
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Reactive.colors_min = 1;
|
||||
Reactive.colors_max = 2;
|
||||
Reactive.colors.resize(2);
|
||||
modes.push_back(Reactive);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_COLORS_NONE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_COLORS_NONE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Color_Wave;
|
||||
Color_Wave.name = "Color Wave";
|
||||
Color_Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Color_Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Color_Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Color_Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Color_Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
|
||||
Color_Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Color_Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Color_Wave.colors_min = 1;
|
||||
Color_Wave.colors_max = 2;
|
||||
Color_Wave.name = "Color Wave";
|
||||
Color_Wave.value = AURA_KEYBOARD_MODE_WAVE;
|
||||
Color_Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Color_Wave.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Color_Wave.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Color_Wave.speed = AURA_CLAYMORE_SPEED_DEFAULT_WAVE;
|
||||
Color_Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Color_Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Color_Wave.colors_min = 1;
|
||||
Color_Wave.colors_max = 2;
|
||||
Color_Wave.colors.resize(2);
|
||||
modes.push_back(Color_Wave);
|
||||
|
||||
mode Ripple;
|
||||
Ripple.name = "Ripple";
|
||||
Ripple.value = AURA_KEYBOARD_MODE_RIPPLE;
|
||||
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Ripple.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Ripple.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Ripple.speed = AURA_CLAYMORE_SPEED_DEFAULT_RIPPLE;
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Ripple.colors_min = 1;
|
||||
Ripple.colors_max = 2;
|
||||
Ripple.name = "Ripple";
|
||||
Ripple.value = AURA_KEYBOARD_MODE_RIPPLE;
|
||||
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Ripple.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Ripple.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Ripple.speed = AURA_CLAYMORE_SPEED_DEFAULT_RIPPLE;
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Ripple.colors_min = 1;
|
||||
Ripple.colors_max = 2;
|
||||
Ripple.colors.resize(2);
|
||||
modes.push_back(Ripple);
|
||||
|
||||
mode Starry_Night;
|
||||
Starry_Night.name = "Starry Night";
|
||||
Starry_Night.value = AURA_KEYBOARD_MODE_STARRY_NIGHT;
|
||||
Starry_Night.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Starry_Night.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Starry_Night.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Starry_Night.speed = AURA_CLAYMORE_SPEED_DEFAULT_STARRY_NIGHT;
|
||||
Starry_Night.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Starry_Night.colors_min = 1;
|
||||
Starry_Night.colors_max = 2;
|
||||
Starry_Night.name = "Starry Night";
|
||||
Starry_Night.value = AURA_KEYBOARD_MODE_STARRY_NIGHT;
|
||||
Starry_Night.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Starry_Night.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Starry_Night.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Starry_Night.speed = AURA_CLAYMORE_SPEED_DEFAULT_STARRY_NIGHT;
|
||||
Starry_Night.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Starry_Night.colors_min = 1;
|
||||
Starry_Night.colors_max = 2;
|
||||
Starry_Night.colors.resize(2);
|
||||
modes.push_back(Starry_Night);
|
||||
|
||||
mode Quicksand;
|
||||
Quicksand.name = "Quicksand";
|
||||
Quicksand.value = AURA_KEYBOARD_MODE_QUICKSAND;
|
||||
Quicksand.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Quicksand.direction = MODE_DIRECTION_DOWN;
|
||||
Quicksand.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Quicksand.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Quicksand.speed = AURA_CLAYMORE_SPEED_DEFAULT_QUICKSAND;
|
||||
Quicksand.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Quicksand.colors_min = 6;
|
||||
Quicksand.colors_max = 6;
|
||||
Quicksand.name = "Quicksand";
|
||||
Quicksand.value = AURA_KEYBOARD_MODE_QUICKSAND;
|
||||
Quicksand.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Quicksand.direction = MODE_DIRECTION_DOWN;
|
||||
Quicksand.speed_min = AURA_CLAYMORE_SPEED_MIN;
|
||||
Quicksand.speed_max = AURA_CLAYMORE_SPEED_MAX;
|
||||
Quicksand.speed = AURA_CLAYMORE_SPEED_DEFAULT_QUICKSAND;
|
||||
Quicksand.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Quicksand.colors_min = 6;
|
||||
Quicksand.colors_max = 6;
|
||||
Quicksand.colors.resize(6);
|
||||
modes.push_back(Quicksand);
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <cstring>
|
||||
#include "AsusAuraAddressableController.h"
|
||||
|
||||
AuraAddressableController::AuraAddressableController(hid_device* dev_handle, const char* path, std::string dev_name) : AuraUSBController(dev_handle, path, dev_name)
|
||||
AuraAddressableController::AuraAddressableController(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Add addressable devices |
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ enum
|
||||
class AuraAddressableController : public AuraUSBController
|
||||
{
|
||||
public:
|
||||
AuraAddressableController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraAddressableController(hid_device* dev_handle, const char* path);
|
||||
~AuraAddressableController();
|
||||
|
||||
void SetChannelLEDs
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <cstring>
|
||||
#include "AsusAuraMainboardController.h"
|
||||
|
||||
AuraMainboardController::AuraMainboardController(hid_device* dev_handle, const char* path, std::string dev_name) : AuraUSBController(dev_handle, path, dev_name), mode(AURA_MODE_DIRECT)
|
||||
AuraMainboardController::AuraMainboardController(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path), mode(AURA_MODE_DIRECT)
|
||||
{
|
||||
unsigned char num_total_mainboard_leds = config_table[0x1B];
|
||||
unsigned char num_rgb_headers = config_table[0x1D];
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ enum
|
||||
class AuraMainboardController : public AuraUSBController
|
||||
{
|
||||
public:
|
||||
AuraMainboardController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraMainboardController(hid_device* dev_handle, const char* path);
|
||||
~AuraMainboardController();
|
||||
|
||||
void SetChannelLEDs
|
||||
|
||||
@@ -14,11 +14,10 @@
|
||||
#include "LogManager.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AuraUSBController::AuraUSBController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
AuraUSBController::AuraUSBController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
GetFirmwareVersion();
|
||||
GetConfigTable();
|
||||
@@ -41,7 +40,7 @@ std::string AuraUSBController::GetDeviceLocation()
|
||||
|
||||
std::string AuraUSBController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string AuraUSBController::GetSerialString()
|
||||
@@ -57,11 +56,6 @@ std::string AuraUSBController::GetSerialString()
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
std::string AuraUSBController::GetDeviceVersion()
|
||||
{
|
||||
return(std::string(version));
|
||||
}
|
||||
|
||||
const std::vector<AuraDeviceInfo>& AuraUSBController::GetAuraDevices() const
|
||||
{
|
||||
return(device_info);
|
||||
@@ -95,11 +89,11 @@ void AuraUSBController::GetConfigTable()
|
||||
{
|
||||
memcpy(config_table, &usb_buf[4], 60);
|
||||
|
||||
LOG_DEBUG("[%s] ASUS Aura USB config table:", version);
|
||||
LOG_DEBUG("[%s] ASUS Aura USB config table:", device_name);
|
||||
|
||||
for(int i = 0; i < 60; i+=6)
|
||||
{
|
||||
LOG_DEBUG("[%s] %02X %02X %02X %02X %02X %02X", version,
|
||||
LOG_DEBUG("[%s] %02X %02X %02X %02X %02X %02X", device_name,
|
||||
config_table[i + 0],
|
||||
config_table[i + 1],
|
||||
config_table[i + 2],
|
||||
@@ -110,7 +104,7 @@ void AuraUSBController::GetConfigTable()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INFO("[%s] Could not read config table, can not add device", version);
|
||||
LOG_INFO("[%s] Could not read config table, can not add device", device_name);
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
@@ -141,7 +135,7 @@ void AuraUSBController::GetFirmwareVersion()
|
||||
\*-----------------------------------------------------*/
|
||||
if(usb_buf[1] == 0x02)
|
||||
{
|
||||
memcpy(version, &usb_buf[2], 16);
|
||||
memcpy(device_name, &usb_buf[2], 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,17 +54,17 @@ enum class AuraDeviceType
|
||||
|
||||
struct AuraDeviceInfo
|
||||
{
|
||||
unsigned char effect_channel;
|
||||
unsigned char direct_channel;
|
||||
unsigned char num_leds;
|
||||
unsigned char num_headers;
|
||||
AuraDeviceType device_type;
|
||||
unsigned char effect_channel;
|
||||
unsigned char direct_channel;
|
||||
unsigned char num_leds;
|
||||
unsigned char num_headers;
|
||||
AuraDeviceType device_type;
|
||||
};
|
||||
|
||||
class AuraUSBController
|
||||
{
|
||||
public:
|
||||
AuraUSBController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AuraUSBController(hid_device* dev_handle, const char* path);
|
||||
virtual ~AuraUSBController();
|
||||
|
||||
unsigned int GetChannelCount();
|
||||
@@ -72,7 +72,6 @@ public:
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
std::string GetDeviceVersion();
|
||||
|
||||
const std::vector<AuraDeviceInfo>& GetAuraDevices() const;
|
||||
|
||||
@@ -97,8 +96,6 @@ protected:
|
||||
unsigned char config_table[60];
|
||||
std::vector<AuraDeviceInfo> device_info;
|
||||
std::string location;
|
||||
std::string name;
|
||||
char version[16];
|
||||
|
||||
void SendDirect
|
||||
(
|
||||
@@ -106,8 +103,10 @@ protected:
|
||||
unsigned char led_count,
|
||||
RGBColor * colors
|
||||
);
|
||||
|
||||
private:
|
||||
char device_name[16];
|
||||
|
||||
void GetConfigTable();
|
||||
|
||||
void GetFirmwareVersion();
|
||||
};
|
||||
|
||||
+1
@@ -26,6 +26,7 @@
|
||||
RGBController_AuraMainboard::RGBController_AuraMainboard(AuraMainboardController* controller_ptr) :
|
||||
RGBController_AuraUSB(controller_ptr)
|
||||
{
|
||||
name = "ASUS Aura USB Mainboard";
|
||||
description = "ASUS Aura USB Mainboard Device";
|
||||
|
||||
/*-------------------------------------------------------*\
|
||||
|
||||
+54
-54
@@ -26,91 +26,91 @@
|
||||
RGBController_AuraUSB::RGBController_AuraUSB(AuraUSBController* controller_ptr) :
|
||||
initializedMode(false)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_MOTHERBOARD;
|
||||
description = "ASUS Aura USB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
version = controller->GetDeviceVersion();
|
||||
name = "ASUS Aura USB";
|
||||
vendor = "ASUS";
|
||||
version = controller->GetDeviceName();
|
||||
type = DEVICE_TYPE_MOTHERBOARD;
|
||||
description = "ASUS Aura USB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = AURA_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = AURA_MODE_OFF;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
Off.name = "Off";
|
||||
Off.value = AURA_MODE_OFF;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = AURA_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Flashing.colors_min = 1;
|
||||
Flashing.colors_max = 1;
|
||||
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = AURA_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Flashing.colors_min = 1;
|
||||
Flashing.colors_max = 1;
|
||||
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Flashing.colors.resize(1);
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = 0;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = 0;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = AURA_MODE_RAINBOW;
|
||||
Rainbow.flags = 0;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = AURA_MODE_RAINBOW;
|
||||
Rainbow.flags = 0;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode ChaseFade;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = AURA_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
ChaseFade.colors_min = 1;
|
||||
ChaseFade.colors_max = 1;
|
||||
ChaseFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = AURA_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
ChaseFade.colors_min = 1;
|
||||
ChaseFade.colors_max = 1;
|
||||
ChaseFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ChaseFade.colors.resize(1);
|
||||
modes.push_back(ChaseFade);
|
||||
|
||||
mode Chase;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = AURA_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Chase.colors_min = 1;
|
||||
Chase.colors_max = 1;
|
||||
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = AURA_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Chase.colors_min = 1;
|
||||
Chase.colors_max = 1;
|
||||
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Chase.colors.resize(1);
|
||||
modes.push_back(Chase);
|
||||
|
||||
|
||||
@@ -37,19 +37,19 @@
|
||||
#include "RGBController_AsusAuraRyuoAIO.h"
|
||||
#include "dmiinfo.h"
|
||||
|
||||
#define AURA_USB_VID 0x0B05
|
||||
#define AURA_USB_VID 0x0B05
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| MOTHERBOARDS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_ADDRESSABLE_1_PID 0x1867
|
||||
#define AURA_ADDRESSABLE_2_PID 0x1872
|
||||
#define AURA_ADDRESSABLE_3_PID 0x18A3
|
||||
#define AURA_ADDRESSABLE_4_PID 0x18A5
|
||||
#define AURA_MOTHERBOARD_1_PID 0x18F3
|
||||
#define AURA_MOTHERBOARD_2_PID 0x1939
|
||||
#define AURA_MOTHERBOARD_3_PID 0x19AF
|
||||
#define AURA_MOTHERBOARD_4_PID 0x1AA6
|
||||
#define AURA_ADDRESSABLE_1_PID 0x1867
|
||||
#define AURA_ADDRESSABLE_2_PID 0x1872
|
||||
#define AURA_ADDRESSABLE_3_PID 0x18A3
|
||||
#define AURA_ADDRESSABLE_4_PID 0x18A5
|
||||
#define AURA_MOTHERBOARD_1_PID 0x18F3
|
||||
#define AURA_MOTHERBOARD_2_PID 0x1939
|
||||
#define AURA_MOTHERBOARD_3_PID 0x19AF
|
||||
#define AURA_MOTHERBOARD_4_PID 0x1AA6
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| KEYBOARDS |
|
||||
@@ -83,41 +83,44 @@
|
||||
/*-----------------------------------------------------------------*\
|
||||
| MICE - defined in AsusAuraMouseDevices.h |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_ROG_STRIX_EVOLVE_PID 0x185B
|
||||
#define AURA_ROG_SPATHA_WIRED_PID 0x181C
|
||||
#define AURA_ROG_SPATHA_WIRELESS_PID 0x1824
|
||||
|
||||
#define AURA_ROG_STRIX_EVOLVE_PID 0x185B
|
||||
#define AURA_ROG_SPATHA_WIRED_PID 0x181C
|
||||
#define AURA_ROG_SPATHA_WIRELESS_PID 0x1824
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| MOUSEMATS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_ROG_BALTEUS_PID 0x1891
|
||||
#define AURA_ROG_BALTEUS_QI_PID 0x1890
|
||||
#define AURA_ROG_BALTEUS_PID 0x1891
|
||||
#define AURA_ROG_BALTEUS_QI_PID 0x1890
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| MONITORS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_ROG_STRIX_XG27AQ_PID 0x198C
|
||||
#define AURA_ROG_STRIX_XG27AQM_PID 0x19BB
|
||||
#define AURA_ROG_STRIX_XG279Q_PID 0x1919
|
||||
#define AURA_ROG_STRIX_XG27W_PID 0x1933
|
||||
#define AURA_ROG_STRIX_XG32VC_PID 0x1968
|
||||
#define AURA_ROG_PG32UQ_PID 0x19B9
|
||||
|
||||
#define AURA_ROG_STRIX_XG27AQ_PID 0x198C
|
||||
#define AURA_ROG_STRIX_XG27AQM_PID 0x19BB
|
||||
#define AURA_ROG_STRIX_XG279Q_PID 0x1919
|
||||
#define AURA_ROG_STRIX_XG27W_PID 0x1933
|
||||
#define AURA_ROG_STRIX_XG32VC_PID 0x1968
|
||||
#define AURA_ROG_PG32UQ_PID 0x19B9
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| HEADSET STANDS |
|
||||
| HEADSETSTANDS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_ROG_THRONE_PID 0x18D9
|
||||
#define AURA_ROG_THRONE_QI_PID 0x18C5
|
||||
#define AURA_ROG_THRONE_QI_GUNDAM_PID 0x1994
|
||||
|
||||
#define AURA_ROG_THRONE_PID 0x18D9
|
||||
#define AURA_ROG_THRONE_QI_PID 0x18C5
|
||||
#define AURA_ROG_THRONE_QI_GUNDAM_PID 0x1994
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| OTHER |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define AURA_TERMINAL_PID 0x1889
|
||||
#define ROG_STRIX_LC120_PID 0x879E
|
||||
#define AURA_RYUO_AIO_PID 0x1887
|
||||
#define ASUS_ROG_ALLY_PID 0x1ABE
|
||||
#define ASUS_ROG_ALLY_X_PID 0x1B4C
|
||||
#define AURA_TERMINAL_PID 0x1889
|
||||
#define ROG_STRIX_LC120_PID 0x879E
|
||||
#define AURA_RYUO_AIO_PID 0x1887
|
||||
#define ASUS_ROG_ALLY_PID 0x1ABE
|
||||
#define ASUS_ROG_ALLY_X_PID 0x1B4C
|
||||
|
||||
AuraKeyboardMappingLayoutType GetKeyboardMappingLayoutType(int pid)
|
||||
{
|
||||
@@ -145,9 +148,9 @@ void DetectAsusAuraUSBTerminal(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraAddressableController* controller = new AuraAddressableController(dev, info->path, name);
|
||||
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
|
||||
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -158,10 +161,10 @@ void DetectAsusAuraUSBAddressable(hid_device_info* info, const std::string& /*na
|
||||
|
||||
if(dev)
|
||||
{
|
||||
DMIInfo dmi;
|
||||
AuraAddressableController* controller = new AuraAddressableController(dev, info->path, "ASUS " + dmi.getMainboard() + " Addressable");
|
||||
DMIInfo dmi;
|
||||
AuraAddressableController* controller = new AuraAddressableController(dev, info->path);
|
||||
RGBController_AuraUSB* rgb_controller = new RGBController_AuraUSB(controller);
|
||||
|
||||
rgb_controller->name = "ASUS " + dmi.getMainboard() + " Addressable";
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -174,10 +177,10 @@ void DetectAsusAuraUSBMotherboards(hid_device_info* info, const std::string& /*n
|
||||
{
|
||||
try
|
||||
{
|
||||
DMIInfo dmi;
|
||||
AuraMainboardController* controller = new AuraMainboardController(dev, info->path, "ASUS " + dmi.getMainboard());
|
||||
RGBController_AuraMainboard* rgb_controller = new RGBController_AuraMainboard(controller);
|
||||
|
||||
DMIInfo dmi;
|
||||
AuraMainboardController* controller = new AuraMainboardController(dev, info->path);
|
||||
RGBController_AuraMainboard* rgb_controller = new RGBController_AuraMainboard(controller);
|
||||
rgb_controller->name = "ASUS " + dmi.getMainboard();
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
catch(const std::runtime_error& ex)
|
||||
@@ -194,10 +197,10 @@ void DetectAsusAuraUSBKeyboards(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraKeyboardController* controller = new AuraKeyboardController(dev, info->path, name);
|
||||
AuraKeyboardController* controller = new AuraKeyboardController(dev, info->path);
|
||||
AuraKeyboardMappingLayoutType layout = GetKeyboardMappingLayoutType(info->product_id);
|
||||
RGBController_AuraKeyboard* rgb_controller = new RGBController_AuraKeyboard(controller, layout);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -209,9 +212,9 @@ void DetectAsusAuraUSBMice(hid_device_info* info, const std::string& name)
|
||||
if(dev)
|
||||
{
|
||||
uint16_t pid = (name == "Asus ROG Spatha X Dock") ? AURA_ROG_SPATHA_X_DOCK_FAKE_PID : info->product_id;
|
||||
AuraMouseController* controller = new AuraMouseController(dev, info->path, pid, name);
|
||||
AuraMouseController* controller = new AuraMouseController(dev, info->path, pid);
|
||||
RGBController_AuraMouse* rgb_controller = new RGBController_AuraMouse(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -222,9 +225,9 @@ void DetectAsusAuraUSBMousemats(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraMousematController* controller = new AuraMousematController(dev, info->path, name);
|
||||
AuraMousematController* controller = new AuraMousematController(dev, info->path);
|
||||
RGBController_AuraMousemat* rgb_controller = new RGBController_AuraMousemat(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -235,9 +238,9 @@ void DetectAsusAuraUSBROGStrixLC(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusROGStrixLCController* controller = new AsusROGStrixLCController(dev, info->path, name);
|
||||
AsusROGStrixLCController* controller = new AsusROGStrixLCController(dev, info->path);
|
||||
RGBController_AsusROGStrixLC* rgb_controller = new RGBController_AsusROGStrixLC(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -248,9 +251,9 @@ void DetectAsusAuraUSBRyuoAIO(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusAuraRyuoAIOController* controller = new AsusAuraRyuoAIOController(dev, info->path, name);
|
||||
AsusAuraRyuoAIOController* controller = new AsusAuraRyuoAIOController(dev, info->path);
|
||||
RGBController_AsusAuraRyuoAIO* rgb_controller = new RGBController_AsusAuraRyuoAIO(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -261,9 +264,9 @@ void DetectAsusAuraUSBStrixEvolve(hid_device_info* info, const std::string& name
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusAuraMouseGen1Controller* controller = new AsusAuraMouseGen1Controller(dev, info->path, info->product_id, name);
|
||||
AsusAuraMouseGen1Controller* controller = new AsusAuraMouseGen1Controller(dev, info->path, info->product_id);
|
||||
RGBController_AsusROGStrixEvolve* rgb_controller = new RGBController_AsusROGStrixEvolve(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -274,9 +277,9 @@ void DetectAsusAuraUSBSpatha(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusAuraMouseGen1Controller* controller = new AsusAuraMouseGen1Controller(dev, info->path, info->product_id, name);
|
||||
AsusAuraMouseGen1Controller* controller = new AsusAuraMouseGen1Controller(dev, info->path, info->product_id);
|
||||
RGBController_AsusROGSpatha* rgb_controller = new RGBController_AsusROGSpatha(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -287,9 +290,9 @@ void DetectAsusAuraUSBHeadsetStand(hid_device_info* info, const std::string& nam
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraHeadsetStandController* controller = new AuraHeadsetStandController(dev, info->path, name);
|
||||
AuraHeadsetStandController* controller = new AuraHeadsetStandController(dev, info->path);
|
||||
RGBController_AuraHeadsetStand* rgb_controller = new RGBController_AuraHeadsetStand(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -300,9 +303,9 @@ void DetectAsusAuraTUFUSBKeyboard(hid_device_info* info, const std::string& name
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraTUFKeyboardController* controller = new AuraTUFKeyboardController(dev, info->path, info->product_id, info->release_number, name);
|
||||
AuraTUFKeyboardController* controller = new AuraTUFKeyboardController(dev, info->path, info->product_id, info->release_number);
|
||||
RGBController_AuraTUFKeyboard* rgb_controller = new RGBController_AuraTUFKeyboard(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -313,9 +316,9 @@ void DetectAsusAuraUSBMonitor(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AuraMonitorController* controller = new AuraMonitorController(dev, info->path, info->product_id, name);
|
||||
AuraMonitorController* controller = new AuraMonitorController(dev, info->path, info->product_id);
|
||||
RGBController_AuraMonitor* rgb_controller = new RGBController_AuraMonitor(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -326,9 +329,9 @@ void DetectAsusROGAlly(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
ROGAllyController* controller = new ROGAllyController(dev, info->path, name);
|
||||
ROGAllyController* controller = new ROGAllyController(dev, info->path);
|
||||
RGBController_AsusROGAlly* rgb_controller = new RGBController_AsusROGAlly(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
#include "AsusROGAllyController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
ROGAllyController::ROGAllyController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
ROGAllyController::ROGAllyController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
|
||||
SendInitialization();
|
||||
}
|
||||
@@ -32,11 +31,6 @@ std::string ROGAllyController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string ROGAllyController::GetName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string ROGAllyController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
@@ -40,38 +40,36 @@ enum
|
||||
class ROGAllyController
|
||||
{
|
||||
public:
|
||||
ROGAllyController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
ROGAllyController(hid_device* dev_handle, const char* path);
|
||||
virtual ~ROGAllyController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
|
||||
void SendInitialization();
|
||||
void SendInitialization();
|
||||
|
||||
void UpdateBrightness
|
||||
(
|
||||
unsigned char brightness
|
||||
);
|
||||
void UpdateBrightness
|
||||
(
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
void UpdateLeds
|
||||
(
|
||||
std::vector<RGBColor> colors
|
||||
);
|
||||
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char direction
|
||||
);
|
||||
void UpdateDevice
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char direction
|
||||
);
|
||||
|
||||
void SaveMode();
|
||||
void SaveMode();
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ RGBController_AsusROGAlly::RGBController_AsusROGAlly(ROGAllyController* controll
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
name = "ASUS ROG Ally";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_GAMEPAD;
|
||||
description = "ASUS ROG Ally Device";
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "AsusROGStrixLCController.h"
|
||||
|
||||
AsusROGStrixLCController::AsusROGStrixLCController(hid_device* dev_handle, const char* path, std::string dev_name) : AuraUSBController(dev_handle, path, dev_name)
|
||||
AsusROGStrixLCController::AsusROGStrixLCController(hid_device* dev_handle, const char* path) : AuraUSBController(dev_handle, path)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Add addressable devices |
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ enum
|
||||
class AsusROGStrixLCController : public AuraUSBController
|
||||
{
|
||||
public:
|
||||
AsusROGStrixLCController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
AsusROGStrixLCController(hid_device* dev_handle, const char* path);
|
||||
~AsusROGStrixLCController();
|
||||
|
||||
std::string GetLocation();
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ RGBController_AsusROGStrixLC::RGBController_AsusROGStrixLC(AsusROGStrixLCControl
|
||||
controller = controller_ptr;
|
||||
uint8_t speed = ROGSTRIXLC_CONTROLLER_SPEED_NORMAL;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
name = "ROG Strix LC";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_COOLER;
|
||||
description = "ASUS Liquid Cooler including 120mm, 140mm, 240mm, 280mm and 360mm radiators.";
|
||||
|
||||
+1
-7
@@ -21,11 +21,10 @@
|
||||
|
||||
#define ASUS_CERBERUS_KB_PACKET_SIZE 8
|
||||
|
||||
AsusCerberusKeyboardController::AsusCerberusKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version, std::string dev_name)
|
||||
AsusCerberusKeyboardController::AsusCerberusKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
version = rev_version;
|
||||
}
|
||||
|
||||
@@ -39,11 +38,6 @@ std::string AsusCerberusKeyboardController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AsusCerberusKeyboardController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AsusCerberusKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+1
-3
@@ -30,11 +30,10 @@ enum
|
||||
class AsusCerberusKeyboardController
|
||||
{
|
||||
public:
|
||||
AsusCerberusKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version, std::string dev_name);
|
||||
AsusCerberusKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version);
|
||||
~AsusCerberusKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
std::string GetVersion();
|
||||
|
||||
@@ -48,6 +47,5 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
unsigned short version;
|
||||
};
|
||||
|
||||
+8
-8
@@ -176,7 +176,7 @@ static const std::vector<led_value> led_names =
|
||||
|
||||
RGBController_AsusCerberusKeyboard::RGBController_AsusCerberusKeyboard(AsusCerberusKeyboardController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------*\
|
||||
| this device has 6 different profiles, but there is no way to fetch them from the device, |
|
||||
@@ -185,13 +185,13 @@ RGBController_AsusCerberusKeyboard::RGBController_AsusCerberusKeyboard(AsusCerbe
|
||||
|
||||
controller->SetProfile(1);
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Cerberus Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
version = controller->GetVersion();
|
||||
name = "ASUS Cerberus Keyboard";
|
||||
vendor = "ASUS";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "ASUS Cerberus Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
version = controller->GetVersion();
|
||||
|
||||
mode Custom;
|
||||
Custom.name = "Custom";
|
||||
|
||||
@@ -29,9 +29,9 @@ void DetectAsusCerberusMech(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusCerberusKeyboardController* controller = new AsusCerberusKeyboardController(dev, info->path, info->release_number, name);
|
||||
AsusCerberusKeyboardController* controller = new AsusCerberusKeyboardController(dev, info->path, info->release_number);
|
||||
RGBController_AsusCerberusKeyboard* rgb_controller = new RGBController_AsusCerberusKeyboard(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,9 @@ void DetectAsusSagarisKeyboard(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusSagarisKeyboardController* controller = new AsusSagarisKeyboardController(dev, info->path, info->release_number, name);
|
||||
AsusSagarisKeyboardController* controller = new AsusSagarisKeyboardController(dev, info->path, info->release_number);
|
||||
RGBController_AsusSagarisKeyboard* rgb_controller = new RGBController_AsusSagarisKeyboard(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -55,9 +55,9 @@ void DetectAsusStrixClaw(hid_device_info* info, const std::string& name)
|
||||
|
||||
if(dev)
|
||||
{
|
||||
StrixClawController* controller = new StrixClawController(dev, info->path, name);
|
||||
StrixClawController* controller = new StrixClawController(dev, info->path);
|
||||
RGBController_StrixClaw* rgb_controller = new RGBController_StrixClaw(controller);
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-7
@@ -20,11 +20,10 @@
|
||||
|
||||
#define ASUS_SAGARIS_KB_PACKET_SIZE 65
|
||||
|
||||
AsusSagarisKeyboardController::AsusSagarisKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version, std::string dev_name)
|
||||
AsusSagarisKeyboardController::AsusSagarisKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
version = rev_version;
|
||||
}
|
||||
|
||||
@@ -43,11 +42,6 @@ std::string AsusSagarisKeyboardController::GetDeviceLocation()
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AsusSagarisKeyboardController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AsusSagarisKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
||||
+1
-3
@@ -54,12 +54,11 @@ typedef struct
|
||||
class AsusSagarisKeyboardController
|
||||
{
|
||||
public:
|
||||
AsusSagarisKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version, std::string dev_name);
|
||||
AsusSagarisKeyboardController(hid_device* dev_handle, const char* path, unsigned short rev_version);
|
||||
~AsusSagarisKeyboardController();
|
||||
|
||||
std::string GetVersion();
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
sagaris_mode GetMode();
|
||||
@@ -74,6 +73,5 @@ public:
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
unsigned short version;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user