Skip to content

Commit

Permalink
openrgb 0.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
krojew committed Sep 6, 2023
1 parent da3edec commit d438616
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [2.4.0]

* Compatibility with 0.9.

# [2.3.1]

* Fixed not starting capture on start with OpenRGB >= 8.0.
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand All @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions OpenRGBAmbientPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
{},
Expand All @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit d438616

Please sign in to comment.