From d4386163d8ee0fe4b9f52ba2a78183666c492ed7 Mon Sep 17 00:00:00 2001 From: Kamil Rojewski Date: Wed, 6 Sep 2023 07:46:57 +0200 Subject: [PATCH] openrgb 0.9 compatibility --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 7 ++++--- OpenRGBAmbientPlugin.cpp | 4 ++-- README.md | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a376320..ed76db3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# [2.4.0] + +* Compatibility with 0.9. + # [2.3.1] * Fixed not starting capture on start with OpenRGB >= 8.0. diff --git a/CMakeLists.txt b/CMakeLists.txt index 756a097..83b1379 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,12 +13,13 @@ set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Gui Qt5::Widgets) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) +add_library(${PROJECT_NAME} SHARED OpenRGBAmbientPlugin.h OpenRGBAmbientPlugin.cpp DeviceList.cpp DeviceList.h Settings.cpp Settings.h ScreenCapture.cpp ScreenCapture.h Limiter.cpp Limiter.h ReleaseWrapper.h SettingsTab.cpp SettingsTab.h RegionsWidget.cpp RegionsWidget.h RegionWidget.cpp RegionWidget.h LedUpdateEvent.h LedUpdateEvent.cpp ImageProcessor.h LedRange.h SdrHorizontalRegionProcessor.h SdrVerticalRegionProcessor.h ColorConversion.h HdrVerticalRegionProcessor.h HdrHorizontalRegionProcessor.h ColorPostProcessor.h) + if (WIN32) add_definitions(-D_MBCS -DWIN32 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCKAPI_ -D_WINSOCK_DEPRECATED_NO_WARNINGS -DWIN32_LEAN_AND_MEAN -DNOMINMAX) + target_include_directories(${PROJECT_NAME} PUBLIC OpenRGB/dependencies/hidapi) endif() -add_library(${PROJECT_NAME} SHARED OpenRGBAmbientPlugin.h OpenRGBAmbientPlugin.cpp DeviceList.cpp DeviceList.h Settings.cpp Settings.h ScreenCapture.cpp ScreenCapture.h Limiter.cpp Limiter.h ReleaseWrapper.h SettingsTab.cpp SettingsTab.h RegionsWidget.cpp RegionsWidget.h RegionWidget.cpp RegionWidget.h LedUpdateEvent.h LedUpdateEvent.cpp ImageProcessor.h LedRange.h SdrHorizontalRegionProcessor.h SdrVerticalRegionProcessor.h ColorConversion.h HdrVerticalRegionProcessor.h HdrHorizontalRegionProcessor.h ColorPostProcessor.h) - if (NOT CMAKE_PREFIX_PATH) message(WARNING "CMAKE_PREFIX_PATH is not defined, you may need to set it " "(-DCMAKE_PREFIX_PATH=\"path/to/Qt/lib/cmake\" or -DCMAKE_PREFIX_PATH=/usr/include/{host}/qt{version}/ on Ubuntu)") @@ -27,7 +28,7 @@ endif () find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED) find_package(DirectX11) target_link_libraries(${PROJECT_NAME} ${REQUIRED_LIBS_QUALIFIED}) -target_include_directories(${PROJECT_NAME} PRIVATE OpenRGB OpenRGB/i2c_smbus OpenRGB/net_port OpenRGB/RGBController OpenRGB/dependencies/json OpenRGB/qt) +target_include_directories(${PROJECT_NAME} PRIVATE OpenRGB OpenRGB/i2c_smbus OpenRGB/net_port OpenRGB/RGBController OpenRGB/dependencies/json OpenRGB/qt OpenRBB/hidapi_wrapper) if (WIN32) target_link_libraries(${PROJECT_NAME} ${DirectX11_LIBRARY}) diff --git a/OpenRGBAmbientPlugin.cpp b/OpenRGBAmbientPlugin.cpp index 1b68c65..82780bb 100644 --- a/OpenRGBAmbientPlugin.cpp +++ b/OpenRGBAmbientPlugin.cpp @@ -55,7 +55,7 @@ OpenRGBPluginInfo OpenRGBAmbientPlugin::GetPluginInfo() return { "OpenRGBAmbientPlugin", "Desktop ambient light support", - "2.3.1", + "2.4.0", "", "https://github.com/krojew/OpenRGB-Ambient", {}, @@ -75,7 +75,7 @@ void OpenRGBAmbientPlugin::Load(bool dark_theme, ResourceManager *resource_manag { resourceManager = resource_manager_ptr; - settings = new Settings{QString::fromStdString(resourceManager->GetConfigurationDirectory() + "/OpenRGBAmbientPlugin.ini"), this}; + settings = new Settings{QString::fromStdString((resourceManager->GetConfigurationDirectory() / "OpenRGBAmbientPlugin.ini").string()), this}; connect(settings, &Settings::settingsChanged, this, &OpenRGBAmbientPlugin::updateProcessors); connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &OpenRGBAmbientPlugin::turnOffLeds, Qt::DirectConnection); diff --git a/README.md b/README.md index d57049c..819f01f 100644 --- a/README.md +++ b/README.md @@ -12,5 +12,6 @@ NZXT CAM, at the moment, is very buggy. This plugin provides a lighter and more Note: currently confirmed to be working on Windows 10 and Windows 11. -Versions older than **2.0.0** should be used with OpenRGB **0.6**, while 2.0.0 or newer should work with -OpenRGB **0.7** or newer. +Versions older than **2.0.0** should be used with OpenRGB **0.6**, while **2.3** should work with +OpenRGB **0.7** or **0.8**, and **2.4** is compatible with OpenRGB **0.9**. Yes - this is a mess, +blame OpenRGB and their lack of stable plugin API.