4 Star 8 Fork 6

Gitee 极速下载/OpenRGB

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://gitlab.com/CalcProgrammer1/OpenRGB.git
克隆/下载
DeviceDetector.h 2.44 KB
一键复制 编辑 原始数据 按行查看 历史
/*---------------------------------------------------------*\
| DeviceDetector.h |
| |
| Device detector functionality |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#pragma once
#include <functional>
#include <string>
#include <vector>
#include "ResourceManager.h"
class DeviceDetector
{
public:
DeviceDetector(std::string name, DeviceDetectorFunction detector)
{
ResourceManager::get()->RegisterDeviceDetector(name, detector);
}
};
class I2CDeviceDetector
{
public:
I2CDeviceDetector(std::string name, I2CDeviceDetectorFunction detector)
{
ResourceManager::get()->RegisterI2CDeviceDetector(name, detector);
}
};
class I2CPCIDeviceDetector
{
public:
I2CPCIDeviceDetector(std::string name, I2CPCIDeviceDetectorFunction detector, uint16_t ven_id, uint16_t dev_id, uint16_t subven_id, uint16_t subdev_id, uint8_t i2c_addr)
{
ResourceManager::get()->RegisterI2CPCIDeviceDetector(name, detector, ven_id, dev_id, subven_id, subdev_id, i2c_addr);
}
};
class I2CBusDetector
{
public:
I2CBusDetector(I2CBusDetectorFunction detector)
{
ResourceManager::get()->RegisterI2CBusDetector(detector);
}
};
class HIDDeviceDetector
{
public:
HIDDeviceDetector(std::string name, HIDDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int interface, int usage_page, int usage)
{
ResourceManager::get()->RegisterHIDDeviceDetector(name, detector, vid, pid, interface, usage_page, usage);
}
};
class HIDWrappedDeviceDetector
{
public:
HIDWrappedDeviceDetector(std::string name, HIDWrappedDeviceDetectorFunction detector, uint16_t vid, uint16_t pid, int interface, int usage_page, int usage)
{
ResourceManager::get()->RegisterHIDWrappedDeviceDetector(name, detector, vid, pid, interface, usage_page, usage);
}
};
class DynamicDetector
{
public:
DynamicDetector(std::string name, DynamicDetectorFunction detector)
{
ResourceManager::get()->RegisterDynamicDetector(name, detector);
}
};
class PreDetectionHook
{
public:
PreDetectionHook(PreDetectionHookFunction hook)
{
ResourceManager::get()->RegisterPreDetectionHook(hook);
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mirrors/OpenRGB.git
git@gitee.com:mirrors/OpenRGB.git
mirrors
OpenRGB
OpenRGB
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385