Publish LumaOps source

This commit is contained in:
LumaOps release export
2026-09-03 01:18:36 +02:00
commit 7f1c0e5f71
2363 changed files with 501543 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/*---------------------------------------------------------*\
| DeviceGuard.cpp |
| |
| An abstract interface for acquiring and releasing |
| a guard on a device, serving as a foundation for |
| implementing device-specific synchronization mechanisms |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "DeviceGuard.h"
DeviceGuard::DeviceGuard()
{
}
DeviceGuard::~DeviceGuard()
{
}
+24
View File
@@ -0,0 +1,24 @@
/*---------------------------------------------------------*\
| DeviceGuard.h |
| |
| An abstract interface for acquiring and releasing |
| a guard on a device, serving as a foundation for |
| implementing device-specific synchronization mechanisms |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
class DeviceGuard
{
public:
DeviceGuard();
virtual ~DeviceGuard();
virtual void Acquire() = 0;
virtual void Release() = 0;
};
+24
View File
@@ -0,0 +1,24 @@
/*---------------------------------------------------------*\
| DeviceGuardLock.cpp |
| |
| Represents a lock for a device guard, ensuring |
| exclusive access to a device when acquired and |
| releasing it when destroyed |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "DeviceGuardLock.h"
DeviceGuardLock::DeviceGuardLock(DeviceGuard& guard_ref) : guard(guard_ref)
{
guard.Acquire();
}
DeviceGuardLock::~DeviceGuardLock()
{
guard.Release();
}
+26
View File
@@ -0,0 +1,26 @@
/*---------------------------------------------------------*\
| DeviceGuardLock.h |
| |
| Represents a lock for a device guard, ensuring |
| exclusive access to a device when acquired and |
| releasing it when destroyed |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "DeviceGuard.h"
class DeviceGuardLock
{
public:
DeviceGuardLock(DeviceGuard& guard_ref);
~DeviceGuardLock();
private:
DeviceGuard& guard;
};
+29
View File
@@ -0,0 +1,29 @@
/*---------------------------------------------------------*\
| DeviceGuardManager.cpp |
| |
| Responsible for managing a DeviceGuard implementation, |
| allowing clients to wait for exclusive access to a |
| device using the DeviceGuardLock it provides |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "DeviceGuardManager.h"
DeviceGuardManager::DeviceGuardManager(DeviceGuard* guard_ptr) : guard(guard_ptr)
{
}
DeviceGuardManager::~DeviceGuardManager()
{
delete guard;
}
DeviceGuardLock DeviceGuardManager::AwaitExclusiveAccess()
{
return DeviceGuardLock(*guard);
}
+28
View File
@@ -0,0 +1,28 @@
/*---------------------------------------------------------*\
| DeviceGuardManager.h |
| |
| Responsible for managing a DeviceGuard implementation, |
| allowing clients to wait for exclusive access to a |
| device using the DeviceGuardLock it provides |
| |
| Evan Mulawski 09 May 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "DeviceGuardLock.h"
class DeviceGuardManager
{
public:
DeviceGuardManager(DeviceGuard* guard_ptr);
~DeviceGuardManager();
DeviceGuardLock AwaitExclusiveAccess();
private:
DeviceGuard* guard;
};