OSD: Add Accessories type indicator to USB Input OSD

This commit is contained in:
KamFretoZ 2025-08-17 22:45:50 +07:00 committed by Ty
parent bf10b55aa1
commit 9c7750b85d
40 changed files with 1347 additions and 40 deletions

View File

@ -185,7 +185,24 @@
#define ICON_PF_KEYBOARD "\xE2\x90\xBD"
#define ICON_PF_MOUSE "\xE2\x90\xBE"
#define ICON_PF_MOUSE_AND_KEYBOARD "\xE2\x90\xBF"
#define ICON_PF_DUALSHOCK2 "\xE2\x91\x81"
#define ICON_PF_DUALSHOCK2_SLASH "\xE2\x91\x82"
#define ICON_PF_GUITAR "\xE2\x91\x83"
#define ICON_PF_STEERING_WHEEL_ALT "\xE2\x91\x84"
#define ICON_PF_SEGA_SEAMIC "\xE2\x91\x85"
#define ICON_PF_JOGCON "\xE2\x91\x86"
#define ICON_PF_BUZZ_CONTROLLER "\xE2\x91\x87"
#define ICON_PF_GAMETRAK_DEVICE "\xE2\x91\x88"
#define ICON_PF_DJ_HERO_TURNTABLE "\xE2\x91\x89"
#define ICON_PF_REALPLAY_BOWLING "\xE2\x91\x8A"
#define ICON_PF_NEGCON "\xE2\x91\x8B"
#define ICON_PF_REZ_VIBRATOR "\xE2\x91\x8C"
#define ICON_PF_EYETOY_WEBCAM "\xE2\x91\x8D"
#define ICON_PF_SINGSTAR_MIC "\xE2\x91\x8E"
#define ICON_PF_GUNCON2 "\xE2\x91\x8F"
#define ICON_PF_HEADSET "\xE2\x91\x90"
#define ICON_PF_KEYBOARDMANIA "\xE2\x91\x91"
#define ICON_PF_PRINTER "\xE2\x91\x92"
#define ICON_PF_F1 "\xE2\x91\xA0"
#define ICON_PF_F2 "\xE2\x91\xA1"
#define ICON_PF_F3 "\xE2\x91\xA2"
@ -362,6 +379,7 @@
#define ICON_PF_HEARTBEAT_MAG "\xE2\x8D\xBE"
#define ICON_PF_MONITOR_CODE "\xE2\x8D\xBF"
#define ICON_PF_SIXTY_CIRCLE "\xE2\x8E\x80"
#define ICON_PF_VIDEO_CAMERA "\xE2\x8E\x81"
#define ICON_PF_SPEAKER_ALT "\xE2\x8D\xA7"
#define ICON_PF_THUNDERBOLT "\xE2\x8D\x9C"
#define ICON_PF_BACKWARD "\xE2\x8F\x8C"

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -467,7 +467,7 @@ ImFont* ImGuiManager::AddTextFont()
{
// Exclude FA and PF ranges
// clang-format off
static constexpr ImWchar range_exclude_icons[] = { 0x2198,0x2199,0x219e,0x21a7,0x21b0,0x21b3,0x21ba,0x21c3,0x21ce,0x21d4,0x21dc,0x21dd,0x21e0,0x21e3,0x21e6,0x21e8,0x21f3,0x21f3,0x21f7,0x21fb,0x2206,0x2208,0x221a,0x221a,0x227a,0x227d,0x22bf,0x22c8,0x2349,0x2349,0x235a,0x2361,0x2364,0x2367,0x237a,0x237f,0x23b2,0x23b5,0x23cc,0x23cc,0x23f4,0x23f7,0x2427,0x243a,0x243d,0x243d,0x2443,0x2443,0x2460,0x246b,0x248f,0x248f,0x24f5,0x24ff,0x2605,0x2605,0x2699,0x2699,0x278a,0x278e,0xff21,0xff3a,0x0,0x0 };
static constexpr ImWchar range_exclude_icons[] = { 0x2198,0x2199,0x219e,0x21a7,0x21b0,0x21b3,0x21ba,0x21c3,0x21ce,0x21d4,0x21dc,0x21dd,0x21e0,0x21e3,0x21e6,0x21e8,0x21f3,0x21f3,0x21f7,0x21fb,0x2206,0x2208,0x221a,0x221a,0x227a,0x227d,0x22bf,0x22c8,0x2349,0x2349,0x235a,0x2361,0x2364,0x2367,0x237a,0x237f,0x23b2,0x23b5,0x23cc,0x23cc,0x23f4,0x23f7,0x2427,0x243a,0x243d,0x243e,0x2443,0x2452,0x2460,0x246b,0x248f,0x248f,0x24f5,0x24ff,0x2605,0x2605,0x2699,0x2699,0x278a,0x278e,0xff21,0xff3a,0x0,0x0 };
// clang-format on
ImFontConfig cfg;

View File

@ -670,7 +670,7 @@ __ri void ImGuiManager::DrawInputsOverlay(float scale, float margin, float spaci
for (u32 port = 0; port < USB::NUM_PORTS; port++)
{
if (EmuConfig.USB.Ports[port].DeviceType >= 0 && !USB::GetDeviceBindings(port).empty())
if (EmuConfig.USB.Ports[port].DeviceType >= 0)
num_ports++;
}
@ -688,10 +688,7 @@ __ri void ImGuiManager::DrawInputsOverlay(float scale, float margin, float spaci
continue;
const Pad::ControllerInfo& cinfo = pad->GetInfo();
if (cinfo.icon_name)
text.format("{} {}", cinfo.icon_name, slot + 1u);
else
text.format("{} |", slot + 1u);
text.format("{} {} • {} |", ICON_FA_GAMEPAD, slot + 1u, cinfo.icon_name ? cinfo.icon_name : ICON_FA_TRIANGLE_EXCLAMATION);
for (u32 bind = 0; bind < static_cast<u32>(cinfo.bindings.size()); bind++)
{
@ -744,10 +741,9 @@ __ri void ImGuiManager::DrawInputsOverlay(float scale, float margin, float spaci
continue;
const std::span<const InputBindingInfo> bindings(USB::GetDeviceBindings(port));
if (bindings.empty())
continue;
text.format("{} {} ", ICON_PF_USB, port + 1u);
const char* icon = USB::GetDeviceIconName(port);
text.format("{} {} • {} | ", ICON_PF_USB, port + 1u, icon ? icon : ICON_FA_TRIANGLE_EXCLAMATION);
for (const InputBindingInfo& bi : bindings)
{

View File

@ -81,7 +81,7 @@ static const SettingInfo s_settings[] = {
};
const Pad::ControllerInfo PadDualshock2::ControllerInfo = {Pad::ControllerType::DualShock2, "DualShock2",
TRANSLATE_NOOP("Pad", "DualShock 2"), ICON_PF_GAMEPAD_ALT, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
TRANSLATE_NOOP("Pad", "DualShock 2"), ICON_PF_DUALSHOCK2, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
void PadDualshock2::ConfigLog()
{

View File

@ -45,7 +45,7 @@ static const SettingInfo s_settings[] = {
};
const Pad::ControllerInfo PadJogcon::ControllerInfo = {Pad::ControllerType::Jogcon, "Jogcon",
TRANSLATE_NOOP("Pad", "Jogcon"), ICON_PF_GAMEPAD_ALT, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
TRANSLATE_NOOP("Pad", "Jogcon"), ICON_PF_JOGCON, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
void PadJogcon::ConfigLog()
{

View File

@ -42,7 +42,7 @@ static const SettingInfo s_settings[] = {
};
const Pad::ControllerInfo PadNegcon::ControllerInfo = {Pad::ControllerType::Negcon, "NeGcon",
TRANSLATE_NOOP("Pad", "NeGcon"), ICON_PF_GAMEPAD_ALT, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
TRANSLATE_NOOP("Pad", "NeGcon"), ICON_PF_NEGCON, s_bindings, s_settings, Pad::VibrationCapabilities::LargeSmallMotors};
void PadNegcon::ConfigLog()
{

View File

@ -561,6 +561,15 @@ const char* USB::GetDeviceName(const std::string_view device)
return dev ? dev->Name() : TRANSLATE_NOOP("USB", "Not Connected");
}
const char* USB::GetDeviceIconName(u32 port)
{
pxAssert(port < NUM_PORTS);
if (s_usb_device_proxy[port])
return s_usb_device_proxy[port]->IconName();
else
return nullptr;
}
const char* USB::GetDeviceSubtypeName(const std::string_view device, u32 subtype)
{
const DeviceProxy* dev = RegisterDevice::instance().Device(device);

View File

@ -27,6 +27,7 @@ namespace USB
std::vector<std::pair<const char*, const char*>> GetDeviceTypes();
const char* GetDeviceName(const std::string_view device);
const char* GetDeviceIconName(u32 port);
const char* GetDeviceSubtypeName(const std::string_view device, u32 subtype);
std::span<const char*> GetDeviceSubtypes(const std::string_view device);
std::span<const InputBindingInfo> GetDeviceBindings(const std::string_view device, u32 subtype);

View File

@ -51,6 +51,7 @@ public:
virtual const char* Name() const = 0;
virtual const char* TypeName() const = 0;
virtual const char* IconName() const = 0;
virtual std::span<const char*> SubTypes() const;
virtual std::span<const InputBindingInfo> Bindings(u32 subtype) const;
virtual std::span<const SettingInfo> Settings(u32 subtype) const;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "videodev.h"
#include "usb-eyetoy-webcam.h"
#include "ov519.h"
@ -491,6 +492,11 @@ namespace usb_eyetoy
return "webcam";
}
const char* EyeToyWebCamDevice::IconName() const
{
return ICON_PF_EYETOY_WEBCAM;
}
bool EyeToyWebCamDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
EYETOYState* s = USB_CONTAINER_OF(dev, EYETOYState, dev);

View File

@ -461,6 +461,7 @@ namespace usb_eyetoy
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
std::span<const char*> SubTypes() const override;

View File

@ -32,6 +32,7 @@
#include "USB/qemu-usb/desc.h"
#include "USB/usb-hid/usb-hid.h"
#include "IconsPromptFont.h"
#include "common/Console.h"
namespace usb_hid
@ -826,6 +827,11 @@ namespace usb_hid
return "hidkbd";
}
const char* HIDKbdDevice::IconName() const
{
return ICON_PF_KEYBOARD_ALT;
}
std::span<const InputBindingInfo> HIDKbdDevice::Bindings(u32 subtype) const
{
static constexpr const InputBindingInfo info[] = {
@ -899,6 +905,11 @@ namespace usb_hid
return "hidmouse";
}
const char* HIDMouseDevice::IconName() const
{
return ICON_PF_MOUSE;
}
bool HIDMouseDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
UsbHIDState* s = USB_CONTAINER_OF(dev, UsbHIDState, dev);

View File

@ -14,6 +14,7 @@ namespace usb_hid
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
std::span<const InputBindingInfo> Bindings(u32 subtype) const override;
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
void SetBindingValue(USBDevice* dev, u32 bind, float value) const override;
@ -25,6 +26,7 @@ namespace usb_hid
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
std::span<const InputBindingInfo> Bindings(u32 subtype) const override;
float GetBindingValue(const USBDevice* dev, u32 bind) const override;
void SetBindingValue(USBDevice* dev, u32 bind, float value) const override;

View File

@ -3,6 +3,7 @@
#include "GS/GS.h"
#include "Host.h"
#include "IconsPromptFont.h"
#include "ImGui/ImGuiManager.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
@ -444,6 +445,11 @@ namespace usb_lightgun
return "guncon2";
}
const char* GunCon2Device::IconName() const
{
return ICON_PF_GUNCON2;
}
USBDevice* GunCon2Device::CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const
{
GunCon2State* s = new GunCon2State(port);

View File

@ -12,6 +12,7 @@ namespace usb_lightgun
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;

View File

@ -34,6 +34,7 @@
#include "USB/USB.h"
#include "StateWrapper.h"
#include "IconsPromptFont.h"
#include "common/Console.h"
#define BUFFER_FRAMES 200
@ -962,6 +963,11 @@ namespace usb_mic
return TRANSLATE_NOOP("USB", "Logitech USB Headset");
}
const char* HeadsetDevice::IconName() const
{
return ICON_PF_HEADSET;
}
bool HeadsetDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
HeadsetState* s = USB_CONTAINER_OF(dev, HeadsetState, dev);

View File

@ -11,6 +11,7 @@ namespace usb_mic
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* TypeName() const override;
const char* Name() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;

View File

@ -24,6 +24,7 @@
// Most stuff is based on Qemu 1.7 USB soundcard passthrough code.
#include "IconsPromptFont.h"
#include "USB/qemu-usb/qusb.h"
#include "USB/qemu-usb/desc.h"
#include "USB/qemu-usb/USBinternal.h"
@ -1204,6 +1205,11 @@ namespace usb_mic
return "singstar";
}
const char* MicrophoneDevice::IconName() const
{
return ICON_PF_SINGSTAR_MIC;
}
bool MicrophoneDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
SINGSTARMICState* s = USB_CONTAINER_OF(dev, SINGSTARMICState, dev);

View File

@ -22,6 +22,7 @@ namespace usb_mic
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
std::span<const char*> SubTypes() const override;

View File

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "IconsFontAwesome6.h"
#include "USB/qemu-usb/qusb.h"
#include "USB/qemu-usb/desc.h"
#include "USB/qemu-usb/USBinternal.h"
@ -1189,6 +1190,11 @@ namespace usb_msd
return TRANSLATE_NOOP("USB", "Mass Storage Device");
}
const char* MsdDevice::IconName() const
{
return ICON_FA_HARD_DRIVE;
}
bool MsdDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
MSDState* s = USB_CONTAINER_OF(dev, MSDState, dev);

View File

@ -19,6 +19,7 @@ namespace usb_msd
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* TypeName() const override;
const char* Name() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
std::span<const char*> SubTypes() const override;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
@ -205,6 +206,11 @@ namespace usb_pad
return "BuzzDevice";
}
const char* BuzzDevice::IconName() const
{
return ICON_PF_BUZZ_CONTROLLER;
}
bool BuzzDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
return true;

View File

@ -84,6 +84,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
@ -282,6 +283,11 @@ namespace usb_pad
return "Gametrak";
}
const char* GametrakDevice::IconName() const
{
return ICON_PF_GAMETRAK_DEVICE;
}
USBDevice* GametrakDevice::CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const
{
GametrakState* s = new GametrakState(port);

View File

@ -74,6 +74,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;

View File

@ -2,6 +2,8 @@
// SPDX-License-Identifier: GPL-3.0+
#include "usb-pad.h"
#include "IconsFontAwesome6.h"
#include "IconsPromptFont.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/usb-pad/usb-pad-sdl-ff.h"
#include "USB/USB.h"
@ -814,6 +816,11 @@ namespace usb_pad
return "Pad";
}
const char* PadDevice::IconName() const
{
return ICON_PF_STEERING_WHEEL_ALT;
}
bool PadDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
PadState* s = USB_CONTAINER_OF(dev, PadState, dev);
@ -887,6 +894,11 @@ namespace usb_pad
return "RBDrumKit";
}
const char* RBDrumKitDevice::IconName() const
{
return ICON_FA_DRUM;
}
USBDevice* RBDrumKitDevice::CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const
{
PadState* s = new PadState(port, WT_ROCKBAND1_DRUMKIT);
@ -949,6 +961,11 @@ namespace usb_pad
return "Keyboardmania";
}
const char* KeyboardmaniaDevice::IconName() const
{
return ICON_PF_KEYBOARDMANIA;
}
std::span<const char*> KeyboardmaniaDevice::SubTypes() const
{
return {};

View File

@ -72,6 +72,7 @@ namespace usb_pad
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
@ -88,6 +89,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
std::span<const char*> SubTypes() const override;
std::span<const InputBindingInfo> Bindings(u32 subtype) const override;
std::span<const SettingInfo> Settings(u32 subtype) const override;
@ -99,6 +101,7 @@ namespace usb_pad
public:
const char* Name() const;
const char* TypeName() const;
const char* IconName() const;
std::span<const char*> SubTypes() const;
std::span<const InputBindingInfo> Bindings(u32 subtype) const;
std::span<const SettingInfo> Settings(u32 subtype) const;
@ -111,6 +114,7 @@ namespace usb_pad
public:
const char* Name() const;
const char* TypeName() const;
const char* IconName() const;
std::span<const char*> SubTypes() const;
std::span<const InputBindingInfo> Bindings(u32 subtype) const;
std::span<const SettingInfo> Settings(u32 subtype) const;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
@ -285,6 +286,11 @@ namespace usb_pad
return "RealPlay";
}
const char* RealPlayDevice::IconName() const
{
return ICON_PF_REALPLAY_BOWLING;
}
USBDevice* RealPlayDevice::CreateDevice(SettingsInterface& si, u32 port, u32 type) const
{
RealPlayState* s = new RealPlayState(port, type);

View File

@ -80,6 +80,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "USB/usb-pad/usb-pad.h"
#include "USB/qemu-usb/desc.h"
#include "USB/usb-mic/usb-mic.h"
@ -341,6 +342,11 @@ namespace usb_pad
return "seamic";
}
const char* SeamicDevice::IconName() const
{
return ICON_PF_SEGA_SEAMIC;
}
std::span<const char*> SeamicDevice::SubTypes() const
{
return {};

View File

@ -26,6 +26,11 @@ namespace usb_pad
return "TrainController";
}
const char* TrainDevice::IconName() const
{
return ICON_FA_TRAIN;
}
std::span<const char*> TrainDevice::SubTypes() const
{
static const char* subtypes[] = {

View File

@ -23,6 +23,7 @@ namespace usb_pad
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
std::span<const char*> SubTypes() const override;
void UpdateSettings(USBDevice* dev, SettingsInterface& si) const override;
std::span<const SettingInfo> Settings(u32 subtype) const override;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsPromptFont.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
@ -129,6 +130,11 @@ namespace usb_pad
return "TranceVibrator";
}
const char* TranceVibratorDevice::IconName() const
{
return ICON_PF_REZ_VIBRATOR;
}
bool TranceVibratorDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
return true;

View File

@ -26,6 +26,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;

View File

@ -2,6 +2,8 @@
// SPDX-License-Identifier: GPL-3.0+
#include "Host.h"
#include "IconsFontAwesome6.h"
#include "IconsPromptFont.h"
#include "Input/InputManager.h"
#include "StateWrapper.h"
#include "USB/USB.h"
@ -235,6 +237,11 @@ namespace usb_pad
return "DJTurntable";
}
const char* DJTurntableDevice::IconName() const
{
return ICON_PF_DJ_HERO_TURNTABLE;
}
USBDevice* DJTurntableDevice::CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const
{
TurntableState* s = new TurntableState(port);

View File

@ -86,6 +86,7 @@ namespace usb_pad
public:
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
float GetBindingValue(const USBDevice* dev, u32 bind_index) const override;
void SetBindingValue(USBDevice* dev, u32 bind_index, float value) const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;

View File

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "IconsPromptFont.h"
#include "USB/qemu-usb/qusb.h"
#include "USB/qemu-usb/USBinternal.h"
#include "USB/usb-printer/usb-printer.h"
@ -331,6 +332,11 @@ namespace usb_printer
return "printer";
}
const char* PrinterDevice::IconName() const
{
return ICON_PF_PRINTER;
}
bool PrinterDevice::Freeze(USBDevice* dev, StateWrapper& sw) const
{
PrinterState* s = USB_CONTAINER_OF(dev, PrinterState, dev);

View File

@ -114,6 +114,7 @@ namespace usb_printer
USBDevice* CreateDevice(SettingsInterface& si, u32 port, u32 subtype) const override;
const char* Name() const override;
const char* TypeName() const override;
const char* IconName() const override;
bool Freeze(USBDevice* dev, StateWrapper& sw) const override;
std::span<const char*> SubTypes() const override;